Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server crashed when using with TextAdept #6

Closed
ghost opened this issue Mar 30, 2023 · 8 comments
Closed

Server crashed when using with TextAdept #6

ghost opened this issue Mar 30, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Mar 30, 2023

orbitalquark/textadept#388

@objeck

@objeck
Copy link
Owner

objeck commented Mar 30, 2023

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

@objeck
Copy link
Owner

objeck commented Mar 30, 2023

What version should I test against? 12.0_alpha_2?

@objeck objeck added the bug Something isn't working label Mar 31, 2023
@objeck
Copy link
Owner

objeck commented Mar 31, 2023

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

@ghost
Copy link
Author

ghost commented Mar 31, 2023

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.

@objeck
Copy link
Owner

objeck commented Apr 2, 2023

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:

  • Configure TextAdept as described above
  • Launch the MSYS2-UCRT64 shell
  • Set environment variables
    • export OBJECK_STDIO=binary
    • export PATH=$PATH:/c/objeck-lang/bin
    • export OBJECK_LIB_PATH=$PATH:/c/objeck-lang/lib
  • Start TextAdapt under the MSYS2-UCRT64 shell
    • "c:\textadept\textadept.exe"
    • In TextAdapt, "Tools -> Language Server, Start Server..."
    • Open a file ending in .obs

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
Copy link
Owner

objeck commented Apr 2, 2023

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.

@objeck objeck added duplicate This issue or pull request already exists and removed duplicate This issue or pull request already exists labels Apr 2, 2023
@objeck objeck closed this as completed Apr 2, 2023
@ghost
Copy link

ghost commented Sep 24, 2023

Thanks to objeck/objeck-lang#240 we no longer have to set the OBJECK_STDIO environment variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant