Open loziniak opened 2 years ago
I installed Red stuff (lang + LSP). confirmed the errors.
made this fix: in ~/.config/cudatext/py/cuda_lsp/language.py
line 307 changed to
try:
body = self._reader.read(int(headers.get("Content-Length", 4096)))
self._read_q.put(header_bytes + body)
But I don't have example Red project to see some info from LSP, on some random Red file I don't see any info. @loziniak Do you see any mouse-hover tooltips? some auto completion? maybe redlangserver needs some config?
On running 'redlangserver.sh' (it's now in /bin here) I got errors from server
user@PC:~$ redlangserver.sh
*** Script Error: path json-body/id: is not valid for none! type
*** Where: set-path
*** Stack:
@loziniak What is the full error log in the console (for 2 errors)?
@hiiamboris ? (nevermind)
As i wrote, I now installed last Red from 30-september and now server don't do this error. but now I get no reply from server! after it runs it dont give reply to Cud.
Now I changed settings/lsp_red.json to
{
"lexers": {
"Red": "red"
},
"cmd_unix": ["redlangserver.sh"]
}
and LSP works! mouse hover with Ctrl:
'Go to definition' works on ast-lines.red ! I click on 'output' in line 10, it jumps to line 8.
Have you tried it on Windows? If you did something, that I missed in https://github.com/loziniak/cudatext-red , write here or do a PR, thanks.
Not yet, will try it soon on Win10. I wrote info for linux https://wiki.freepascal.org/CudaText_plugins#LSP_server_for_Red
Pls re-install the LSP CLient in CudaText. this is fixed (bug from post 1).
@loziniak Now I use this .cmd file to start Redlangserver:
c:\red\red.exe --cli c:\red\redlangserver\server.red
But then server don't give any replies! LSP plugin don't get any infos. Ball is on your side.
I'm afraid I can't help much, because I don't use Windows. Maybe @hiiamboris can help?
I have Windows but have no idea how to debug the server or how it works ;)
I've fixed the "errno 10" error.
In lsp_red.json
:
"cmd_windows": ["..full..path..to\\red.exe", "--cli", "..full..path..to\\server.red"]
(batch file for some reason doesn't work for LSP)
'hover' command now works for me from the Cuda->Plugins->LSP menu.
Not sure what else is supported or how to make it less awkward to use ;)
Go to definition works, even across files sometimes, but haven't figured out yet the logic, when it works and when fails.
(Ctrl + mouse hover over an Id, calls that 'hover' window)
Added the wiki info for Windows, https://wiki.freepascal.org/CudaText_plugins#LSP_server_for_Red
pls mention there that .bat
files are not working for LSP, or someone will trip over it ;)
Added to the wiki at the end
Note: don't create .bat or .cmd file with the "red.exe" calling, because it does not work in LSP Client for some reason.
When trying to run Red language server on Windows 10, there are error messages:
More info: a discussion on Red's gitter channel