Uh oh!
There was an error while loading. Please reload this page.
Allow brace completion in comments - #12741
Conversation
Hi Anubha Mathur (@anubmat), I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
TTYL, MSBOT; |
Anubha Mathur (anubmat)
commented
Dec 8, 2016
jram (@jramsay) , Paul van Brenk (@paulvanbrenk) , Bill Ticehurst (@billti) , Vlad Yazhbin [twitter.com/vla] (@vlad), Can someone please review? |
| const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); | ||
| // Check if in a context where we don't want to perform any insertion | ||
| if (isInString(sourceFile, position) || isInComment(sourceFile, position)) { |
There was a problem hiding this comment.
This should only be the case for { not for all braces. IMO
There was a problem hiding this comment.
Doesn't work for <>. But why should it exclude () and []?
There was a problem hiding this comment.
What does C# do?
There was a problem hiding this comment.
c# does no completions for any type of braces inside comments..
There was a problem hiding this comment.
c# is smart, otherwise too outside comments, it only completes when brackets are placed in an expected location
There was a problem hiding this comment.
Ok, Don't have a strong opinion either way..
Bill Ticehurst (billti)
commented
Dec 8, 2016
How does this behave in the editor? If we auto-complete the closing brace, (so after typing the opening brace the cursor is at |
Anubha Mathur (anubmat)
commented
Dec 8, 2016
The behavior is same as outside comments, i.e. on typing the closing brace, it moves past the auto-inserted one and does not add an additional closing brace, like that |
Bill Ticehurst (billti)
commented
Dec 8, 2016
Great, thanks. If you've tried it out in VS and VS Code and the experience feels right, then 👍 :-) |
Anubha Mathur (anubmat)
commented
Dec 8, 2016
I tried and it works nicely in VS. As for VsCode, brace completion was already working inside comments. |
Allows brace completion inside comments in JS and TS files