Skip to content
New issue

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

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

Already on GitHub? # to your account

typescript syntax highlighting fails when newline in function arg list and common in return type #840

Closed
Naddiseo opened this issue Oct 10, 2020 · 0 comments

Comments

@Naddiseo
Copy link

Issue Type: Bug

Summary: The syntax highlighting for typescript fails when there's a newline in the function parameters AND the return type has 3 levels of generics where one of them has two parameters.

The best minimal test case I can provide is the following:

type Union<A,B> = A|B;

const fn = (
// newline here
): Array<Union<Array<number>, string>>=>{
    try {
        return [[1]]
    } catch (e){
        return [[1]]
    }
}

Changing the return type's nesting seems to make it work again, but it seems that the presence of the "," and the newline in the argument list makes the coloring for the function body fail.

screenshot:

typescript-highlighting

VS Code version: Code - Insiders 1.51.0-insider (f5d3ba4d61146b78f0c75c82f3f85232d3409bc1, 2020-10-09T05:34:46.257Z)
OS version: Linux x64 5.4.0-42-generic

System Info
Item Value
CPUs AMD Ryzen 7 2700 Eight-Core Processor (16 x 1377)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: disabled_software
skia_renderer: enabled_on
video_decode: unavailable_off
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) 2, 1, 1
Memory (System) 31.38GB (5.38GB free)
Process Argv --no-sandbox
Screen Reader no
VM 0%
DESKTOP_SESSION gnome
XDG_CURRENT_DESKTOP GNOME
XDG_SESSION_DESKTOP gnome
XDG_SESSION_TYPE wayland
Extensions: none
@mjbvz mjbvz transferred this issue from microsoft/vscode Oct 12, 2020
@mjbvz mjbvz removed their assignment Oct 12, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants