Comments (22)
Thanks for testing!
from lite-xl-lsp.
So I guess this issue is now fixed aswell?
from lite-xl-lsp.
same happens for me :(
I have typescript-language-server
installed via homebrew, and in my config:
local lspconfig = require "plugins.lsp.config"
lspconfig.tsserver.setup {
command = {
'/opt/homebrew/bin/typescript-language-server',
'--stdio'
}
}
from lite-xl-lsp.
What are the steps to reproduce the issue? Any custom LSP config option, like config.plugins.lsp.more_yielding = true
? Does it happen every time?
from lite-xl-lsp.
My LSP related config:
local lsp = require "plugins.lsp"
local lspconfig = require "plugins.lsp.config"
-- Normally set to false, but now true for testing
config.plugins.lsp.mouse_hover = true
lspconfig.gopls.setup()
lspconfig.pylsp.setup()
Yeah, it happens everytime I hover or I close a file which is in use by a server (a .py
or .go
file)
from lite-xl-lsp.
And now it also occurs when opening a file
from lite-xl-lsp.
Traced the issue to my configuration, something kept crashing it but it wasn't appearing in any logs. I didn't install a key requirement. Fixed it by installing it.
But this should be solved by doing a check if proc
is nil before doing anything, and perhaps restart the LSP server if neccesary?
Keeping this open for @sebkolind's problem
from lite-xl-lsp.
What's the full backtrace? You can ctrl+click
in the Log viewer to copy it.
Is it the same backtrace every time?
from lite-xl-lsp.
But this should be solved by doing a check if
proc
is nil before doing anything, and perhaps restart the LSP server if neccesary?
I'm mostly trying to understand why the server is still being used after it's stopped.
At the moment the only way I was able to reproduce the issue was with config.plugins.lsp.more_yielding = true
, so I think I'll investigate that.
from lite-xl-lsp.
Traced the issue to my configuration, something kept crashing it but it wasn't appearing in any logs. I didn't install a key requirement. Fixed it by installing it.
What was it? Maybe we can improve logging if it isn't found.
from lite-xl-lsp.
What was it? Maybe we can improve logging if it isn't found.
PyLSP was missing jedi
, all the logs said was pylsp exited, check your config
and then pylsp restarted
, but it didn't restart, which caused proc
to be nil (as the process is dead)
from lite-xl-lsp.
This is the only config that I have:
lspconfig.tsserver.setup {
command = {
'/opt/homebrew/bin/typescript-language-server',
'--stdio'
}
}
config.plugins.lsp.log_server_stderr = true
and the error that I get is:
Tue Nov 7 20:52:46 2023 [ERROR] /Users/skolind/.config/lite-xl/plugins/lsp/server.lua:1162: attempt to index a nil value (field 'proc') at /Applications/Lite XL.app/Contents/Resources/core/init.lua:1226
stack traceback:
/Users/skolind/.config/lite-xl/plugins/lsp/server.lua:1162: in function 'plugins.lsp.server.read_responses'
/Users/skolind/.config/lite-xl/plugins/lsp/server.lua:721: in function 'plugins.lsp.server.process_responses'
/Users/skolind/.config/lite-xl/plugins/lsp/init.lua:2141: in function </Users/skolind/.config/lite-xl/plugins/lsp/init.lua:2115>
[C]: in function 'xpcall'
/Applications/Lite XL.app/Contents/Resources/core/init.lua:1225: in function 'core.try'
(...tail calls...)
Tue Nov 7 20:52:46 2023 [INFO] [LSP]: typescript-language-server was shutdown, revise your configuration at /Users/skolind/.config/lite-xl/plugins/lsp/init.lua:789
Tue Nov 7 20:52:35 2023 [INFO] [LSP/typescript-language-server]: Error:
'env: node: No such file or directory
'
at /Users/skolind/.config/lite-xl/plugins/lsp/init.lua:780
I guess it's the env: node
part, but not sure what that means? I am using the LSP in other editors like Zed, Nvim etc.. with no issues.
from lite-xl-lsp.
I guess it's the env: node part, but not sure what that means?
Looks like your PATH
might not contain node
. Looking online this seems to be a common issue on macOS, so it's probably not related to Lite XL and the LSP plugin.
Still, I'm working on solving the attempt to index a nil value
part, but that won't solve your tsserver
issue.
from lite-xl-lsp.
I guess it's the env: node part, but not sure what that means?
Looks like your
PATH
might not containnode
. Looking online this seems to be a common issue on macOS, so it's probably not related to Lite XL and the LSP plugin.Still, I'm working on solving the
attempt to index a nil value
part, but that won't solve yourtsserver
issue.
My PATH
does include node
. Again, all other editors work, so not sure why it shouldn't work here?
from lite-xl-lsp.
Add this to your user module then check the Logs:
core.log("%s", os.getenv("PATH"))
local np, n_err = process.start({"node", "--version"})
if not np then
core.log("Unable to start node: %s", n_err)
else
local buf = {}
repeat
local buffer = np:read_stdout()
if buffer and #buffer > 0 then
table.insert(buf, buffer)
end
until not buffer
core.log("%s", table.concat(buf))
end
It's very possible that the PATH
depends on how you open Lite XL.
from lite-xl-lsp.
core.log("%s", os.getenv("PATH")) local np, n_err = process.start({"node", "--version"}) if not np then core.log("Unable to start node: %s", n_err) else local buf = {} repeat local buffer = np:read_stdout() if buffer and #buffer > 0 then table.insert(buf, buffer) end until not buffer core.log("%s", table.concat(buf)) end
I think you are right! It printed out this:
Tue Nov 7 21:26:02 2023 [INFO] /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin at /Users/skolind/.config/lite-xl/init.lua:68
Which is not my PATH
specified in .zshrc
.
I am opening lite
from spotlight. Which seems to not load my PATH correcrtly.
If I run /Applications/Lite\ XL.app/Contents/MacOS/lite-xl
in the terminal, it is working and the LSP is loading correctly.
Any ideas how to fix this?
from lite-xl-lsp.
I wonder if you could run typescript-language-server
from zsh
. So something like:
local lspconfig = require "plugins.lsp.config"
lspconfig.tsserver.setup {
command = {
'zsh', '-c',
'/opt/homebrew/bin/typescript-language-server --stdio'
}
}
from lite-xl-lsp.
I wonder if you could run
typescript-language-server
fromzsh
. So something like:local lspconfig = require "plugins.lsp.config" lspconfig.tsserver.setup { command = { 'zsh', '-c', '/opt/homebrew/bin/typescript-language-server --stdio' } }
Unfortunately, that doesn't seem to make a difference.
from lite-xl-lsp.
Same env: node: No such file or directory
error?
I guess you could try forcing zsh
to source your .zshrc
, like:
local lspconfig = require "plugins.lsp.config"
lspconfig.tsserver.setup {
command = {
'zsh', '-c',
'source ~/.zshrc; /opt/homebrew/bin/typescript-language-server --stdio'
}
}
from lite-xl-lsp.
lspconfig.tsserver.setup { command = { 'zsh', '-c', 'source ~/.zshrc; /opt/homebrew/bin/typescript-language-server --stdio' } }
Force sourcing .zshrc
seems to do the trick. It is a bit hacky however, but I guess it's an issue with how MacOS opens the application?
It seems to work now though, thank you so much!
from lite-xl-lsp.
Force sourcing .zshrc seems to do the trick. It is a bit hacky however, but I guess it's an issue with how MacOS opens the application?
I don't know much about macOS but a similar thing happens in some Linux DEs. There, I know a bunch of ways to make env changes "universal", so maybe there's a macOS way too.
Let me know if with #79 applied, you aren't getting attempt to index a nil value
anymore with the "bad" version of the config.
It seems to work now though, thank you so much!
No worries!
from lite-xl-lsp.
Force sourcing .zshrc seems to do the trick. It is a bit hacky however, but I guess it's an issue with how MacOS opens the application?
I don't know much about macOS but a similar thing happens in some Linux DEs. There, I know a bunch of ways to make env changes "universal", so maybe there's a macOS way too.
Let me know if with #79 applied, you aren't getting
attempt to index a nil value
anymore with the "bad" version of the config.It seems to work now though, thank you so much!
No worries!
I can't reproduce the issue with a "bad config" anymore. Awesome!
from lite-xl-lsp.
Related Issues (20)
- [Help] Please am not able to setup the intelisence for typescript HOT 21
- `settings` are never sent HOT 1
- lint+ and lsp does not work well with rust-analyzer HOT 1
- pylsp dosnt work
- Cannot find library 'widget' HOT 1
- Error creating a process: 2 HOT 2
- How could I specify the TCP port? HOT 4
- Mishandling of `process.write` HOT 7
- Integrate support for LSP Snippets
- Broken Windows command check
- LSP error: Use of undeclared identifier HOT 8
- check is always failing HOT 8
- Applying autocomplete can lead to extra chars
- feature: labelDetails support
- [Bug] High CPU usage when moving mouse around HOT 9
- [Bug] High CPU usage after closing file, with "stop_unneeded_servers" set to "true" HOT 9
- [Bug] Wrong line number gets sent to the LSP server, resulting in errors HOT 16
- Click to Goto Definition? HOT 2
- Autocomplete entries need to be truncated HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lite-xl-lsp.