-
Notifications
You must be signed in to change notification settings - Fork 756
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
Publish Bicep.LangServer binary with release so the language server can be used in other editors #1141
Comments
I'd be happy to contribute to this end if this is deemed a desirable addition |
At one point I think we were publishing the language server binary in our builds, but we took it out. @anthony-c-martin / @majastrz is there a way for us to get damien unblocked? We also have #480 just as FYI |
Thanks @alex-frankel |
Just for clarity, this isn't really blocking me as I have workarounds for clone and build so feel free to prioritise appropriately. Just interested in simplifying/streamlining that process |
I reopened it because #480 is about creating an atom package which is different than this. For VS code, we're keeping the extension size tiny by publishing runtime-agnostic binaries. Would this apply to your scenario? I would assume that the runtime is already present on your machine. The alternative would be your suggestion to publish self-contained apps (possible even single-file to reduce size further via runtime trimming) for each runtime we support. What do you think? |
It's probably a pretty safe assumption that you'd have I haven't tried the single file publishing with .NET 5 and so was even just curious what an exe published liked this would be like (probably mainly binary size after trimming I was curious). I was thinking the self-contained app (with trimming) also to the fact that if you happen not to have the runtime, the language server executable would work regardless. Summary - I'd be happy if just the dll was published as I could use that. But equally happy if a standalone executable was published to simplify things even further |
Gotcha. So I checked in our builds and the language server bits do get uploaded to artifacts (https://github.com/Azure/bicep/actions/runs/421971130). We just don't have them included with a release. |
The next release (we're planning on one this week) should include assets with the runtime-agnostic server bits. |
Thanks @majastrz |
I've got this working with neovim lsp. Install lsp shell script is (cd $(mktemp -d) \
&& curl -fLO https://github.com/Azure/bicep/releases/latest/download/bicep-langserver.zip \
&& rm -rf /usr/local/bin/bicep-langserver \
&& unzip -d /usr/local/bin/bicep-langserver bicep-langserver.zip) And then in my neovim lsp setup: local configs = require 'lspconfig/configs'
local lsputil = require 'lspconfig/util'
configs.bicep = {
default_config = {
cmd = { "dotnet", "/usr/local/bin/bicep-langserver/Bicep.LangServer.dll" };
filetypes = { "bicep" };
root_dir = lsputil.root_pattern(".git");
};
}
lsp_config.bicep.setup {
on_attach = on_attach
} I'll contribute the neovim lua changes to https://github.com/neovim/nvim-lspconfig shortly |
Awesome! Can you share a screenshot of it running? |
Awesome! Out of curiosity, were you expecting syntax highlighting to be working? Does neovim LSP support that? |
I'm not very familiar with neovim LSP, but semantic tokens are a fairly new/experimental LSP feature, which may require some extra config in neovim. |
@alex-frankel I'm not aware of neovim support for sematic tokens with LSP yet. Tracking the support of the in the protocol, there was a comment saying it'd be in the 3.16 spec which is still very recent and the LSP implementation within neovim is still in beta, so probably not a priority vs other language features. It'd be nice to have though :) |
BTW, do you know what mechanism is used in neovim for syntax highlighting? Does it support TextMate grammars? |
I'm currently using https://github.com/nvim-treesitter/nvim-treesitter Saying that, I've seen a variety of ways and plugins for language specific highlighting etc so I assume someone has built something that uses the TextMate grammar for this. |
@damienpontifex just FYI, we now have a simple textmate grammar implemented here if you'd like syntax highlighting without semantic token support: https://github.com/Azure/bicep/blob/main/src/textmate/bicep.tmlanguage |
For vim users that uses Ale, you can add this to your vimrc to enable bicep langserv. if has('unix')
packloadall
call ale#linter#Define('bicep', {
\ 'name': 'bicep-ls',
\ 'lsp': 'stdio',
\ 'executable': 'dotnet',
\ 'command': '%e /usr/local/bin/bicep-langserver/Bicep.LangServer.dll',
\ 'project_root': '.'
\})
endif
if has('win32')
packloadall
call ale#linter#Define('bicep', {
\ 'name': 'bicep-ls',
\ 'lsp': 'stdio',
\ 'executable': '%USERPROFILE%/.bicep/bicep-langserver/Bicep.LangServer.exe',
\ 'command': '%e',
\ 'project_root': '.'
\})
endif
A PR is pending in Ale repo to let Ale hadle loading of bicep langserv. |
Syntax highlighting still does not work for bicep language server when used with Neovim. I am using treesitter as well. Is there known config I can use ? |
@damienpontifex -- any help you can provide on this one? |
@barunps3 it's ongoing work within Neovim. LSP semantic tokens isn't implemented there yet. |
Is your feature request related to a problem? Please describe.
The language server can be used in other tools like neovim lsp. It'd be nice to be able to grab the latest executable of this from a release for use in other tools like this. Currently I clone the repo and build locally to use in this context
Describe the solution you'd like
A release also builds Bicep.LangServer and publishes/attaches a single file application executable such as 'bicep-ls-osx-x64' (and others per platform) to the GitHub release artifacts
The text was updated successfully, but these errors were encountered: