oni icon indicating copy to clipboard operation
oni copied to clipboard

Help with KotlinLanguageServer

Open razcore-rad opened this issue 8 years ago • 3 comments

Oni Version: 0.3.6

Neovim Version (Linux only): NVIM v0.2.2 Build type: RelWithDebInfo LuaJIT 2.1.0-beta3 Compilation: /usr/bin/cc -g -O2 -fdebug-prefix-map=/build/neovim-_mzR4z/neovim-0.2.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -DDISABLE_LOG -Wdate-time -D_FORTIFY_SOURCE=2 -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -O2 -g -DMIN_LOG_LEVEL=3 -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/build/neovim-_mzR4z/neovim-0.2.2/build/config -I/build/neovim-_mzR4z/neovim-0.2.2/src -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/build/neovim-_mzR4z/neovim-0.2.2/build/src/nvim/auto -I/build/neovim-_mzR4z/neovim-0.2.2/build/include Compiled by [email protected]

Features: +acl +iconv +jemalloc +tui See ":help feature-compile"

system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

Operating System: Linux alienware 4.15.0-29-generic #31-Ubuntu SMP Tue Jul 17 15:39:52 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Issue: Need some help with KotlinLanguageServer as mentioned in the title.

Expected behavior: KotlinLanguageServer should just work on *.kt files, I've set "language.kotlin.languageServer.command": "kotlin-language-server" as instructed, the command is in PATH and tested it in terminal, it opens normally:

 ✓ 13:34:razvan@alienware:~
 $ kotlin-language-server
13:35:11.742 INFO main  KotlinLanguageServer#connect  Connected to client

 ✓ 13:35:razvan@alienware:~
 $ which kotlin-language-server
/home/razvan/.local/bin/kotlin-language-server

Trouble is I have no idea how I could debug to see what's wrong so any help would be appreciated!

Actual behavior: Just installed kotlin + kotlin language server and unless I'm not understanding something, code completion etc. should just work. I couldn't find if there's any command line arguments that need to be passed to the language server, I think not, I read through some of their closed issues and it's using stdio which I read it's the only way onivim can use language servers.

Steps to reproduce: Install kotlin-language-server, open any-file.kt see for that example code completion doesn't work.

By the way, onivim is just amazing, even with some of the features in alpha, up to a week ago I was using neovim for everything but now I've switched to onivim although I never thought I'd use anything other than neovim :). Great work!

razcore-rad avatar Jul 23 '18 10:07 razcore-rad

Hello and welcome to the Oni repository! Thanks for opening your first issue here. To help us out, please make sure to include as much detail as possible - including screenshots and logs, if possible.

oni-bot avatar Jul 23 '18 10:07 oni-bot

@razcore-art thanks for raising the issue and your kind words 👍 Re. the lsp we definitely need to work on surfacing issue more easily but in this case a first place to check would be the console.

You can access this by using the command palette cmd-shift-p and typing dev this should surface a command to open the dev-tools this should show if any errors are occuring and what they are. Can you paste the output here?

Another thing to check is there is an lsp icon on the status bar when the lsp loads successfully it shows a lightning bolt otherwise it would show a spinner indicating things haven't initialised properly

akinsho avatar Jul 23 '18 13:07 akinsho

Alright @Akin909! :+1:

Thanks for the help, this put me on the right track, turns out that I had to supply the grammar in the config file since oni doesn't include it by default:

"language.kotlin.textMateGrammar": "/home/razvan/.config/oni/extensions/kotlin/syntaxes/Kotli      n.tmLanguage.json"

Found about that after reading some other issues. ~~This fixes the problem, now I just need to figure out if the language server actually works or not, errors in the code are highlighted that shouldn't be there, but that probably is more of a kotlin project/setup/language server issue - couldn't find any arguments that can be passed to the language server.~~

~~Gonna upload the pic just in case someone might know something, but will close the issue as it's resolved now! - Lack of documentation :)~~

image ~~So if anyone knows anything about it, perhaps this is related? fwcd/KotlinLanguageServer#10, but I know too little about the subject to figure it out.~~

Thanks again!

edit: All good after building kotlin language server from master branch, before I used the release, but saw a closed issue on something similar I experienced and so after trying the master branch all seems to be fixed now. It's awesome :)

razcore-rad avatar Jul 23 '18 14:07 razcore-rad