microsoft / microsoft/TypeScript-TmLanguage
Specific JS construct breaks syntax highlighting
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 471
- Forks
- 149
- PR merge metrics
- No merged PRs in 30d
Description
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.81.0 / 6445d93c81ebe42c4cbd7a60712e0b17d9463e97
- OS Version: Windows_NT x64 10.0.19045
Snippet:
function one() {
return (
{
toString: () => {
return "Something";
}
}
);
}
function two() {
return "??";
}
Screenshot:
Steps to Reproduce:
- Paste the following into a fresh file with JavaScript set as a language
- Observe keyword highlighting not working correctly for any functions following
function one
This specific nesting (a lambda function with a block inside a property of an object inside parenthesis in a return statement) triggers the effect.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue in a fresh JavaScript file using the provided snippet and confirm that highlighting after function one is incorrect. Then inspect the TypeScript-TmLanguage grammar files for handling of nested object properties, arrow functions, and return statements; done means later functions receive correct keyword highlighting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100