ZenScript icon indicating copy to clipboard operation
ZenScript copied to clipboard

A request hes failed.

Open KittenRaee opened this issue 5 years ago • 10 comments

I've installed Extension, Probe mod, added folder and whenever I try to write anything in a script, there's an error showing up: [Error - 18:42:52] Request textDocument/completion failed. Message: Request textDocument/completion failed with message: Cannot read property 'tokens' of undefined Code: -32603 [Error - 18:42:52] Request textDocument/completion failed. Message: Request textDocument/completion failed with message: Cannot read property 'tokens' of undefined Code: -32603 [Error - 18:42:52] Request textDocument/completion failed. Message: Request textDocument/completion failed with message: Cannot read property 'tokens' of undefined Code: -32603 [Error - 18:42:52] Request textDocument/completion failed. Message: Request textDocument/completion failed with message: Cannot read property 'tokens' of undefined Code: -32603 [Error - 18:42:52] Request textDocument/completion failed. Message: Request textDocument/completion failed with message: Cannot read property 'tokens' of undefined Code: -32603 [Error - 18:42:53] Request textDocument/completion failed. Message: Request textDocument/completion failed with message: Cannot read property 'tokens' of undefined Code: -32603

KittenRaee avatar May 09 '20 16:05 KittenRaee

hmm... That's strange. I cannot reproduce it.

Yesterday17 avatar May 16 '20 07:05 Yesterday17

I have a similar issue. When I create an empty .zs file or open one, I get the following:

(node:18684) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'toString' of null
    at Function.<anonymous> (/home/copygirl/.vscode-oss/extensions/yesterday17.zenscript-0.2.4/out/server/services/zsDocumentContentChange.js:37:64)
    at Generator.next (<anonymous>)
    at fulfilled (/home/copygirl/.vscode-oss/extensions/yesterday17.zenscript-0.2.4/out/server/services/zsDocumentContentChange.js:5:58)
(node:18684) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'toString' of null
    at Function.<anonymous> (/home/copygirl/.vscode-oss/extensions/yesterday17.zenscript-0.2.4/out/server/services/zsDocumentContentChange.js:37:64)
    at Generator.next (<anonymous>)
    at fulfilled (/home/copygirl/.vscode-oss/extensions/yesterday17.zenscript-0.2.4/out/server/services/zsDocumentContentChange.js:5:58)
(node:18684) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:18684) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)

When typing, I get the same error as above:

[Error - 20.00.05] Request textDocument/completion failed.
  Message: Request textDocument/completion failed with message: Cannot read property 'tokens' of undefined
  Code: -32603 

When hovering over any code, I get this:

[Error - 20.00.52] Request textDocument/hover failed.
  Message: Request textDocument/hover failed with message: Cannot read property 'isInterpreted' of undefined
  Code: -32603

Not sure if relevant, but I am on Linux. My pack has 77 mods.

copygirl avatar May 24 '20 18:05 copygirl

Seems relevant to #28. How did you open the file, directly without folder(workspace) opened?

Yesterday17 avatar May 25 '20 02:05 Yesterday17

I've opened the .minecraft folder of a MultiMC instance in VSCode.

copygirl avatar May 25 '20 04:05 copygirl

Have same issue. Sometimes errors jumps not instantly, but after some time.

  Message: Request textDocument/hover failed with message: Cannot read property 'oredictionary' of undefined
  Code: -32603 

Krutoy242 avatar May 25 '20 18:05 Krutoy242

Have same issue if i opened minecraft root folder as project folder. Issue wont happen if project folder is .scripts

(@Krutoy242 edited their message as I was writing my response.)

Ah, I see. I had tried opening the scripts folder directly before but had no luck there.

When looking at the readme, it says the following, and I decided that it meant the "minecraft folder mode" was the default (made sense to me, since I'd probably be editing both configs and scripts) and didn't think much of it.

zenscript.supportMinecraftFolderMode: Whether your active folder is 'minecraft' like, which means that the extension detects ./scripts/.zsrc, not ./.zsrc.

Perhaps you could change the way the .zsrc file is detected: When a .zs file is opened or found, travel up the directory tree to find the corresponding .zsrc. Either until the root directory, or perhaps a maximum of, say, 5 folders. You may have a good reason for the way you have it set up, though.

copygirl avatar May 25 '20 19:05 copygirl

I published v0.2.5, could you please try this version?

@KittenRaee @copygirl @Krutoy242

Yesterday17 avatar Jun 20 '20 01:06 Yesterday17

Still happens. Also, you can see keywords dont highlite propertly

Downgraded back to 1.41

Krutoy242 avatar Jun 20 '20 09:06 Krutoy242

@Krutoy242 That's strange. Could you provide a (minimal) environment to reproduce this problem?

Yesterday17 avatar Jun 20 '20 14:06 Yesterday17

@Krutoy242 That's strange. Could you provide a (minimal) environment to reproduce this problem?

This would take many hours to test. Maybe i would try one day.

Krutoy242 avatar Jun 20 '20 20:06 Krutoy242