Sarrus1 / sourcepawn-studio

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

[Suggestion] Ability to force re/start the language server #309

Closed flleeppyy closed 1 year ago

flleeppyy commented 1 year ago

What do you want to see added to the extension?

Ability to forcefully re/start the sourcepawn language server, regardless of if the previous server process closed or not

How would it help you?

I often find my self having to restart the language server often, and I'll get an error saying "Stopping the server timed out" when using the "Stop Server"/"Restart Server" buttons and I can't use them anymore, and I have to restart the extension host if I want to restart the sp language server

How often would you use this feature?

Pretty often. Language server bugs out constantly with my projects and there's no errors logged that I can report, and restarting seems to fix it temporarily.

Sarrus1 commented 1 year ago

I believe that you should be able to run those commands manually:

https://github.com/Sarrus1/sourcepawn-vscode/blob/6351a421a53895004287f59b895127ccd00d6869/package.json#L146C1-L152C9

For instance: CTRL+SHIFT+P > "Start Sourcepawn Language Server"

This should force start the server.

If it does not work: CTRL+SHIFT+P > "Reload Window", which is less convenient but more convenient than restarting the extension host.

Regarding the logs, set "sourcepawn.server.trace" to "Trace" which should print out more logs. Then, doing CTRL+SHIFT+P > "Open SourcePawn Language Server logs" and scrolling all the way to the top should give you some logs.

flleeppyy commented 1 year ago

so about that,,, image

nixtap commented 1 year ago

I have met a similar problem. I'm using this extension to write a server plugin for L4D2, and the problem now is that if I edit the code multiple times, Output[Extensions Host (Remote)] prints errors, and after multiple more errors the autocompletion feature will fail! I'm sure I've configured the settings and paths, I don't know why this is happening, only Reload Window works again. image

If i press F1 and click start language server, it shows "stopping the server timed out", then shows "client got disposed and can't be restarted".

I'm very confused, even when I reinstalled language server it didn't work.