How to create a "Hello World" LSP with vim-ale? #4572
Unanswered
coolaj86
asked this question in
Q&A - Ask for help with problems
Replies: 1 comment
-
Turns out |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Solved
https://github.com/BeyondCodeBootcamp/vim-ale-hello-world
Original
I'm trying to build an example of a very, very simple LSP server that simple returns an error on line 1 of the current buffer, no matter what:
BeyondCodeBootcamp/vim-ale-hello-world#1
Obviously, I'd like to do more than just print "Hello, World" in an error message... however, if I could get to that point, it would be miles ahead of where I'm at right now - and the rest would be relatively easy (and across the protocol boundary, on to using tools I'm familiar with).
Here's what I've got, but it neither works, nor gives an error.
What Works
:set ft
reportshellolang
hello-fmt
(the "fixer") runs and changes the file contents(see https://github.com/BeyondCodeBootcamp/vim-ale-hello-world)
What Doesn't Work
ale_linters
I've created an lsp linter config file modeled after
ale_linters/elm/elm_ls.vim
andale_linters/javascript/tsserver.vim
:~/.vim/pack/plugins/start/vim-ale-hello-world/ale_linters/hellolang/hello_lint.vim
:HelloLang Registration
~/.vim/pack/plugins/start/vim-ale-hello-world/plugin/hello_world.vim
:Hello World LSP Server
I've also created
hello-lint
and placed it in myPATH
, which is just a Hello World LSP project:The idea is that if your code has the words "foo", "bar", or "baz" there should be an LSP Error with the message
"foo" is blacklisted
.However, when I create a file with the contents of "Hello, foo bar baz", I get neither an internal error, nor the expected error. It seems like either the linting isn't happening, isn't being reported, or isn't in a format that vim-ale understands.
LSP Server Code
Beta Was this translation helpful? Give feedback.
All reactions