Sarrus1 / sourcepawn-studio

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

Hover/Goto over methodmap methods and properties names throws errors. #399

Closed Alienmario closed 3 months ago

Alienmario commented 4 months ago

Basic informations

#include <sourcemod>

methodmap Foo < DataPack
{
    public Foo() // <------
    {
        return view_as<Foo>(new DataPack());
    }

    public void bar() // <------
    {

    }

    property int prop // <------
    {
        public get()
        {
            return 1;
        }
    }
}

image

Panic context:
> 
version: 0.13.0
request: textDocument/definition GotoDefinitionParams {
    text_document_position_params: TextDocumentPositionParams {
        text_document: TextDocumentIdentifier {
            uri: Url {
                scheme: "file",
                cannot_be_a_base: false,
                username: "",
                password: None,
                host: None,
                port: None,
                path: "/c%3A/VCS/SourceCoop/scripting/test.sp",
                query: None,
                fragment: None,
            },
        },
        position: Position {
            line: 4,
            character: 10,
        },
    },
    work_done_progress_params: WorkDoneProgressParams {
        work_done_token: None,
    },
    partial_result_params: PartialResultParams {
        partial_result_token: None,
    },
}

thread 'Worker' panicked at crates\hir-def\src\ast_id_map.rs:207:19:
index out of bounds: the len is 44 but the index is 71
stack backtrace:
   0:     0x7ff79b6228ea - <unknown>
   1:     0x7ff79b646fdb - <unknown>
   2:     0x7ff79b61da61 - <unknown>
   3:     0x7ff79b6226d6 - <unknown>
   4:     0x7ff79b624f4f - <unknown>
   5:     0x7ff79b624be7 - <unknown>
   6:     0x7ff79b4464af - <unknown>
   7:     0x7ff79b6254bc - <unknown>
   8:     0x7ff79b625349 - <unknown>
   9:     0x7ff79b6231f9 - <unknown>
  10:     0x7ff79b625006 - <unknown>
  11:     0x7ff79b6eb047 - tree_sitter_sourcepawn
  12:     0x7ff79b6eb214 - tree_sitter_sourcepawn
  13:     0x7ff79b30a58e - <unknown>
  14:     0x7ff79b2ec7bd - <unknown>
  15:     0x7ff79b2eacc1 - <unknown>
  16:     0x7ff79b283cf0 - <unknown>
  17:     0x7ff79b288abc - <unknown>
  18:     0x7ff79b25f16a - <unknown>
  19:     0x7ff79b2650ec - <unknown>
  20:     0x7ff79b260736 - <unknown>
  21:     0x7ff79b1690a6 - <unknown>
  22:     0x7ff79b136221 - <unknown>
  23:     0x7ff79b14ca1f - <unknown>
  24:     0x7ff79b446bf6 - <unknown>
  25:     0x7ff79b448292 - <unknown>
  26:     0x7ff79b631edc - <unknown>
  27:     0x7ffaf7ae257d - BaseThreadInitThunk
  28:     0x7ffaf98aaa48 - RtlUserThreadStart
[Error - 10:45:52 PM] Request textDocument/definition failed.
  Message: request handler panicked: index out of bounds: the len is 44 but the index is 71
  Code: -32603 
Panic context:
> 
version: 0.13.0
request: textDocument/hover HoverParams {
    text_document_position_params: TextDocumentPositionParams {
        text_document: TextDocumentIdentifier {
            uri: Url {
                scheme: "file",
                cannot_be_a_base: false,
                username: "",
                password: None,
                host: None,
                port: None,
                path: "/c%3A/VCS/SourceCoop/scripting/test.sp",
                query: None,
                fragment: None,
            },
        },
        position: Position {
            line: 4,
            character: 10,
        },
    },
    work_done_progress_params: WorkDoneProgressParams {
        work_done_token: None,
    },
}

thread 'Worker' panicked at crates\hir-def\src\ast_id_map.rs:207:19:
index out of bounds: the len is 44 but the index is 71
stack backtrace:
   0:     0x7ff79b6228ea - <unknown>
   1:     0x7ff79b646fdb - <unknown>
   2:     0x7ff79b61da61 - <unknown>
   3:     0x7ff79b6226d6 - <unknown>
   4:     0x7ff79b624f4f - <unknown>
   5:     0x7ff79b624be7 - <unknown>
   6:     0x7ff79b4464af - <unknown>
   7:     0x7ff79b6254bc - <unknown>
   8:     0x7ff79b625349 - <unknown>
   9:     0x7ff79b6231f9 - <unknown>
  10:     0x7ff79b625006 - <unknown>
  11:     0x7ff79b6eb047 - tree_sitter_sourcepawn
  12:     0x7ff79b6eb214 - tree_sitter_sourcepawn
  13:     0x7ff79b30a58e - <unknown>
  14:     0x7ff79b2ec7bd - <unknown>
  15:     0x7ff79b2eacc1 - <unknown>
  16:     0x7ff79b283cf0 - <unknown>
  17:     0x7ff79b288abc - <unknown>
  18:     0x7ff79b28b048 - <unknown>
  19:     0x7ff79b2608c4 - <unknown>
  20:     0x7ff79b169edc - <unknown>
  21:     0x7ff79b135c43 - <unknown>
  22:     0x7ff79b14918e - <unknown>
  23:     0x7ff79b446bf6 - <unknown>
  24:     0x7ff79b448292 - <unknown>
  25:     0x7ff79b631edc - <unknown>
  26:     0x7ffaf7ae257d - BaseThreadInitThunk
  27:     0x7ffaf98aaa48 - RtlUserThreadStart
[Error - 10:45:53 PM] Request textDocument/hover failed.
  Message: request handler panicked: index out of bounds: the len is 44 but the index is 71
  Code: -32603