Skip to content
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

Add blueprint language #7213

Merged
merged 3 commits into from
Jun 5, 2023
Merged

Conversation

ivktac
Copy link
Contributor

@ivktac ivktac commented Jun 3, 2023

  • Add blueprint tree-sitter queries

Screenshot from 2023-06-03 10-01-42

Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor nit, otherwise this looks good.

It looks like blueprint includes an official language server that could be added too if it works out of the box: https://jwestman.pages.gitlab.gnome.org/blueprint-compiler/#features

(Connects #7121)

languages.toml Outdated

[[grammar]]
name = "blueprint"
source = { git = "https://gitlab.com/gabmus/tree-sitter-blueprint.git", rev = "7f1a5df44861291d6951b6b2146a9fef4c226e14" }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
source = { git = "https://gitlab.com/gabmus/tree-sitter-blueprint.git", rev = "7f1a5df44861291d6951b6b2146a9fef4c226e14" }
source = { git = "https://gitlab.com/gabmus/tree-sitter-blueprint", rev = "7f1a5df44861291d6951b6b2146a9fef4c226e14" }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@the-mikedavis the-mikedavis added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. A-language-support Area: Support for programming/text languages labels Jun 4, 2023
@ivktac
Copy link
Contributor Author

ivktac commented Jun 5, 2023

I'd like to note that the LSP does not seem to be working correctly. I don't know if the problem is in my configuration (I just copy-pasted from https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#blueprint_ls) or with blueprint-compiler.

helix.log

2023-06-05T03:27:11.812 helix_lsp::transport [INFO] blueprint-compiler -> {"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{"general":{"positionEncodings":["utf-8","utf-32","utf-16"]},"textDocument":{"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"completion":{"completionItem":{"deprecatedSupport":true,"insertReplaceSupport":true,"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]},"snippetSupport":true,"tagSupport":{"valueSet":[1]}},"completionItemKind":{}},"hover":{"contentFormat":["markdown"]},"inlayHint":{"dynamicRegistration":false},"publishDiagnostics":{"versionSupport":true},"rename":{"dynamicRegistration":false,"honorsChangeAnnotations":false,"prepareSupport":true},"signatureHelp":{"signatureInformation":{"activeParameterSupport":true,"documentationFormat":["markdown"],"parameterInformation":{"labelOffsetSupport":true}}}},"window":{"workDoneProgress":true},"workspace":{"applyEdit":true,"configuration":true,"didChangeConfiguration":{"dynamicRegistration":false},"executeCommand":{"dynamicRegistration":false},"inlayHint":{"refreshSupport":false},"symbol":{"dynamicRegistration":false},"workspaceEdit":{"documentChanges":true,"failureHandling":"abort","normalizesLineEndings":false,"resourceOperations":["create","rename","delete"]},"workspaceFolders":true}},"clientInfo":{"name":"helix","version":"23.05 (1cdb64bf)"},"processId":34747,"rootPath":"/home/seshotake/Documents/Projects/FlashCards","rootUri":"file:///home/seshotake/Documents/Projects/FlashCards","workspaceFolders":[{"name":"FlashCards","uri":"file:///home/seshotake/Documents/Projects/FlashCards"}]},"id":0}
2023-06-05T03:27:11.908 helix_lsp::transport [ERROR] blueprint-compiler err <- "input: {\"jsonrpc\":\"2.0\",\"method\":\"initialize\",\"params\":{\"capabilities\":{\"general\":{\"positionEncodings\":[\"utf-8\",\"utf-32\",\"utf-16\"]},\"textDocument\":{\"codeAction\":{\"codeActionLiteralSupport\":{\"codeActionKind\":{\"valueSet\":[\"\",\"quickfix\",\"refactor\",\"refactor.extract\",\"refactor.inline\",\"refactor.rewrite\",\"source\",\"source.organizeImports\"]}}},\"completion\":{\"completionItem\":{\"deprecatedSupport\":true,\"insertReplaceSupport\":true,\"resolveSupport\":{\"properties\":[\"documentation\",\"detail\",\"additionalTextEdits\"]},\"snippetSupport\":true,\"tagSupport\":{\"valueSet\":[1]}},\"completionItemKind\":{}},\"hover\":{\"contentFormat\":[\"markdown\"]},\"inlayHint\":{\"dynamicRegistration\":false},\"publishDiagnostics\":{\"versionSupport\":true},\"rename\":{\"dynamicRegistration\":false,\"honorsChangeAnnotations\":false,\"prepareSupport\":true},\"signatureHelp\":{\"signatureInformation\":{\"activeParameterSupport\":true,\"documentationFormat\":[\"markdown\"],\"parameterInformation\":{\"labelOffsetSupport\":true}}}},\"window\":{\"workDoneProgress\":true},\"workspace\":{\"applyEdit\":true,\"configuration\":true,\"didChangeConfiguration\":{\"dynamicRegistration\":false},\"executeCommand\":{\"dynamicRegistration\":false},\"inlayHint\":{\"refreshSupport\":false},\"symbol\":{\"dynamicRegistration\":false},\"workspaceEdit\":{\"documentChanges\":true,\"failureHandling\":\"abort\",\"normalizesLineEndings\":false,\"resourceOperations\":[\"create\",\"rename\",\"delete\"]},\"workspaceFolders\":true}},\"clientInfo\":{\"name\":\"helix\",\"version\":\"23.05 (1cdb64bf)\"},\"processId\":34747,\"rootPath\":\"/home/seshotake/Documents/Projects/FlashCards\",\"rootUri\":\"file:///home/seshotake/Documents/Projects/FlashCards\",\"workspaceFolders\":[{\"name\":\"FlashCards\",\"uri\":\"file:///home/seshotake/Documents/Projects/FlashCards\"}]},\"id\":0}\n"
2023-06-05T03:27:11.909 helix_lsp::transport [INFO] blueprint-compiler <- {"id":0,"result":{"capabilities":{"textDocumentSync":{"openClose":true,"change":2},"semanticTokensProvider":{"legend":{"tokenTypes":["enumMember"]},"full":true},"completionProvider":{},"codeActionProvider":{},"hoverProvider":true},"serverInfo":{"name":"Blueprint","version":"0.8.1"}},"jsonrpc":"2.0"}

2023-06-05T03:27:11.909 helix_lsp::transport [ERROR] blueprint-compiler err <- "output: {\"id\":0,\"result\":{\"capabilities\":{\"textDocumentSync\":{\"openClose\":true,\"change\":2},\"semanticTokensProvider\":{\"legend\":{\"tokenTypes\":[\"enumMember\"]},\"full\":true},\"completionProvider\":{},\"codeActionProvider\":{},\"hoverProvider\":true},\"serverInfo\":{\"name\":\"Blueprint\",\"version\":\"0.8.1\"}},\"jsonrpc\":\"2.0\"}\r\n"
2023-06-05T03:27:11.909 helix_lsp::transport [ERROR] blueprint-compiler err <- "\n"
2023-06-05T03:27:11.909 helix_lsp::transport [INFO] blueprint-compiler <- {"capabilities":{"codeActionProvider":{},"completionProvider":{},"hoverProvider":true,"semanticTokensProvider":{"full":true,"legend":{"tokenTypes":["enumMember"]}},"textDocumentSync":{"change":2,"openClose":true}},"serverInfo":{"name":"Blueprint","version":"0.8.1"}}
2023-06-05T03:27:11.909 helix_lsp [ERROR] failed to initialize language server: failed to parse: data did not match any variant of untagged enum SemanticTokensServerCapabilities
2023-06-05T03:27:12.189 helix_view::document [DEBUG] id 2 modified - last saved: 0, current: 0

@the-mikedavis
Copy link
Member

the-mikedavis commented Jun 5, 2023

Ah ok, we can leave it out of this PR and leave it for future work. That looks like an upstream issue where the language server is sending something for the semantic tokens provider capabilities that doesn't match the LSP spec.

@ivktac
Copy link
Contributor Author

ivktac commented Jun 5, 2023

Should I revert the commit or just leave it as it is?

@the-mikedavis
Copy link
Member

Actually it's probably ok to leave it in this PR. Once that gets resolved upstream, the language server should work fine without any more changes to Helix. There isn't really any downside of a language server breaks spec like this: it just won't be initialized so the LSP features won't work.

@the-mikedavis the-mikedavis added S-waiting-on-review Status: Awaiting review from a maintainer. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 5, 2023
@gabydd
Copy link
Member

gabydd commented Jun 5, 2023

don't have gnome gitlab account so posting here the reason why SemanticTokensServerCapabilities is not being deserialized is because legend requires a tokenModifiers array: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#semanticTokensLegend which is not being provided, probably should be able to just make it an empty array

@ivktac
Copy link
Contributor Author

ivktac commented Jun 5, 2023

Thanks, @gabydd.The problem was indeed that legend had missing tokenModifiers. So, I already reported in gitlab.gnome.org and send PR to fix it to upstream

@pascalkuthe pascalkuthe merged commit 2022e61 into helix-editor:master Jun 5, 2023
@ivktac ivktac deleted the blueprint-tree-sitter branch June 5, 2023 09:51
Triton171 pushed a commit to Triton171/helix that referenced this pull request Jun 18, 2023
* Add blueprint tree-sitter support

* Add blueprint lsp support

* Run cargo xtask docgen
wes-adams pushed a commit to wes-adams/helix that referenced this pull request Jul 4, 2023
* Add blueprint tree-sitter support

* Add blueprint lsp support

* Run cargo xtask docgen
mtoohey31 pushed a commit to mtoohey31/helix that referenced this pull request Jun 2, 2024
* Add blueprint tree-sitter support

* Add blueprint lsp support

* Run cargo xtask docgen
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 2024
* Add blueprint tree-sitter support

* Add blueprint lsp support

* Run cargo xtask docgen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-support Area: Support for programming/text languages S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants