-
Notifications
You must be signed in to change notification settings - Fork 0
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
Support of other Text editors #56
Comments
I have a branch of The contribution guidelines indicate that a language server repo needs to have 100+ stars to be added to avoid bloat of short lived/not very used language servers being added into the codebase. I will keep an eye out and open the PR there when it's appropriate. Here is a minimal code block that can be added to a Neovim configuration to manually add the language server until then: -- Hot patch nvim-lspconfig to add Nextflow language server
require("lspconfig.configs").nextflow_ls = {
default_config = {
cmd = { "java", "-jar", "nextflow-language-server-all.jar" },
filetypes = { "nextflow" },
root_dir = function(fname)
local util = require("lspconfig.util")
return util.root_pattern('nextflow.config')(fname) or util.find_git_ancestor(fname)
end,
settings = {
nextflow = {
files = {
exclude = { ".git", ".nf-test", "work" },
},
},
},
},
}
-- Set up the Nextflow language server like any other language server
-- (once the language server is added upstream, this will be the only code necessary)
require("lspconfig").nextflow_ls.setup {
capabilities = vim.lsp.protocol.make_client_capabilities(),
-- on_attach = function(client, bufnr) end, -- set up on attach function
} |
@mehalter Could we use the stars from https://github.com/nextflow-io/vscode-language-nextflow in that case? 😆 It's a pretty small community, the VS Code extension only has 27K Downloads. So completly understand if that's never going to get merged in because it's too small and might not get maintained. |
Also worth noting for users that use AstroNvim there is a community language pack for Nextflow that does most of this boiler plate as well as adds syntax highlighting, filetype detection, and icons for the filetype. This can be added easily for those users as well. The link to the language pack has the instructions for setting it up, but the gist comes down to in your AstroNvim configuration you need to:
{ import = "astrocommunity.pack.nextflow" }
return {
"AstroNvim/astrolsp",
opts = {
-- This line enables the setup of the Nextfow language server
servers = { "nextflow_ls" },
configs = {
-- Must set the command with the path to your JAR file
nextflow_ls = {
cmd = { "java", "-jar", "<path to language-server-all.jar>" },
},
},
},
} (Once this gets added to Mason and |
That's a good question, plus this is an official language server of the language's organization so that probably helps rather than it being a personal project. I'll open the PR and see what they say and mention it's the officially supported language stuff. If they bounce it back then I'll just keep an eye out and keep on pressing! |
@edmundmiller opened a PR here: neovim/nvim-lspconfig#3423 Fingers crossed! Glad to see this modernization happening! |
Awesome, thank you so much for making that all happen! I'll have to try out the AstroNvim language pack now! |
@edmundmiller the neovim lspconfig PR I opened for merged in! Thanks for linking me the vs code download count! That was a valid metric for vetting the language server :) |
FYI Helix is working nicely, see pointers in #82 If you're not interested in all the Nix stuff, once you have a wrapper script called
This is my starter for ten, surely could be improved. |
Thanks for sharing this @tesujimath. Would you have any advice on getting syntax highlighting out of this setup? Previously, to work on Nextflow in helix, I was just using Groovy syntax highlighting: [[language]]
name = "groovy"
file-types = ["groovy", "nf", "config"]
indent = { tab-width = 4, unit = " " } This of course no longer works with the Nextflow LSP, but perhaps there's a way to use the Nextflow LS with Groovy syntax highlighting? Fwiw, using the groovy tree-sitter grammar for nextflow did not enable this for me. Syntax highlighting notwithstanding, though, the language server with your configuration works nicely for me as well! |
@nrminor I haven't got syntax highlighting working yet, not had much time to look further at that. Would love to see a config with that. Glad to hear it's basically working for you. (I tweaked my config for more known file types, updated above.) |
Emacs
Neovim
nextflow_ls
) neovim/nvim-lspconfig#3423Others:
The text was updated successfully, but these errors were encountered: