microsoft / TypeScript-TmLanguage

TextMate grammar files for TypeScript for VS Code, Sublime Text, and Atom.
MIT License
415 stars 128 forks source link

Multiple export defaults in Typescript overloading #857

Open zS1L3NT opened 3 years ago

zS1L3NT commented 3 years ago

Issue Type: Bug

I have a function which is overloaded a few times and I exported it as default. When I do this, the first line of export default function Tstring get's it's syntax highlighting properly. Then the next few lines of those all turn yellow (the color of functions)

VS Code version: Code 1.53.2 (622cb03f7e070a9670c94bae1a45d78d7181fbd4, 2021-02-11T11:48:04.245Z) OS version: Windows_NT x64 10.0.19041

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz (12 x 2208)| |GPU Status|2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
protected_video_decode: enabled
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|7.86GB (1.14GB free)| |Process Argv|--crash-reporter-id 0c07a3ea-19d3-4b7d-9182-a845b9918a7b| |Screen Reader|no| |VM|0%|
Extensions (34) Extension|Author (truncated)|Version ---|---|--- ng-template|Ang|11.2.2 jar-builder|asl|1.1.1 vscode-intelephense-client|bme|1.6.3 ng-html|dan|1.1.3 githistory|don|0.6.14 es7-react-js-snippets|dsz|3.1.0 EditorConfig|Edi|0.16.4 prettier-vscode|esb|5.9.2 php-debug|fel|1.14.9 php-intellisense|fel|2.3.14 php-pack|fel|1.0.2 code-runner|for|0.11.2 rest-client|hum|0.24.4 discord-vscode|icr|5.2.2 python|ms-|2021.2.576481509 jupyter|ms-|2021.2.576440691 reload|nat|0.0.6 vetur|oct|0.32.0 laravel-blade|one|1.25.0 colorful-comments|Par|0.6.0 material-icon-theme|PKi|4.5.0 java|red|0.75.0 rust|rus|0.7.8 swdc-vscode|sof|2.4.9 sass-indented|syl|1.8.15 tabnine-vscode|Tab|3.2.7 vscodeintellicode|Vis|1.2.11 vscode-java-debug|vsc|0.31.0 vscode-java-dependency|vsc|0.18.0 vscode-java-pack|vsc|0.12.1 vscode-java-test|vsc|0.28.0 vscode-maven|vsc|0.27.1 quokka-vscode|Wal|1.0.343 vscode-import-cost|wix|2.15.0
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 vstry914:30256638 pythonvsdeb440:30248342 pythonvsded773:30248341 vstes627cf:30244335 pythonvspyt875:30251590 pythontb:30258531 ```
IllusionMH commented 3 years ago

I would assume that you don't have semicolons at the end of overload lines? Reproduced only on lines that are after line without and requires default keyword image

(Latest Insiders and typescript@next)

mjbvz commented 3 years ago

Minimal code example:

export default function foo(): any
export default function foo(): any {  }
zS1L3NT commented 3 years ago

I would assume that you don't have semicolons at the end of overload lines? Reproduced only on lines that are after line without and requires default keyword image

(Latest Insiders and typescript@next)

Ok this is what I was missing. thanks

IllusionMH commented 3 years ago

Shouldn't this one be still open? Because ; is not required here for TS to work properly, but highlight is broken.

mjbvz commented 3 years ago

Yes I'm reopening because this seems like a bug with the grammar