Prevent a second pair of parenthesis from being added when there already is one
right after cursor.
Related issue and more context: https://github.com/clangd/clangd/issues/387
Differential D81380
[clangd] Don't produce snippets when completion location is followed by parenthesis kbobyrev on Jun 8 2020, 4:49 AM. Authored by
Details Prevent a second pair of parenthesis from being added when there already is one Related issue and more context: https://github.com/clangd/clangd/issues/387
Diff Detail
Event TimelineComment Actions Thanks, this is nice!
Comment Actions Make sure snippets are omitted only in the function/method/constructor calls
Comment Actions Address most comments.
Comment Actions Ship it!
|
I'd suggest rather storing the token kind as NextToken, and then deferring the actual "is it l_paren" check until toCodeCompletion.
That way the should-we-generate-snippets logic is more localized and IMO easier to read.