Dreae / sourcepawn-vscode

MIT License
33 stars 14 forks source link

Error communicating with the language server #1

Closed dordnung closed 6 years ago

dordnung commented 6 years ago

First of all: Nice extension! I've installed it and set the path to my sourcemod home. But autocompletion does not work, I always get these error messages:

[Error - 23:51:04] Request textDocument/completion failed.
  Message: Request textDocument/completion failed with message: Maximum call stack size exceeded
  Code: -32603 
[Error - 23:51:08] Request textDocument/signatureHelp failed.
  Message: Request textDocument/signatureHelp failed with message: Maximum call stack size exceeded
  Code: -32603 
0x9b4ac45e commented 6 years ago

To add to the OP, both of those errors seem to be caused (I think?) by the recursive logic in https://github.com/Dreae/sourcepawn-vscode/blob/a8dc079c0b63544147840182c9418d88b409bc0a/server/src/completions.ts#L132-L143 and https://github.com/Dreae/sourcepawn-vscode/blob/a8dc079c0b63544147840182c9418d88b409bc0a/server/src/completions.ts#L246-L253

Steps to reproduce:

  1. Make sure the "sourcepawnLanguageServer.sourcemod_home" preference is commented out/not set.
  2. Download a fresh copy of sourcemod and extract the "scripting" folder somewhere other than your original scripting folder.
  3. Open up the fresh scripting folder in vscode with the extension loaded, at this point everything should be working as intended.
  4. Download anything with a ton of includes, a good and consistent example is https://github.com/bcserv/smlib.
  5. Everything is now broken. (Or at least in my case)
Dreae commented 6 years ago

Oh my bad everyone, I neglected to update my notification emails so I just wasn't seeing notifications for this repository.

Anyway, I've reproduced this error on my end, I'll hopefully have a fix for it tonight or tomorrow.

Dreae commented 6 years ago

This particular issue is fixed by https://github.com/Dreae/sourcepawn-vscode/commit/482003811970c65e644d7aa066bce6993c271011, but autocompletion for smlib is still not going to work properly because it uses the old SourcePawn syntax, which this extension has no support for.

I've open a separate issue, #4, to address the problems with the old syntax, I'll publish a point release for this and a few other bugs once #4 is done.