-
Notifications
You must be signed in to change notification settings - Fork 39
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
Crashes when used with neovim LSP #1
Comments
hi, the very last line of the log you posted suggests to me that $USER is not being expanded. Perhaps try filling in your actual username in the neovim config and see if it works? |
Ah, I should've mentioned that I replaced my actual username with the $USER string when creating this github issue. In the configs it's the full path with my actual username everywhere. |
OK, finally got it working. I didn't know what the hell Anyway, here's what I got:
The bad news is that I'm getting an error. Here's the lsp log from neovim with debug turned on. I have no idea what I'm looking at:
|
Thanks! Looks like both of these reports showing crashing on |
FWIW, I also have this working, except for perltidy. For whatever reason it isn't tidying the file. I'm still looking to see why that is. I'm running nightly neovim, fyi. So 0.7.0-pre. |
and my tidy issue was a configuration issue. I forgot the return {
settings = {
perlnavigator = {
perlPath = '/usr/local/bin/perl',
perlcriticProfile = '/home/seth/xxx/.perlcriticrc',
perltidyProfile = '/home/seth/xxx/perltidyrc',
},
},
} I setup the server just like people above: local configs = require 'lspconfig.configs'
configs['perlnavigator'] = {
default_config = {
cmd = { 'node', '/home/seth/src/PerlNavigator/server/out/server.js', '--stdio' },
root_dir = function(fname)
return require('lspconfig').util.find_git_ancestor(fname)
end,
filetypes = { 'perl' },
settings = {},
},
} |
@WhoIsSethDaniel thanks for testing and putting this together. I greatly appreciate it. Any feedback on the extension itself? I'm curious how well it works in Neovim. If you would be willing to add the config back to lspconfig, that would be awesome. I'm not a neovim person, but lspconfig seems like it would be the right place to start. For the installer, there's currently an open ticket for a Perl server. Looks like people got stuck installing Perl modules from cpan. I've had similar issues in the past, and fixing it was one of the primary design goals. The Perl Navigator bundles all of its Perl dependencies directly in the server itself. williamboman/nvim-lsp-installer#316 |
Thanks @bscan. I don't really get the "I can't install the appropriate perl modules" complaint. My problem is working with typescript and javascript. I have no idea what I'm doing. But not everyone knows the ins-and-outs of |
I'm on a mac and use brew to install neovim. Tried using it to upgrade to --HEAD but got an error while compiling. I'll just have to wait, I guess. |
@WhoIsSethDaniel The design for the Perl Navigator is essentially "vscode handles the typescript environment, and the Perl dependencies are bundled in", which means the average vscode user can simply install from the marketplace and it should just work. This multi-language design can complicate things for other editors though. As for installation issues for Perl::LanguageServer, I've seen a few issues mentioned, often centering around Coro and libanyevent-perl. Some are mentioned in the comment thread here: https://dev.to/perldean/vscode-as-a-perl-ide-3cco . Also, my understanding is that Coro is technically not supported on Perl versions > 5.22 (although it does seem to generally work) and will throw warnings that get hidden by cpanm ( https://metacpan.org/dist/Canary-Stability/source/Stability.pm ). Perl::LanguageServer also doesn't yet work on Windows, which is a blocker for many users. @sdondley, I just pushed a commit that will allow the Navigator to continue in the event that the client doesn't respond with workspaceFolders. It only impacts a very minor feature (the ability to specify |
Yessiree, works! Nice work. Haven't played with it all yet. |
OK, both perl critic and syntax highlighting work. perltidy doesn't seem to do anything. I confirmed perltidy straight works from the command line and generates an output file with cleaned code. I've never used an IDE so I'm not sure what to look for, though. I ran this command in nvim:
No errors, but nothing happens. Badly indented code remains the same. Debug log shows something is happening, though:
|
OK perltidy is working. Just saw how @WhoIsSethDaniel set it up. |
@rage311 were you ever able to get |
Me? yes. Wrote a little tutorial for it, but it's probably already out of date: https://climatechangechat.com/fast_as_fuck_perl_language_server_and_completion.html |
oh, missed the tag. not for me. |
Whoops, missed this. I haven't tried again since, but now that neovim 0.7.0 is out I'm going to give it another try. |
@rage311 , thanks! I'm interested in your feedback. It also now works with older versions of Neovim < 0.7 with a slightly degraded feature set. I'm curious on your experiences though, especially on Perltidy. Re-reading this thread, it looks like Perltidy might not be working with the default config settings. |
It seems to work reasonably well in a proper Perl project directory. I've only scratched the surface though, so far. When I go to edit a single Perl file in an otherwise empty directory though, I get this message: I think it's looking for a .git directory for the project root? I wonder if it's possible for it to fall back to the current directory if it can't find that. With the below config, perltidy seems to work just fine when manually running:
|
Just going through and trying to clean up some tickets. This one seems to be resolved as many people use the Navigator with neovim now. If there are any other issues, feel free to re-open this ticket or submit a new one. Thanks! |
Thanks for your work on this project thus far. I'm trying to get it going in neovim and have reached the limits of my knowledge here, so maybe you can help me out.
I can't quite work out what the issue is here, but it seems like it boils down to some method not being found in Perl Navigator? I've provided all of the info that seems relevant below. Let me know if there would be anything else that's helpful.
I'm on Arch Linux with a 64-bit kernel version 5.15.23, with a perlbrew managed Perl v5.34.0.
When I open a Perl source file in neovim, a message appears at the bottom saying:
Client 1 quit with exit code 1 and signal 0
In
:LspInfo
it says 0 clients are attached to this buffer. It recognizes the config for Perl Navigator, says it's set to autostart and that it's executable, and the command matches what I've configured in the neovim config.neovim's LSP debugging output:
neovim version information:
neovim lsp config for Perl Navigator (config hints from
:help lspconfig-adding-servers
):The text was updated successfully, but these errors were encountered: