microsoft / microsoft/TypeScript-Sublime-Plugin
Typescript syntax highlighting issue
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.7k
- Forks
- 236
- Avg merge
- 21d 13h
- Merged PRs (30d)
- 1
Description
Hi! I found a syntax highlighting condition that breaks highlighting for all subsequent blocks of code. Please let me know if you need more information.
Sublime Text 3: 3.2.1 build 3207
TypeScript plugin: v3.4.1
Image:

Code:
if (something) {
// if the function param is broken onto a new line then the following block's syntax is highlighted correctly
_.each([], (item) => {
if (item) { count++; }
});
}
// here to demonstrate that syntax highlighting works as expected
if (invalid) {
let something = true;
const something = true;
this.something = true;
}
// the problematic line has to be within a block to demonstrate the issue
if (something) {
// if the function param is all in one line then the following blocks lose syntax highlighting
_.each([], (item) => { if (item) { count++; } });
// sytax highlighting still works for the current block
let something = true;
const something = true;
this.something = true;
}
// here to demonstrate that syntax highlighting does NOT work as expected
if (invalid) {
let something = true;
const something = true;
this.something = true;
}
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 Sublime Text 3 build 3207 with TypeScript plugin v3.4.1 using the supplied code sample, comparing the two _.each forms. Trace the plugin's syntax-highlighting handling for the inline callback and verify that highlighting remains correct in subsequent blocks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100