Sarrus1 / sourcepawn-studio

VSCode extension for SourcePawn scripting
https://sarrus1.github.io/sourcepawn-studio/
MIT License
140 stars 22 forks source link

Incorrect error message #349

Open fbef0102 opened 10 months ago

fbef0102 commented 10 months ago

Basic informations

Further Information

Recently I update SourcePawn Extension from v4.2.4 to v6.2.0, and I got lot of problems I also install Error Lens version: Latest (v3.14.0)

Code to reproduce the behaviour

1.

#define ShouldFixLerp() (hFixLerpValue.BoolValue)

#define ShouldAnnounceLerpChanges() (hAnnounceLerp.BoolValue)

#define DefaultLerpStyle() (hPrintLerpStyle.BoolValue)

#define ShouldLogLerpChanges() (hLogLerp.BoolValue)

image

2.

sPath[pos] = '\x0';

image

3.

b >>>= 1;
x >>>= 1;
r >>>= 8;
l >>>= 8;

image

4.

iPassTime %= 3600;
iPassTime %= 60;

image

  1. I already have include/SteamWorks.inc, probably because case-sensitive check?

    #include <steamworks> 

    image

  2. #define TYPE_UNKNOWN                  (0 << 0) // 0 | 000
    #define TYPE_CONCRETE_CHUNK           (1 << 0) // 1 | 001
    #define TYPE_TREE_TRUNK               (1 << 1) // 2 | 010
    
    int type = 5;
    switch (type)
    {
        case TYPE_CONCRETE_CHUNK: {};
        case TYPE_TREE_TRUNK: {};
        case TYPE_UNKNOWN: {};
    }

    image

Expected behaviour

All errors above should not appear because I can compile code without any errors and warnings image

Messages

sourcepawn-lsp log

[2023-10-22T13:34:42.259Z INFO] Telemetry is enabled. To disable it, use the --disable-telemetry flag.
[2023-10-22T13:34:42.259Z INFO] Starting sourcepawn-lsp version 0.12.0
[2023-10-22T13:34:42.264Z INFO] Received config [
    Object {
        "disableSyntaxLinter": Bool(false),
        "includesDirectories": Array [
            String("D:\\Github\\Private-Work\\L4D2-插件\\scripting_1.11\\include"),
        ],
        "linterArguments": Array [],
        "spcompPath": String("D:\\Github\\Private-Work\\L4D2-插件\\scripting_1.11\\spcomp.exe"),
    },
]
[2023-10-22T13:34:57.223Z ERROR] Unknown token: Range {
    start: Position {
        line: 312,
        character: 66,
    },
    end: Position {
        line: 312,
        character: 99,
    },
}
[2023-10-22T13:35:01.556Z ERROR] Unknown token: Range {
    start: Position {
        line: 417,
        character: 32,
    },
    end: Position {
        line: 417,
        character: 33,
    },
}
[2023-10-22T13:35:30.194Z WARN] Unknown notification: $/setTrace
[2023-10-22T13:35:30.195Z INFO] Received config [
    Object {
        "disableSyntaxLinter": Bool(false),
        "includesDirectories": Array [
            String("D:\\Github\\Private-Work\\L4D2-插件\\scripting_1.11\\include"),
        ],
        "linterArguments": Array [],
        "spcompPath": String("D:\\Github\\Private-Work\\L4D2-插件\\scripting_1.11\\spcomp.exe"),
    },
]
[2023-10-22T13:35:40.208Z ERROR] Unknown token: Range {
    start: Position {
        line: 312,
        character: 66,
    },
    end: Position {
        line: 312,
        character: 99,
    },
}
[2023-10-22T13:35:44.568Z ERROR] Unknown token: Range {
    start: Position {
        line: 417,
        character: 32,
    },
    end: Position {
        line: 417,
        character: 33,
    },
}
Sarrus1 commented 8 months ago

Thanks for reporting!

1, 2, 3, 4, 6 were fixed in https://github.com/Sarrus1/tree-sitter-sourcepawn/commits/main/. They will be merged into main when feat/salsa is merged. I will fix 5 at the same time as well.