carbon-language / carbon-lang

Carbon Language's main repository: documents, design, implementation, and related tools. (NOTE: Carbon Language is experimental; see README)
http://docs.carbon-lang.dev/
Other
32.24k stars 1.48k forks source link

Get the VS Code extension working again. #4037

Closed zygoloid closed 3 months ago

zygoloid commented 3 months ago

VSCode's JSON parser no longer accepts comments in at least textmate grammars, so remove the comments. It's unclear whether VSCode changed here or whether this hasn't worked since the comments were added.

Clean up the textmate grammar: refactor, add some missing operators and keywords, classify keywords as introducer / modifier as appropriate, fix comment grammar to require space after //, and generalize recognition of iN, fN, uN to recognize all such type literals.

Be more cautious in language server -- I was seeing frequent crashes for IdentifierName parse nodes whose token was not actually an identifier, presumably due to error recovery.