tact-vscode icon indicating copy to clipboard operation
tact-vscode copied to clipboard

Request textDocument/definition failed Code: -32603

Open ichewm opened this issue 1 year ago • 1 comments

Use environment: windows wsl IDE: VS code Plugin version: Tact Language Support for TON blockchain v1.4.4 Trigger method: When you double-click and select certain parameters under the .tact file to copy and paste An error will be reported in the output box below The information is

[Error - 4:29:29 PM] Request textDocument/definition failed.
  Message: Request textDocument/definition failed with message: Cannot read properties of null (reading '1')
  Code: -32603 
[Error - 4:30:50 PM] Request textDocument/definition failed.
  Message: Request textDocument/definition failed with message: Cannot read properties of null (reading '1')
  Code: -32603 
[Error - 4:30:50 PM] Request textDocument/definition failed.
  Message: Request textDocument/definition failed with message: Cannot read properties of null (reading '1')
  Code: -32603 

ichewm avatar Sep 05 '24 08:09 ichewm

Please, provide the code from .tact file, at least some part, else I can't reproduce this error.

logvik avatar Sep 05 '24 08:09 logvik

Got a similar error. At least the error code is the same.

[Error - 10:44:48 AM] Request textDocument/hover failed.
  Message: Request textDocument/hover failed with message: Cannot read properties of undefined (reading 'body')
  Code: -32603

It appears if the code contains a similar snippet.

        if(msg.status) {
            self.someFieldA = true;
            self.someFieldB = 172800;
        } else {
            self.someFieldA = true;
            self.someFieldB = 172800;
        }

But if the else branch contains only one expression, everything will work fine... Let me set commenting like this

        if(msg.status) {
            self.someFieldA = true;
            self.someFieldB = 172800;
        } else {
            //self.someFieldA = true; << This line has been turned into a comment
            self.someFieldB = 172800;
        }

everything miraculously works

        if (msg.status) {
            self.someFieldA = true;
            self.someFieldB = 172800;
        } else //self.someFieldA = true;
        self.someFieldB = 172800;

Thus, I believe the problem lies somewhere around the } else { construct.

SemenMartynov avatar Jan 10 '25 10:01 SemenMartynov

Thank you for your report. I have fixed it and scheduled an updated version for publication early next week.

logvik avatar Jan 10 '25 11:01 logvik