objeck / objeck-lsp

LSP server for Objeck
https://github.com/objeck/objeck-lang-server
Other
1 stars 1 forks source link

Server crashed when using with TextAdept #6

Closed ghost closed 1 year ago

ghost commented 1 year ago

https://github.com/orbitalquark/textadept/discussions/388

@objeck

objeck commented 1 year ago

Thanks, I will look into this this week. I suspect the issue has to do with the order of calls.

objeck commented 1 year ago

What version should I test against? 12.0_alpha_2?

ghost commented 1 year ago

You should test with the nightly version:

https://github.com/orbitalquark/textadept/releases/download/textadept_nightly/textadept_nightly.win.zip

https://github.com/orbitalquark/textadept/releases/download/textadept_nightly/textadept_nightly.modules.zip

objeck commented 1 year ago

Thanks, I need help setting the the LSP client for TextAdept. Can you ping me on Discord?

ghost commented 1 year ago

Thanks, I need help setting the the LSP client for TextAdept. Can you ping me on Discord?

I afraid I can't. We live in different parts of the world. It's day for you but it's midnight here for me. We can't talk in real time. You could setup TextAdept yourself. It's easy. First, download both of the file above and extract them, you will have two directories. Go to textadept and run textadept.exe and then close it. Rename the directory textadept-modules to just modules and move it into %userprofile%/.textadept directory. In %userprofile%/.textadept create a directory named lexers then download objeck.lua from https://github.com/iqskpduswupkcjqg/textadept-objeck-lexer/blob/main/objeck.lua and put it there. Finally open textadept.exe again, choose Edit -> Preferences and init.lua will be opened. Paste these lines to init.lua (remember to modify the paths to objeck-lsp):

lexer.detect_extensions.obs='objeck'

local lsp = require('lsp')

require('lsp').log_rpc = true

lsp.server_commands.objeck = 'obr C:/objeck-lsp/objeck_lsp.obe C:/objeck-lsp/objk_apis.json stdio'

Close init.lua then quit TextAdept. The next time you launch it, everything is already setup and ready. Just open a .obs source file, the lsp server will be auto started. About how to debug the lsp server from TextAdept, see https://github.com/orbitalquark/textadept/discussions/388#discussioncomment-5477412 (I already added everything needed to init.lua for you). After that, you should talk with the TextAdept developer on https://github.com/orbitalquark/textadept/discussions/388.

objeck commented 1 year ago

Successfully session with the Textadapt night build (downloaded on 4/2/2023) and the latest LSP/Objeck code under MSYS2-UCRT64. I made tweaks to support the Zeus IDE that benefited Textadept.

At a glance, Textadept, and the Zeus IDE do not support delta document updates and thus resend the entire document when changes are made. I added LSP support for full document updates a couple of days ago.

Steps for Text Adapt:

The steps above should work if global environment variables are set in a non-MSYS environment. However, I only use MSYS2 in my Windows VMs. So far, no errors have been reported, or unsupported messages have been detected.

objeck commented 1 year ago

Thanks, I need help setting the the LSP client for TextAdept. Can you ping me on Discord?

I afraid I can't. We live in different parts of the world. It's day for you but it's midnight here for me. We can't talk in real time. You could setup TextAdept yourself. It's easy. First, download both of the file above and extract them, you will have two directories. Go to textadept and run textadept.exe and then close it. Rename the directory textadept-modules to just modules and move it into %userprofile%/.textadept directory. In %userprofile%/.textadept create a directory named lexers then download objeck.lua from https://github.com/iqskpduswupkcjqg/textadept-objeck-lexer/blob/main/objeck.lua and put it there. Finally open textadept.exe again, choose Edit -> Preferences and init.lua will be opened. Paste these lines to init.lua (remember to modify the paths to objeck-lsp):

lexer.detect_extensions.obs='objeck'

local lsp = require('lsp')

require('lsp').log_rpc = true

lsp.server_commands.objeck = 'obr C:/objeck-lsp/objeck_lsp.obe C:/objeck-lsp/objk_apis.json stdio'

Close init.lua then quit TextAdept. The next time you launch it, everything is already setup and ready. Just open a .obs source file, the lsp server will be auto started. About how to debug the lsp server from TextAdept, see orbitalquark/textadept#388 (comment) (I already added everything needed to init.lua for you). After that, you should talk with the TextAdept developer on orbitalquark/textadept#388.

Thank you for the detailed instructions, very helpful! See above.

ghost commented 11 months ago

Thanks to https://github.com/objeck/objeck-lang/issues/240 we no longer have to set the OBJECK_STDIO environment variable.