-
-
Notifications
You must be signed in to change notification settings - Fork 54
feature: spring boot support #37
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
Comments
References:Dev Manual: Neovim thread: Emacs thread: |
Hi, I'm in a Spring team and was planning to experiment this boot-ls/neovim integration during the upcoming holiday season and then noticed that you setup this new org. I have a rough idea how this integration should be done but wanted to ask if you've done any more experiments outside what you've shared in these various gh issues I found? You just need to give me some rope here as I'm a recent neovim convert(I've used vi last 25 years but not for coding) so my lua skills are still a bit rusty. |
Due to limitations in an lsp protocol a relationship between
|
@jvalkeal Nothing other than what's in the linked branch. I think it is,
What I don't understand is, by looking at the LSP client APIs implemented in neovim, it doesn't look like there is bidirectional communication. It's so far a request response mechanism. I'm not quite sure how |
This is what I was talking about: |
Yes that "twist" originates from microsoft/language-server-protocol#1119. I'm about to try writing some code. Lsp client functionality in vscode vs neovim is slightly different what comes for hooking into client side processing. Kris has been away but I'll chat with him after holidays if there's more into a story. I think vscode's client layer has been more closed for outside access which may be reason why we needed those hooks. Neovim however is a bit more open for hooking into things. I was looking into Handlers which imho theoretically would let us replicate that same functionality(just assumption as I've yet to try it). |
@jvalkeal LSP is new to me but it seems those are just some wrappers Neovim or Lspconfig has for us to be able to override the response handlers. I suspect it is Take a look at these two command implementations for example. One is there to make the request, however vscode-java is also doing something similar This is where the exact command is defined Here they are registering the command |
@jvalkeal I think you were correct about the handler being the interface between these language servers. I was just messing around and found out these. I created this language server config in lspconfig project called ******************
{
arguments = {},
command = "_java.reloadBundles.command"
}
{
client_id = 1,
method = "workspace/executeClientCommand"
}
******************
{
arguments = {},
command = "vscode-spring-boot.ls.start"
}
{
client_id = 1,
method = "workspace/executeClientCommand"
} local util = require 'lspconfig.util'
if not vim.lsp.handlers['workspace/executeClientCommand'] then
vim.lsp.handlers['workspace/executeClientCommand'] = function(_, params, ctx) -- luacheck: ignore 122
vim.print '******************'
vim.print(params, ctx)
end
end
local root_files = {
{
'build.xml',
'pom.xml',
'settings.gradle',
'settings.gradle.kts',
},
{ 'build.gradle', 'build.gradle.kts' },
}
return {
default_config = {
cmd = {
'java',
'-Dsts.lsp.client=vscode',
'-jar',
'/home/s1n7ax/Downloads/Test/spring-boot-language-server-1.2.0-201812201920.jar',
},
filetypes = { 'java' },
root_dir = function(fname)
for _, patterns in ipairs(root_files) do
local root = util.root_pattern(unpack(patterns))(fname)
if root then
return root
end
end
end,
init_options = {},
},
docs = {
description = [[
]],
default_config = {
root_dir = [[]],
},
},
} |
@mycf Holy shit. I will look into it. |
If you have the VS Code Spring Boot extension installed, this configuration should work correctly. require("spring_boot").init_lsp_commands()
require("lspconfig").jdtls.setup {
init_options = {
bundles = require("spring_boot").java_extensions(),
},
} |
Spring boot support coming soon baby :D |
No description provided.
The text was updated successfully, but these errors were encountered: