Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax Highlighting optional class variable in type definition file. #55575

Closed
nickzelei opened this issue Aug 1, 2018 · 1 comment
Closed
Assignees
Labels
grammar Syntax highlighting grammar upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@nickzelei
Copy link

Issue Type: Bug

VSCode syntax highlighting breaks when it encounters an optional class level variable in a type definition (.d.ts) file.

The example below is a simplified version of what I was seeing in one of my emitted type definition files.

When pasting this block into a .d.ts file, you should see the variables "private readonly" below where test2?; is declared in the TestClient turn from the expected dark blue to a light blue, or the same color as the variable name. This has reaching affects throughout the file and causes other things below it to be improperly rendered. I've provided the TestClient2 definition to show a simple case of it.

// test.d.ts
export declare class TestClient {
    private readonly test1;
    private readonly test2?;
    private readonly test3;
    private readonly test4;
}

export declare class TestClient2 {
    private readonly test1;
    private readonly test2;
    private readonly test3;
    private readonly test4;
    private readonly test5;
}

VS Code version: Code 1.25.1 (1dfc5e5, 2018-07-11T15:43:53.668Z)
OS version: Windows_NT x64 10.0.16299

System Info
Item Value
CPUs Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz (8 x 3592)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: unavailable_software
video_decode: enabled
video_encode: enabled
vpx_decode: enabled
webgl: enabled
webgl2: enabled
Memory (System) 15.94GB (8.78GB free)
Process Argv C:\Program Files\Microsoft VS Code\Code.exe
Screen Reader no
VM 0%
Extensions (3)
Extension Author (truncated) Version
tslint eg2 1.0.34
vsliveshare ms- 0.3.504
vscode-icons rob 7.24.0
@mjbvz
Copy link
Collaborator

mjbvz commented Aug 2, 2018

Opened microsoft/TypeScript-TmLanguage#642 and microsoft/TypeScript-TmLanguage#643 to track this upstream

@mjbvz mjbvz closed this as completed Aug 2, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Sep 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
grammar Syntax highlighting grammar upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests

2 participants