Closed EliSauder closed 4 months ago
I made a quick test build where I changed one of the InvalidParam to InternalError just so I could see which one it is. Based on that, this should be the error that is being returned in this case: https://github.com/kristoff-it/superhtml/blob/186b4bc3d56a67e1b898834393128b2d8b9a1bc6/src/cli/lsp.zig#L156-L159
Thank you for working on this, I will look into it today asap
I assume you're experiencing these issues while working on the ZEG website, I pulled your PR branch but it seems that your latest changes aren't pushed, would you mind pushing there (or another branch) so I can start debugging this?
I could try to extract the shtml data from your log, but I'd prefer to minimize the risk of messing something up and wasting time for no reason.
I have a copy of neovim on my machine (with a bunch of bells and whistles, mason included) but I'm not an nvim user so I don't know how to setup a custom LSP right off the bat, if you think it's not too complicated, some pointers would be welcome.
In any case starting with the HTML file is enough.
I don't have my personal computer (which is setup with it atm) with me right now, however, I think the issue should be reproduceable with any shtml filetype :set filetype=shtml
when you make a change to the content.
It isn't that bad of a configuration change, but you need to point everything to my forks since that is where the changes are. I'll just work on getting a minimal setup for this.
Found the problem, sorry took me a moment because I haven't touched the LSP part in a while.
The language server expects languageId
to be superhtml
, while it's shtml
in your case. In helix there's a distinction between file extension and language name, if something similar is in NeoVim then I would suggest to do the same, otherwise I can add an alias if there's no other option.
Thanks again, looking forward to following how things develop.
Ah gotcha, I will take a look.
I've just pushed a few changes that will make the LSP more communicative in case an error like the one in this case is encountered, just an FYI.
I've found where in the setup to do the mapping of the languageId.
Here is an example with the ocamllsp: https://github.com/neovim/nvim-lspconfig/blob/fa6c2a64100c6f692bbec29bbbc8ec2663c9e869/lua/lspconfig/server_configurations/ocamllsp.lua#L21
I'll make that change and test it later today.
Also, is the lsp designed to work with normal html, or specifically .shtml files (I'm mainly asking because I'm wondering if I should setup the lsp config to attach on both html and shtml filetypes)?
Also, is the lsp designed to work with normal html, or specifically .shtml files (I'm mainly asking because I'm wondering if I should setup the lsp config to attach on both html and shtml filetypes)?
Found your stream vod :). Looks like I should be using .superhtml instead of .shtml? It also looks like .html and .xml are valid files to pass to superhtml?
Also, I checked, changing the language id does work... sorta... I now get 2-3 or so more debug messages before the client crashes, this time without reporting an error (the below logs are all I get). I wasn't able to test v0.4.0 due to #21.
[START][2024-07-23 22:42:53] LSP logging initiated
[INFO][2024-07-23 22:42:53] .../vim/lsp/rpc.lua:731 "Starting RPC client" { cmd = { "/Users/esauder/.local/share/nvim/mason/bin/superhtml", "lsp" }, extra = { cwd = "/Users/esauder/source/repos/personal/microzig-website" }}
[DEBUG][2024-07-23 22:42:53] .../vim/lsp/rpc.lua:286 "rpc.send" { id = 1, jsonrpc = "2.0", method = "initialize", params = { capabilities = { general = { positionEncodings = { "utf-16" } }, offset_encoding = "utf-8", textDocument = { callHierarchy = { dynamicRegistration = false }, codeAction = { codeActionLiteralSupport = { codeActionKind = { valueSet = { "", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" } } }, dataSupport = true, dynamicRegistration = true, isPreferredSupport = true, resolveSupport = { properties = { "edit" } } }, completion = { completionItem = { commitCharactersSupport = true, deprecatedSupport = true, documentationFormat = { "markdown", "plaintext" }, insertReplaceSupport = true, insertTextModeSupport = { valueSet = { 1, 2 } }, labelDetailsSupport = true, preselectSupport = true, resolveSupport = { properties = { "documentation", "detail", "additionalTextEdits", "sortText", "filterText", "insertText", "textEdit", "insertTextFormat", "insertTextMode" } }, snippetSupport = true, tagSupport = { valueSet = { 1 } } }, completionItemKind = { valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 } }, completionList = { itemDefaults = { "commitCharacters", "editRange", "insertTextFormat", "insertTextMode", "data" } }, contextSupport = true, dynamicRegistration = false, insertTextMode = 1 }, declaration = { linkSupport = true }, definition = { dynamicRegistration = true, linkSupport = true }, diagnostic = { dynamicRegistration = false }, documentHighlight = { dynamicRegistration = false }, documentSymbol = { dynamicRegistration = false, hierarchicalDocumentSymbolSupport = true, symbolKind = { valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 } } }, formatting = { dynamicRegistration = true }, hover = { contentFormat = { "markdown", "plaintext" }, dynamicRegistration = true }, implementation = { linkSupport = true }, inlayHint = { dynamicRegistration = true, resolveSupport = { properties = { "textEdits", "tooltip", "location", "command" } } }, publishDiagnostics = { dataSupport = true, relatedInformation = true, tagSupport = { valueSet = { 1, 2 } } }, rangeFormatting = { dynamicRegistration = true }, references = { dynamicRegistration = false }, rename = { dynamicRegistration = true, prepareSupport = true }, semanticTokens = { augmentsSyntaxTokens = true, dynamicRegistration = false, formats = { "relative" }, multilineTokenSupport = false, overlappingTokenSupport = true, requests = { full = { delta = true }, range = false }, serverCancelSupport = false, tokenModifiers = { "declaration", "definition", "readonly", "static", "deprecated", "abstract", "async", "modification", "documentation", "defaultLibrary" }, tokenTypes = { "namespace", "type", "class", "enum", "interface", "struct", "typeParameter", "parameter", "variable", "property", "enumMember", "event", "function", "method", "macro", "keyword", "modifier", "comment", "string", "number", "regexp", "operator", "decorator" } }, signatureHelp = { dynamicRegistration = false, signatureInformation = { activeParameterSupport = true, documentationFormat = { "markdown", "plaintext" }, parameterInformation = { labelOffsetSupport = true } } }, synchronization = { didSave = true, dynamicRegistration = false, willSave = true, willSaveWaitUntil = true }, typeDefinition = { linkSupport = true } }, window = { showDocument = { support = true }, showMessage = { messageActionItem = { additionalPropertiesSupport = false } }, workDoneProgress = true }, workspace = { applyEdit = true, configuration = true, didChangeConfiguration = { dynamicRegistration = false }, didChangeWatchedFiles = { dynamicRegistration = true, relativePatternSupport = true }, inlayHint = { refreshSupport = true }, semanticTokens = { refreshSupport = true }, symbol = { dynamicRegistration = false, symbolKind = { valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 } } }, workspaceEdit = { resourceOperations = { "rename", "create", "delete" } }, workspaceFolders = true } }, clientInfo = { name = "Neovim", version = "0.10.0-dev" }, initializationOptions = vim.empty_dict(), processId = 14713, rootPath = "/Users/esauder/source/repos/personal/microzig-website", rootUri = "file:///Users/esauder/source/repos/personal/microzig-website", trace = "off", workDoneToken = "1", workspaceFolders = { { name = "/Users/esauder/source/repos/personal/microzig-website", uri = "file:///Users/esauder/source/repos/personal/microzig-website" } } }}
[DEBUG][2024-07-23 22:42:53] .../vim/lsp/rpc.lua:408 "rpc.receive" { id = 1, jsonrpc = "2.0", result = { capabilities = { completionProvider = { triggerCharacters = { "<" } }, definitionProvider = true, documentFormattingProvider = true, hoverProvider = true, inlayHintProvider = true, positionEncoding = "utf-16", referencesProvider = true, semanticTokensProvider = { full = true, legend = { tokenModifiers = { "declaration", "definition", "readonly", "static", "deprecated", "abstract", "async", "modification", "documentation", "defaultLibrary", "custom_value" }, tokenTypes = { "namespace", "type", "class", "enum", "interface", "struct", "typeParameter", "parameter", "variable", "property", "enumMember", "event", "function", "method", "macro", "keyword", "modifier", "comment", "string", "number", "regexp", "operator", "decorator", "custom_value" } } }, textDocumentSync = { change = 1, openClose = true, save = true } }, serverInfo = { name = "SuperHTML LSP", version = "0.1.4" } }}
[DEBUG][2024-07-23 22:42:53] .../vim/lsp/rpc.lua:286 "rpc.send" { jsonrpc = "2.0", method = "initialized", params = vim.empty_dict()}
[DEBUG][2024-07-23 22:42:53] .../vim/lsp/rpc.lua:286 "rpc.send" { jsonrpc = "2.0", method = "textDocument/didOpen", params = { textDocument = { languageId = "superhtml", text = '<extend template="base.html"/>\n\n<title id="title" var="$page.title"></title>\n\n<div id="content">\n <nav id="intro-nav">\n <h1>zig embedded group</h1>\n <img src="img/ember.svg" alt="vectorized Ember, the awesome zeg mascot!">\n </nav>\n\n <div id="intro-grid">\n <div>\n <h2><svg viewBox="0 0 24 24">\n <path\n d="M14.4,6H20V16H13L12.6,14H7V21H5V4H14L14.4,6M14,14H16V12H18V10H16V8H14V10L13,8V6H11V8H9V6H7V8H9V10H7V12H9V10H11V12H13V10L14,12V14M11,10V8H13V10H11M14,10H16V12H14V10Z" />\n </svg>goals</h2>\n\n <ul class="bars">\n <li>provide documents on how to get started with embedded programming (for absolute newbies)</li>\n <li>provide example snippets for common operations on certain architectures (LPC, STM32, AVR, ...)</li>\n <li>provide example worked through embedded mini-projects</li>\n <li>create register definition libraries</li>\n <li>create a common interface/HAL over several architectures</li>\n <li>create a performant common set of drivers for external platforms</li>\n </ul>\n </div>\n\n <div>\n <h2><svg viewBox="0 0 24 24">\n <path\n d="M10.59,13.41C11,13.8 11,14.44 10.59,14.83C10.2,15.22 9.56,15.22 9.17,14.83C7.22,12.88 7.22,9.71 9.17,7.76V7.76L12.71,4.22C14.66,2.27 17.83,2.27 19.78,4.22C21.73,6.17 21.73,9.34 19.78,11.29L18.29,12.78C18.3,11.96 18.17,11.14 17.89,10.36L18.36,9.88C19.54,8.71 19.54,6.81 18.36,5.64C17.19,4.46 15.29,4.46 14.12,5.64L10.59,9.17C9.41,10.34 9.41,12.24 10.59,13.41M13.41,9.17C13.8,8.78 14.44,8.78 14.83,9.17C16.78,11.12 16.78,14.29 14.83,16.24V16.24L11.29,19.78C9.34,21.73 6.17,21.73 4.22,19.78C2.27,17.83 2.27,14.66 4.22,12.71L5.71,11.22C5.7,12.04 5.83,12.86 6.11,13.65L5.64,14.12C4.46,15.29 4.46,17.19 5.64,18.36C6.81,19.54 8.71,19.54 9.88,18.36L13.41,14.83C14.59,13.66 14.59,11.76 13.41,10.59C13,10.2 13,9.56 13.41,9.17Z" />\n </svg>important links</h2>\n\n <ul class="bars">\n <li><strong><a href="getting-started.htm">documentation / getting started</a></strong></li>\n <li><a href="https://github.com/ZigEmbeddedGroup/">code</a></li>\n <li><a href="https://ziglang.org/">Zig programming language</a></li>\n </ul>\n </div>\n\n <div>\n <h2><svg viewBox="0 0 24 24">\n <path\n d="M12,5.5A3.5,3.5 0 0,1 15.5,9A3.5,3.5 0 0,1 12,12.5A3.5,3.5 0 0,1 8.5,9A3.5,3.5 0 0,1 12,5.5M5,8C5.56,8 6.08,8.15 6.53,8.42C6.38,9.85 6.8,11.27 7.66,12.38C7.16,13.34 6.16,14 5,14A3,3 0 0,1 2,11A3,3 0 0,1 5,8M19,8A3,3 0 0,1 22,11A3,3 0 0,1 19,14C17.84,14 16.84,13.34 16.34,12.38C17.2,11.27 17.62,9.85 17.47,8.42C17.92,8.15 18.44,8 19,8M5.5,18.25C5.5,16.18 8.41,14.5 12,14.5C15.59,14.5 18.5,16.18 18.5,18.25V20H5.5V18.25M0,20V18.5C0,17.11 1.89,15.94 4.45,15.6C3.86,16.28 3.5,17.22 3.5,18.25V20H0M24,20H20.5V18.25C20.5,17.22 20.14,16.28 19.55,15.6C22.11,15.94 24,17.11 24,18.5V20Z" />\n </svg>community</h2>\n\n <ul class="bars">\n <li><img class="inline" src="img/chat-discord.svg"> <a href="https://discord.gg/zqa3fgv6Ma">zig\n embedded group\n discord</a></li>\n <li><img class="inline" src="img/chat-irc.svg"> <a href="irc://irc.libera.chat/microzig">microzig\n irc channel</a> (<a target="_blank"\n href="https://kiwiirc.com/nextclient/irc.libera.chat/#microzig">webchat</a>)\n </li>\n <li><img class="inline" src="img/chat-discord.svg"> <a href="https://discord.gg/TyzJXjser6">zig\n language\n discord</a>\n </li>\n </ul>\n </div>\n\n <div>\n <h2><svg viewBox="0 0 24 24">\n <path\n d="M19,20H4C2.89,20 2,19.1 2,18V6C2,4.89 2.89,4 4,4H10L12,6H19A2,2 0 0,1 21,8H21L4,8V18L6.14,10H23.21L20.93,18.5C20.7,19.37 19.92,20 19,20Z" />\n </svg>projects</h2>\n\n <ul class="bars">\n <li><a href="https://github.com/ZigEmbeddedGroup/microzig/">microzig - Cross-Device Embedded\n Framework</a></li>\n <li><a href="https://github.com/ZigEmbeddedGroup/regz/">regz - SVD and ATDF Code Generator</a></li>\n <li><a href="https://github.com/ZigEmbeddedGroup/uf2">uf2 - Generate UF2 files in your build</a></li>\n <li><a href="https://github.com/orgs/ZigEmbeddedGroup/repositories">read more…</a></li>\n </ul>\n </div>\n\n <div>\n <h2><svg viewBox="0 0 24 24">\n <path\n d="M21.33,12.91C21.42,14.46 20.71,15.95 19.44,16.86L20.21,18.35C20.44,18.8 20.47,19.33 20.27,19.8C20.08,20.27 19.69,20.64 19.21,20.8L18.42,21.05C18.25,21.11 18.06,21.14 17.88,21.14C17.37,21.14 16.89,20.91 16.56,20.5L14.44,18C13.55,17.85 12.71,17.47 12,16.9C11.5,17.05 11,17.13 10.5,17.13C9.62,17.13 8.74,16.86 8,16.34C7.47,16.5 6.93,16.57 6.38,16.56C5.59,16.57 4.81,16.41 4.08,16.11C2.65,15.47 1.7,14.07 1.65,12.5C1.57,11.78 1.69,11.05 2,10.39C1.71,9.64 1.68,8.82 1.93,8.06C2.3,7.11 3,6.32 3.87,5.82C4.45,4.13 6.08,3 7.87,3.12C9.47,1.62 11.92,1.46 13.7,2.75C14.12,2.64 14.56,2.58 15,2.58C16.36,2.55 17.65,3.15 18.5,4.22C20.54,4.75 22,6.57 22.08,8.69C22.13,9.8 21.83,10.89 21.22,11.82C21.29,12.18 21.33,12.54 21.33,12.91M16.33,11.5C16.9,11.57 17.35,12 17.35,12.57A1,1 0 0,1 16.35,13.57H15.72C15.4,14.47 14.84,15.26 14.1,15.86C14.35,15.95 14.61,16 14.87,16.07C20,16 19.4,12.87 19.4,12.82C19.34,11.39 18.14,10.27 16.71,10.33A1,1 0 0,1 15.71,9.33A1,1 0 0,1 16.71,8.33C17.94,8.36 19.12,8.82 20.04,9.63C20.09,9.34 20.12,9.04 20.12,8.74C20.06,7.5 19.5,6.42 17.25,6.21C16,3.25 12.85,4.89 12.85,5.81V5.81C12.82,6.04 13.06,6.53 13.1,6.56A1,1 0 0,1 14.1,7.56C14.1,8.11 13.65,8.56 13.1,8.56V8.56C12.57,8.54 12.07,8.34 11.67,8C11.19,8.31 10.64,8.5 10.07,8.56V8.56C9.5,8.61 9.03,8.21 9,7.66C8.92,7.1 9.33,6.61 9.88,6.56C10.04,6.54 10.82,6.42 10.82,5.79V5.79C10.82,5.13 11.07,4.5 11.5,4C10.58,3.75 9.59,4.08 8.59,5.29C6.75,5 6,5.25 5.45,7.2C4.5,7.67 4,8 3.78,9C4.86,8.78 5.97,8.87 7,9.25C7.5,9.44 7.78,10 7.59,10.54C7.4,11.06 6.82,11.32 6.3,11.13C5.57,10.81 4.75,10.79 4,11.07C3.68,11.34 3.68,11.9 3.68,12.34C3.68,13.08 4.05,13.77 4.68,14.17C5.21,14.44 5.8,14.58 6.39,14.57C6.24,14.31 6.11,14.04 6,13.76C5.81,13.22 6.1,12.63 6.64,12.44C7.18,12.25 7.77,12.54 7.96,13.08C8.36,14.22 9.38,15 10.58,15.13C11.95,15.06 13.17,14.25 13.77,13C14,11.62 15.11,11.5 16.33,11.5M18.33,18.97L17.71,17.67L17,17.83L18,19.08L18.33,18.97M13.68,10.36C13.7,9.83 13.3,9.38 12.77,9.33C12.06,9.29 11.37,9.53 10.84,10C10.27,10.58 9.97,11.38 10,12.19A1,1 0 0,0 11,13.19C11.57,13.19 12,12.74 12,12.19C12,11.92 12.07,11.65 12.23,11.43C12.35,11.33 12.5,11.28 12.66,11.28C13.21,11.31 13.68,10.9 13.68,10.36Z" />\n </svg>core members</h2>\n\n <ul class="bars">\n <li><a href="https://github.com/MasterQ32/">Felix "xq" Queißner</a></li>\n <li><a href="https://github.com/mattnite/">Matthew "mattnite" Knight</a></li>\n <li><a href="https://github.com/vesim987/">Vesim</a></li>\n <li><a href="https://github.com/FireFox317">Timon "FireFox317" Kruiper</a></li>\n <li><a href="https://github.com/SpexGuy">Martin "SpexGuy" Wickham</a></li>\n </ul>\n </div>\n </div>\n\n <footer>\n <img src="img/ember.svg" alt="vectorized Ember, the awesome zeg mascot!">\n </footer>\n</div>\n', uri = "file:///Users/esauder/source/repos/personal/microzig-website/layouts/index.html", version = 0 } }}
[INFO][2024-07-23 22:42:53] ...m/lsp/client.lua:618 "LSP[superhtml]" "server_capabilities" { server_capabilities = { completionProvider = { triggerCharacters = { "<" } }, definitionProvider = true, documentFormattingProvider = true, hoverProvider = true, inlayHintProvider = true, positionEncoding = "utf-16", referencesProvider = true, semanticTokensProvider = { full = true, legend = { tokenModifiers = { "declaration", "definition", "readonly", "static", "deprecated", "abstract", "async", "modification", "documentation", "defaultLibrary", "custom_value" }, tokenTypes = { "namespace", "type", "class", "enum", "interface", "struct", "typeParameter", "parameter", "variable", "property", "enumMember", "event", "function", "method", "macro", "keyword", "modifier", "comment", "string", "number", "regexp", "operator", "decorator", "custom_value" } } }, textDocumentSync = { change = 1, openClose = true, save = true } }}
[DEBUG][2024-07-23 22:42:53] ...m/lsp/client.lua:676 "LSP[superhtml]" "client.request" 1 "textDocument/semanticTokens/full" { textDocument = { uri = "file:///Users/esauder/source/repos/personal/microzig-website/layouts/index.html" }} <function 1> 13
[DEBUG][2024-07-23 22:42:53] .../vim/lsp/rpc.lua:286 "rpc.send" { id = 2, jsonrpc = "2.0", method = "textDocument/semanticTokens/full", params = { textDocument = { uri = "file:///Users/esauder/source/repos/personal/microzig-website/layouts/index.html" } }}
[DEBUG][2024-07-23 22:42:54] .../vim/lsp/rpc.lua:408 "rpc.receive" { jsonrpc = "2.0", method = "textDocument/publishDiagnostics", params = { diagnostics = { { message = "html_elements_cant_self_close", range = { ["end"] = { character = 7, line = 0 }, start = { character = 1, line = 0 } }, severity = 1 } }, uri = "file:///Users/esauder/source/repos/personal/microzig-website/layouts/index.html" }}
[DEBUG][2024-07-23 22:42:54] .../vim/lsp/rpc.lua:408 "rpc.receive" { id = 2, jsonrpc = "2.0"}
[DEBUG][2024-07-23 22:43:27] .../vim/lsp/rpc.lua:286 "rpc.send" { jsonrpc = "2.0", method = "textDocument/didChange", params = { contentChanges = { { text = 'extend template="base.html"/>\n\n<title id="title" var="$page.title"></title>\n\n<div id="content">\n <nav id="intro-nav">\n <h1>zig embedded group</h1>\n <img src="img/ember.svg" alt="vectorized Ember, the awesome zeg mascot!">\n </nav>\n\n <div id="intro-grid">\n <div>\n <h2><svg viewBox="0 0 24 24">\n <path\n d="M14.4,6H20V16H13L12.6,14H7V21H5V4H14L14.4,6M14,14H16V12H18V10H16V8H14V10L13,8V6H11V8H9V6H7V8H9V10H7V12H9V10H11V12H13V10L14,12V14M11,10V8H13V10H11M14,10H16V12H14V10Z" />\n </svg>goals</h2>\n\n <ul class="bars">\n <li>provide documents on how to get started with embedded programming (for absolute newbies)</li>\n <li>provide example snippets for common operations on certain architectures (LPC, STM32, AVR, ...)</li>\n <li>provide example worked through embedded mini-projects</li>\n <li>create register definition libraries</li>\n <li>create a common interface/HAL over several architectures</li>\n <li>create a performant common set of drivers for external platforms</li>\n </ul>\n </div>\n\n <div>\n <h2><svg viewBox="0 0 24 24">\n <path\n d="M10.59,13.41C11,13.8 11,14.44 10.59,14.83C10.2,15.22 9.56,15.22 9.17,14.83C7.22,12.88 7.22,9.71 9.17,7.76V7.76L12.71,4.22C14.66,2.27 17.83,2.27 19.78,4.22C21.73,6.17 21.73,9.34 19.78,11.29L18.29,12.78C18.3,11.96 18.17,11.14 17.89,10.36L18.36,9.88C19.54,8.71 19.54,6.81 18.36,5.64C17.19,4.46 15.29,4.46 14.12,5.64L10.59,9.17C9.41,10.34 9.41,12.24 10.59,13.41M13.41,9.17C13.8,8.78 14.44,8.78 14.83,9.17C16.78,11.12 16.78,14.29 14.83,16.24V16.24L11.29,19.78C9.34,21.73 6.17,21.73 4.22,19.78C2.27,17.83 2.27,14.66 4.22,12.71L5.71,11.22C5.7,12.04 5.83,12.86 6.11,13.65L5.64,14.12C4.46,15.29 4.46,17.19 5.64,18.36C6.81,19.54 8.71,19.54 9.88,18.36L13.41,14.83C14.59,13.66 14.59,11.76 13.41,10.59C13,10.2 13,9.56 13.41,9.17Z" />\n </svg>important links</h2>\n\n <ul class="bars">\n <li><strong><a href="getting-started.htm">documentation / getting started</a></strong></li>\n <li><a href="https://github.com/ZigEmbeddedGroup/">code</a></li>\n <li><a href="https://ziglang.org/">Zig programming language</a></li>\n </ul>\n </div>\n\n <div>\n <h2><svg viewBox="0 0 24 24">\n <path\n d="M12,5.5A3.5,3.5 0 0,1 15.5,9A3.5,3.5 0 0,1 12,12.5A3.5,3.5 0 0,1 8.5,9A3.5,3.5 0 0,1 12,5.5M5,8C5.56,8 6.08,8.15 6.53,8.42C6.38,9.85 6.8,11.27 7.66,12.38C7.16,13.34 6.16,14 5,14A3,3 0 0,1 2,11A3,3 0 0,1 5,8M19,8A3,3 0 0,1 22,11A3,3 0 0,1 19,14C17.84,14 16.84,13.34 16.34,12.38C17.2,11.27 17.62,9.85 17.47,8.42C17.92,8.15 18.44,8 19,8M5.5,18.25C5.5,16.18 8.41,14.5 12,14.5C15.59,14.5 18.5,16.18 18.5,18.25V20H5.5V18.25M0,20V18.5C0,17.11 1.89,15.94 4.45,15.6C3.86,16.28 3.5,17.22 3.5,18.25V20H0M24,20H20.5V18.25C20.5,17.22 20.14,16.28 19.55,15.6C22.11,15.94 24,17.11 24,18.5V20Z" />\n </svg>community</h2>\n\n <ul class="bars">\n <li><img class="inline" src="img/chat-discord.svg"> <a href="https://discord.gg/zqa3fgv6Ma">zig\n embedded group\n discord</a></li>\n <li><img class="inline" src="img/chat-irc.svg"> <a href="irc://irc.libera.chat/microzig">microzig\n irc channel</a> (<a target="_blank"\n href="https://kiwiirc.com/nextclient/irc.libera.chat/#microzig">webchat</a>)\n </li>\n <li><img class="inline" src="img/chat-discord.svg"> <a href="https://discord.gg/TyzJXjser6">zig\n language\n discord</a>\n </li>\n </ul>\n </div>\n\n <div>\n <h2><svg viewBox="0 0 24 24">\n <path\n d="M19,20H4C2.89,20 2,19.1 2,18V6C2,4.89 2.89,4 4,4H10L12,6H19A2,2 0 0,1 21,8H21L4,8V18L6.14,10H23.21L20.93,18.5C20.7,19.37 19.92,20 19,20Z" />\n </svg>projects</h2>\n\n <ul class="bars">\n <li><a href="https://github.com/ZigEmbeddedGroup/microzig/">microzig - Cross-Device Embedded\n Framework</a></li>\n <li><a href="https://github.com/ZigEmbeddedGroup/regz/">regz - SVD and ATDF Code Generator</a></li>\n <li><a href="https://github.com/ZigEmbeddedGroup/uf2">uf2 - Generate UF2 files in your build</a></li>\n <li><a href="https://github.com/orgs/ZigEmbeddedGroup/repositories">read more…</a></li>\n </ul>\n </div>\n\n <div>\n <h2><svg viewBox="0 0 24 24">\n <path\n d="M21.33,12.91C21.42,14.46 20.71,15.95 19.44,16.86L20.21,18.35C20.44,18.8 20.47,19.33 20.27,19.8C20.08,20.27 19.69,20.64 19.21,20.8L18.42,21.05C18.25,21.11 18.06,21.14 17.88,21.14C17.37,21.14 16.89,20.91 16.56,20.5L14.44,18C13.55,17.85 12.71,17.47 12,16.9C11.5,17.05 11,17.13 10.5,17.13C9.62,17.13 8.74,16.86 8,16.34C7.47,16.5 6.93,16.57 6.38,16.56C5.59,16.57 4.81,16.41 4.08,16.11C2.65,15.47 1.7,14.07 1.65,12.5C1.57,11.78 1.69,11.05 2,10.39C1.71,9.64 1.68,8.82 1.93,8.06C2.3,7.11 3,6.32 3.87,5.82C4.45,4.13 6.08,3 7.87,3.12C9.47,1.62 11.92,1.46 13.7,2.75C14.12,2.64 14.56,2.58 15,2.58C16.36,2.55 17.65,3.15 18.5,4.22C20.54,4.75 22,6.57 22.08,8.69C22.13,9.8 21.83,10.89 21.22,11.82C21.29,12.18 21.33,12.54 21.33,12.91M16.33,11.5C16.9,11.57 17.35,12 17.35,12.57A1,1 0 0,1 16.35,13.57H15.72C15.4,14.47 14.84,15.26 14.1,15.86C14.35,15.95 14.61,16 14.87,16.07C20,16 19.4,12.87 19.4,12.82C19.34,11.39 18.14,10.27 16.71,10.33A1,1 0 0,1 15.71,9.33A1,1 0 0,1 16.71,8.33C17.94,8.36 19.12,8.82 20.04,9.63C20.09,9.34 20.12,9.04 20.12,8.74C20.06,7.5 19.5,6.42 17.25,6.21C16,3.25 12.85,4.89 12.85,5.81V5.81C12.82,6.04 13.06,6.53 13.1,6.56A1,1 0 0,1 14.1,7.56C14.1,8.11 13.65,8.56 13.1,8.56V8.56C12.57,8.54 12.07,8.34 11.67,8C11.19,8.31 10.64,8.5 10.07,8.56V8.56C9.5,8.61 9.03,8.21 9,7.66C8.92,7.1 9.33,6.61 9.88,6.56C10.04,6.54 10.82,6.42 10.82,5.79V5.79C10.82,5.13 11.07,4.5 11.5,4C10.58,3.75 9.59,4.08 8.59,5.29C6.75,5 6,5.25 5.45,7.2C4.5,7.67 4,8 3.78,9C4.86,8.78 5.97,8.87 7,9.25C7.5,9.44 7.78,10 7.59,10.54C7.4,11.06 6.82,11.32 6.3,11.13C5.57,10.81 4.75,10.79 4,11.07C3.68,11.34 3.68,11.9 3.68,12.34C3.68,13.08 4.05,13.77 4.68,14.17C5.21,14.44 5.8,14.58 6.39,14.57C6.24,14.31 6.11,14.04 6,13.76C5.81,13.22 6.1,12.63 6.64,12.44C7.18,12.25 7.77,12.54 7.96,13.08C8.36,14.22 9.38,15 10.58,15.13C11.95,15.06 13.17,14.25 13.77,13C14,11.62 15.11,11.5 16.33,11.5M18.33,18.97L17.71,17.67L17,17.83L18,19.08L18.33,18.97M13.68,10.36C13.7,9.83 13.3,9.38 12.77,9.33C12.06,9.29 11.37,9.53 10.84,10C10.27,10.58 9.97,11.38 10,12.19A1,1 0 0,0 11,13.19C11.57,13.19 12,12.74 12,12.19C12,11.92 12.07,11.65 12.23,11.43C12.35,11.33 12.5,11.28 12.66,11.28C13.21,11.31 13.68,10.9 13.68,10.36Z" />\n </svg>core members</h2>\n\n <ul class="bars">\n <li><a href="https://github.com/MasterQ32/">Felix "xq" Queißner</a></li>\n <li><a href="https://github.com/mattnite/">Matthew "mattnite" Knight</a></li>\n <li><a href="https://github.com/vesim987/">Vesim</a></li>\n <li><a href="https://github.com/FireFox317">Timon "FireFox317" Kruiper</a></li>\n <li><a href="https://github.com/SpexGuy">Martin "SpexGuy" Wickham</a></li>\n </ul>\n </div>\n </div>\n\n <footer>\n <img src="img/ember.svg" alt="vectorized Ember, the awesome zeg mascot!">\n </footer>\n</div>\n' } }, textDocument = { uri = "file:///Users/esauder/source/repos/personal/microzig-website/layouts/index.html", version = 7 } }}
[DEBUG][2024-07-23 22:43:27] ...m/lsp/client.lua:676 "LSP[superhtml]" "client.request" 1 "textDocument/semanticTokens/full" { textDocument = { uri = "file:///Users/esauder/source/repos/personal/microzig-website/layouts/index.html" }} <function 1> 13
[DEBUG][2024-07-23 22:43:27] .../vim/lsp/rpc.lua:286 "rpc.send" { id = 3, jsonrpc = "2.0", method = "textDocument/semanticTokens/full", params = { textDocument = { uri = "file:///Users/esauder/source/repos/personal/microzig-website/layouts/index.html" } }}
[DEBUG][2024-07-23 22:43:28] ...m/lsp/client.lua:676 "LSP[superhtml]" "client.request" 1 "textDocument/formatting" { options = { insertSpaces = true, tabSize = 4 }, textDocument = { uri = "file:///Users/esauder/source/repos/personal/microzig-website/layouts/index.html" }} <function 1> 13
[DEBUG][2024-07-23 22:43:28] .../vim/lsp/rpc.lua:286 "rpc.send" { id = 4, jsonrpc = "2.0", method = "textDocument/formatting", params = { options = { insertSpaces = true, tabSize = 4 }, textDocument = { uri = "file:///Users/esauder/source/repos/personal/microzig-website/layouts/index.html" } }}
[DEBUG][2024-07-23 22:43:28] .../vim/lsp/rpc.lua:286 "rpc.send" { jsonrpc = "2.0", method = "$/cancelRequest", params = { id = 4 }}
[DEBUG][2024-07-23 22:43:28] .../vim/lsp/rpc.lua:286 "rpc.send" { jsonrpc = "2.0", method = "textDocument/didSave", params = { textDocument = { uri = "file:///Users/esauder/source/repos/personal/microzig-website/layouts/index.html" } }}
[DEBUG][2024-07-23 22:43:29] .../vim/lsp/rpc.lua:408 "rpc.receive" { jsonrpc = "2.0", method = "textDocument/publishDiagnostics", params = { diagnostics = {}, uri = "file:///Users/esauder/source/repos/personal/microzig-website/layouts/index.html" }}
[DEBUG][2024-07-23 22:43:29] .../vim/lsp/rpc.lua:408 "rpc.receive" { id = 3, jsonrpc = "2.0"}
Realized I forgot to include what I did to produce that error. In the vein of my work on the zeg website (now in the monorepo), this is the file I used to test. https://github.com/ZigEmbeddedGroup/website/blob/master/layouts/index.html
Steps:
<extend
.Also here is the superhtml.log
[debug] (super_lsp): SuperHTML LSP started!
[info] (super_lsp): client is 'Neovim-0.10.0-dev'
[debug] (super_lsp): init!
[debug] (lsp): Took 1ms to process request-1-initialize
[debug] (lsp): Took 0ms to process notification-initialized
[debug] (super_lsp): unrecognized language id: 'shtml'
[debug] (lsp): Took 0ms to process notification-textDocument/didOpen
[debug] (lsp): Took 0ms to process request-2-textDocument/semanticTokens/full
[debug] (lsp): Took 0ms to process request-3-textDocument/semanticTokens/full
[warn] (super_lsp): changeDocument failed: unknown file: { 102, 105, 108, 101, 58, 47, 47, 47, 85, 115, 101, 114, 115, 47, 101, 115, 97, 117, 100, 101, 114, 47, 115, 111, 117, 114, 99, 101, 47, 114, 101, 112, 111, 115, 47, 112, 101, 114, 115, 111, 110, 97, 108, 47, 109, 105, 99, 114, 111, 122, 105, 103, 45, 119, 101, 98, 115, 105, 116, 101, 47, 108, 97, 121, 111, 117, 116, 115, 47, 105, 110, 100, 101, 120, 46, 104, 116, 109, 108 }
[err] (super_lsp): changeDocument failed: error.InvalidParams
[debug] (lsp): Took 0ms to process notification-textDocument/didChange
Also, is the lsp designed to work with normal html, or specifically .shtml files (I'm mainly asking because I'm wondering if I should setup the lsp config to attach on both html and shtml filetypes)?
SuperHTML works with HTML files (.html) and SuperHTML Templates (.shtml). Depending on the language id passed, it will behave differently: for html
it will act as a normal HTML language server, while for superhtml
it will become aware of special tags and rules specific to the templating language.
The end goal is to have SuperHTML be a good language server for plain HTML as well but I would understand that editors might be more resistant to changing the default HTML language server (vs adding a new one for a new language).
SuperHTML works also with xml files (languageId xml
) but it's currently a very underdeveloped feature so I would avoid wiring that up right now regardless.
The correct file extension for SuperHTML Templates (languageId superhtml
) is .shtml
, I probably need to update some strings to reflect that final choice, I'll go do that now.
@kristoff-it any chance we could get a new version tag with the working updates?
yep will do now
Done!
Okay, updated and tested. I'm still having the issue I mentioned a couple messages ago. Here are fresh logs run with v0.4.1
Nvim LSP logs:
[START][2024-07-24 13:11:08] LSP logging initiated
[INFO][2024-07-24 13:11:08] .../vim/lsp/rpc.lua:731 "Starting RPC client" { cmd = { "/Users/esauder/.local/share/nvim/mason/bin/superhtml", "lsp" }, extra = { cwd = "/Users/esauder/source/repos/personal/microzig-website" }}
[DEBUG][2024-07-24 13:11:08] .../vim/lsp/rpc.lua:286 "rpc.send" { id = 1, jsonrpc = "2.0", method = "initialize", params = { capabilities = { general = { positionEncodings = { "utf-16" } }, offset_encoding = "utf-8", textDocument = { callHierarchy = { dynamicRegistration = false }, codeAction = { codeActionLiteralSupport = { codeActionKind = { valueSet = { "", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" } } }, dataSupport = true, dynamicRegistration = true, isPreferredSupport = true, resolveSupport = { properties = { "edit" } } }, completion = { completionItem = { commitCharactersSupport = true, deprecatedSupport = true, documentationFormat = { "markdown", "plaintext" }, insertReplaceSupport = true, insertTextModeSupport = { valueSet = { 1, 2 } }, labelDetailsSupport = true, preselectSupport = true, resolveSupport = { properties = { "documentation", "detail", "additionalTextEdits", "sortText", "filterText", "insertText", "textEdit", "insertTextFormat", "insertTextMode" } }, snippetSupport = true, tagSupport = { valueSet = { 1 } } }, completionItemKind = { valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 } }, completionList = { itemDefaults = { "commitCharacters", "editRange", "insertTextFormat", "insertTextMode", "data" } }, contextSupport = true, dynamicRegistration = false, insertTextMode = 1 }, declaration = { linkSupport = true }, definition = { dynamicRegistration = true, linkSupport = true }, diagnostic = { dynamicRegistration = false }, documentHighlight = { dynamicRegistration = false }, documentSymbol = { dynamicRegistration = false, hierarchicalDocumentSymbolSupport = true, symbolKind = { valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 } } }, formatting = { dynamicRegistration = true }, hover = { contentFormat = { "markdown", "plaintext" }, dynamicRegistration = true }, implementation = { linkSupport = true }, inlayHint = { dynamicRegistration = true, resolveSupport = { properties = { "textEdits", "tooltip", "location", "command" } } }, publishDiagnostics = { dataSupport = true, relatedInformation = true, tagSupport = { valueSet = { 1, 2 } } }, rangeFormatting = { dynamicRegistration = true }, references = { dynamicRegistration = false }, rename = { dynamicRegistration = true, prepareSupport = true }, semanticTokens = { augmentsSyntaxTokens = true, dynamicRegistration = false, formats = { "relative" }, multilineTokenSupport = false, overlappingTokenSupport = true, requests = { full = { delta = true }, range = false }, serverCancelSupport = false, tokenModifiers = { "declaration", "definition", "readonly", "static", "deprecated", "abstract", "async", "modification", "documentation", "defaultLibrary" }, tokenTypes = { "namespace", "type", "class", "enum", "interface", "struct", "typeParameter", "parameter", "variable", "property", "enumMember", "event", "function", "method", "macro", "keyword", "modifier", "comment", "string", "number", "regexp", "operator", "decorator" } }, signatureHelp = { dynamicRegistration = false, signatureInformation = { activeParameterSupport = true, documentationFormat = { "markdown", "plaintext" }, parameterInformation = { labelOffsetSupport = true } } }, synchronization = { didSave = true, dynamicRegistration = false, willSave = true, willSaveWaitUntil = true }, typeDefinition = { linkSupport = true } }, window = { showDocument = { support = true }, showMessage = { messageActionItem = { additionalPropertiesSupport = false } }, workDoneProgress = true }, workspace = { applyEdit = true, configuration = true, didChangeConfiguration = { dynamicRegistration = false }, didChangeWatchedFiles = { dynamicRegistration = true, relativePatternSupport = true }, inlayHint = { refreshSupport = true }, semanticTokens = { refreshSupport = true }, symbol = { dynamicRegistration = false, symbolKind = { valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 } } }, workspaceEdit = { resourceOperations = { "rename", "create", "delete" } }, workspaceFolders = true } }, clientInfo = { name = "Neovim", version = "0.10.0-dev" }, initializationOptions = vim.empty_dict(), processId = 22777, rootPath = "/Users/esauder/source/repos/personal/microzig-website", rootUri = "file:///Users/esauder/source/repos/personal/microzig-website", trace = "off", workDoneToken = "1", workspaceFolders = { { name = "/Users/esauder/source/repos/personal/microzig-website", uri = "file:///Users/esauder/source/repos/personal/microzig-website" } } }}
[DEBUG][2024-07-24 13:11:08] .../vim/lsp/rpc.lua:408 "rpc.receive" { id = 1, jsonrpc = "2.0", result = { capabilities = { completionProvider = { triggerCharacters = { "<" } }, definitionProvider = false, documentFormattingProvider = true, hoverProvider = false, inlayHintProvider = false, positionEncoding = "utf-16", referencesProvider = false, semanticTokensProvider = { full = false, legend = { tokenModifiers = { "declaration", "definition", "readonly", "static", "deprecated", "abstract", "async", "modification", "documentation", "defaultLibrary", "custom_value" }, tokenTypes = { "namespace", "type", "class", "enum", "interface", "struct", "typeParameter", "parameter", "variable", "property", "enumMember", "event", "function", "method", "macro", "keyword", "modifier", "comment", "string", "number", "regexp", "operator", "decorator", "custom_value" } } }, textDocumentSync = { change = 1, openClose = true, save = true } }, serverInfo = { name = "SuperHTML LSP", version = "v0.4.1" } }}
[DEBUG][2024-07-24 13:11:08] .../vim/lsp/rpc.lua:286 "rpc.send" { jsonrpc = "2.0", method = "initialized", params = vim.empty_dict()}
[DEBUG][2024-07-24 13:11:08] .../vim/lsp/rpc.lua:286 "rpc.send" { jsonrpc = "2.0", method = "textDocument/didOpen", params = { textDocument = { languageId = "superhtml", text = '<extend template="base.html"/>\n\n<title id="title" var="$page.title"></title>\n\n<div id="content">\n <nav id="intro-nav">\n <h1>zig embedded group</h1>\n <img src="img/ember.svg" alt="vectorized Ember, the awesome zeg mascot!">\n </nav>\n\n <div id="intro-grid">\n <div>\n <h2><svg viewBox="0 0 24 24">\n <path\n d="M14.4,6H20V16H13L12.6,14H7V21H5V4H14L14.4,6M14,14H16V12H18V10H16V8H14V10L13,8V6H11V8H9V6H7V8H9V10H7V12H9V10H11V12H13V10L14,12V14M11,10V8H13V10H11M14,10H16V12H14V10Z" />\n </svg>goals</h2>\n\n <ul class="bars">\n <li>provide documents on how to get started with embedded programming (for absolute newbies)</li>\n <li>provide example snippets for common operations on certain architectures (LPC, STM32, AVR, ...)</li>\n <li>provide example worked through embedded mini-projects</li>\n <li>create register definition libraries</li>\n <li>create a common interface/HAL over several architectures</li>\n <li>create a performant common set of drivers for external platforms</li>\n </ul>\n </div>\n\n <div>\n <h2><svg viewBox="0 0 24 24">\n <path\n d="M10.59,13.41C11,13.8 11,14.44 10.59,14.83C10.2,15.22 9.56,15.22 9.17,14.83C7.22,12.88 7.22,9.71 9.17,7.76V7.76L12.71,4.22C14.66,2.27 17.83,2.27 19.78,4.22C21.73,6.17 21.73,9.34 19.78,11.29L18.29,12.78C18.3,11.96 18.17,11.14 17.89,10.36L18.36,9.88C19.54,8.71 19.54,6.81 18.36,5.64C17.19,4.46 15.29,4.46 14.12,5.64L10.59,9.17C9.41,10.34 9.41,12.24 10.59,13.41M13.41,9.17C13.8,8.78 14.44,8.78 14.83,9.17C16.78,11.12 16.78,14.29 14.83,16.24V16.24L11.29,19.78C9.34,21.73 6.17,21.73 4.22,19.78C2.27,17.83 2.27,14.66 4.22,12.71L5.71,11.22C5.7,12.04 5.83,12.86 6.11,13.65L5.64,14.12C4.46,15.29 4.46,17.19 5.64,18.36C6.81,19.54 8.71,19.54 9.88,18.36L13.41,14.83C14.59,13.66 14.59,11.76 13.41,10.59C13,10.2 13,9.56 13.41,9.17Z" />\n </svg>important links</h2>\n\n <ul class="bars">\n <li><strong><a href="getting-started.htm">documentation / getting started</a></strong></li>\n <li><a href="https://github.com/ZigEmbeddedGroup/">code</a></li>\n <li><a href="https://ziglang.org/">Zig programming language</a></li>\n </ul>\n </div>\n\n <div>\n <h2><svg viewBox="0 0 24 24">\n <path\n d="M12,5.5A3.5,3.5 0 0,1 15.5,9A3.5,3.5 0 0,1 12,12.5A3.5,3.5 0 0,1 8.5,9A3.5,3.5 0 0,1 12,5.5M5,8C5.56,8 6.08,8.15 6.53,8.42C6.38,9.85 6.8,11.27 7.66,12.38C7.16,13.34 6.16,14 5,14A3,3 0 0,1 2,11A3,3 0 0,1 5,8M19,8A3,3 0 0,1 22,11A3,3 0 0,1 19,14C17.84,14 16.84,13.34 16.34,12.38C17.2,11.27 17.62,9.85 17.47,8.42C17.92,8.15 18.44,8 19,8M5.5,18.25C5.5,16.18 8.41,14.5 12,14.5C15.59,14.5 18.5,16.18 18.5,18.25V20H5.5V18.25M0,20V18.5C0,17.11 1.89,15.94 4.45,15.6C3.86,16.28 3.5,17.22 3.5,18.25V20H0M24,20H20.5V18.25C20.5,17.22 20.14,16.28 19.55,15.6C22.11,15.94 24,17.11 24,18.5V20Z" />\n </svg>community</h2>\n\n <ul class="bars">\n <li><img class="inline" src="img/chat-discord.svg"> <a href="https://discord.gg/zqa3fgv6Ma">zig\n embedded group\n discord</a></li>\n <li><img class="inline" src="img/chat-irc.svg"> <a href="irc://irc.libera.chat/microzig">microzig\n irc channel</a> (<a target="_blank"\n href="https://kiwiirc.com/nextclient/irc.libera.chat/#microzig">webchat</a>)\n </li>\n <li><img class="inline" src="img/chat-discord.svg"> <a href="https://discord.gg/TyzJXjser6">zig\n language\n discord</a>\n </li>\n </ul>\n </div>\n\n <div>\n <h2><svg viewBox="0 0 24 24">\n <path\n d="M19,20H4C2.89,20 2,19.1 2,18V6C2,4.89 2.89,4 4,4H10L12,6H19A2,2 0 0,1 21,8H21L4,8V18L6.14,10H23.21L20.93,18.5C20.7,19.37 19.92,20 19,20Z" />\n </svg>projects</h2>\n\n <ul class="bars">\n <li><a href="https://github.com/ZigEmbeddedGroup/microzig/">microzig - Cross-Device Embedded\n Framework</a></li>\n <li><a href="https://github.com/ZigEmbeddedGroup/regz/">regz - SVD and ATDF Code Generator</a></li>\n <li><a href="https://github.com/ZigEmbeddedGroup/uf2">uf2 - Generate UF2 files in your build</a></li>\n <li><a href="https://github.com/orgs/ZigEmbeddedGroup/repositories">read more…</a></li>\n </ul>\n </div>\n\n <div>\n <h2><svg viewBox="0 0 24 24">\n <path\n d="M21.33,12.91C21.42,14.46 20.71,15.95 19.44,16.86L20.21,18.35C20.44,18.8 20.47,19.33 20.27,19.8C20.08,20.27 19.69,20.64 19.21,20.8L18.42,21.05C18.25,21.11 18.06,21.14 17.88,21.14C17.37,21.14 16.89,20.91 16.56,20.5L14.44,18C13.55,17.85 12.71,17.47 12,16.9C11.5,17.05 11,17.13 10.5,17.13C9.62,17.13 8.74,16.86 8,16.34C7.47,16.5 6.93,16.57 6.38,16.56C5.59,16.57 4.81,16.41 4.08,16.11C2.65,15.47 1.7,14.07 1.65,12.5C1.57,11.78 1.69,11.05 2,10.39C1.71,9.64 1.68,8.82 1.93,8.06C2.3,7.11 3,6.32 3.87,5.82C4.45,4.13 6.08,3 7.87,3.12C9.47,1.62 11.92,1.46 13.7,2.75C14.12,2.64 14.56,2.58 15,2.58C16.36,2.55 17.65,3.15 18.5,4.22C20.54,4.75 22,6.57 22.08,8.69C22.13,9.8 21.83,10.89 21.22,11.82C21.29,12.18 21.33,12.54 21.33,12.91M16.33,11.5C16.9,11.57 17.35,12 17.35,12.57A1,1 0 0,1 16.35,13.57H15.72C15.4,14.47 14.84,15.26 14.1,15.86C14.35,15.95 14.61,16 14.87,16.07C20,16 19.4,12.87 19.4,12.82C19.34,11.39 18.14,10.27 16.71,10.33A1,1 0 0,1 15.71,9.33A1,1 0 0,1 16.71,8.33C17.94,8.36 19.12,8.82 20.04,9.63C20.09,9.34 20.12,9.04 20.12,8.74C20.06,7.5 19.5,6.42 17.25,6.21C16,3.25 12.85,4.89 12.85,5.81V5.81C12.82,6.04 13.06,6.53 13.1,6.56A1,1 0 0,1 14.1,7.56C14.1,8.11 13.65,8.56 13.1,8.56V8.56C12.57,8.54 12.07,8.34 11.67,8C11.19,8.31 10.64,8.5 10.07,8.56V8.56C9.5,8.61 9.03,8.21 9,7.66C8.92,7.1 9.33,6.61 9.88,6.56C10.04,6.54 10.82,6.42 10.82,5.79V5.79C10.82,5.13 11.07,4.5 11.5,4C10.58,3.75 9.59,4.08 8.59,5.29C6.75,5 6,5.25 5.45,7.2C4.5,7.67 4,8 3.78,9C4.86,8.78 5.97,8.87 7,9.25C7.5,9.44 7.78,10 7.59,10.54C7.4,11.06 6.82,11.32 6.3,11.13C5.57,10.81 4.75,10.79 4,11.07C3.68,11.34 3.68,11.9 3.68,12.34C3.68,13.08 4.05,13.77 4.68,14.17C5.21,14.44 5.8,14.58 6.39,14.57C6.24,14.31 6.11,14.04 6,13.76C5.81,13.22 6.1,12.63 6.64,12.44C7.18,12.25 7.77,12.54 7.96,13.08C8.36,14.22 9.38,15 10.58,15.13C11.95,15.06 13.17,14.25 13.77,13C14,11.62 15.11,11.5 16.33,11.5M18.33,18.97L17.71,17.67L17,17.83L18,19.08L18.33,18.97M13.68,10.36C13.7,9.83 13.3,9.38 12.77,9.33C12.06,9.29 11.37,9.53 10.84,10C10.27,10.58 9.97,11.38 10,12.19A1,1 0 0,0 11,13.19C11.57,13.19 12,12.74 12,12.19C12,11.92 12.07,11.65 12.23,11.43C12.35,11.33 12.5,11.28 12.66,11.28C13.21,11.31 13.68,10.9 13.68,10.36Z" />\n </svg>core members</h2>\n\n <ul class="bars">\n <li><a href="https://github.com/MasterQ32/">Felix "xq" Queißner</a></li>\n <li><a href="https://github.com/mattnite/">Matthew "mattnite" Knight</a></li>\n <li><a href="https://github.com/vesim987/">Vesim</a></li>\n <li><a href="https://github.com/FireFox317">Timon "FireFox317" Kruiper</a></li>\n <li><a href="https://github.com/SpexGuy">Martin "SpexGuy" Wickham</a></li>\n </ul>\n </div>\n </div>\n\n <footer>\n <img src="img/ember.svg" alt="vectorized Ember, the awesome zeg mascot!">\n </footer>\n</div>\n', uri = "file:///Users/esauder/source/repos/personal/microzig-website/layouts/index.html", version = 0 } }}
[INFO][2024-07-24 13:11:08] ...m/lsp/client.lua:618 "LSP[superhtml]" "server_capabilities" { server_capabilities = { completionProvider = { triggerCharacters = { "<" } }, definitionProvider = false, documentFormattingProvider = true, hoverProvider = false, inlayHintProvider = false, positionEncoding = "utf-16", referencesProvider = false, semanticTokensProvider = { full = false, legend = { tokenModifiers = { "declaration", "definition", "readonly", "static", "deprecated", "abstract", "async", "modification", "documentation", "defaultLibrary", "custom_value" }, tokenTypes = { "namespace", "type", "class", "enum", "interface", "struct", "typeParameter", "parameter", "variable", "property", "enumMember", "event", "function", "method", "macro", "keyword", "modifier", "comment", "string", "number", "regexp", "operator", "decorator", "custom_value" } } }, textDocumentSync = { change = 1, openClose = true, save = true } }}
[DEBUG][2024-07-24 13:11:08] .../vim/lsp/rpc.lua:408 "rpc.receive" { jsonrpc = "2.0", method = "textDocument/publishDiagnostics", params = { diagnostics = { { message = "html_elements_cant_self_close", range = { ["end"] = { character = 7, line = 0 }, start = { character = 1, line = 0 } }, severity = 1 } }, uri = "file:///Users/esauder/source/repos/personal/microzig-website/layouts/index.html" }}
[DEBUG][2024-07-24 13:11:10] .../vim/lsp/rpc.lua:286 "rpc.send" { jsonrpc = "2.0", method = "textDocument/didChange", params = { contentChanges = { { text = 'extend template="base.html"/>\n\n<title id="title" var="$page.title"></title>\n\n<div id="content">\n <nav id="intro-nav">\n <h1>zig embedded group</h1>\n <img src="img/ember.svg" alt="vectorized Ember, the awesome zeg mascot!">\n </nav>\n\n <div id="intro-grid">\n <div>\n <h2><svg viewBox="0 0 24 24">\n <path\n d="M14.4,6H20V16H13L12.6,14H7V21H5V4H14L14.4,6M14,14H16V12H18V10H16V8H14V10L13,8V6H11V8H9V6H7V8H9V10H7V12H9V10H11V12H13V10L14,12V14M11,10V8H13V10H11M14,10H16V12H14V10Z" />\n </svg>goals</h2>\n\n <ul class="bars">\n <li>provide documents on how to get started with embedded programming (for absolute newbies)</li>\n <li>provide example snippets for common operations on certain architectures (LPC, STM32, AVR, ...)</li>\n <li>provide example worked through embedded mini-projects</li>\n <li>create register definition libraries</li>\n <li>create a common interface/HAL over several architectures</li>\n <li>create a performant common set of drivers for external platforms</li>\n </ul>\n </div>\n\n <div>\n <h2><svg viewBox="0 0 24 24">\n <path\n d="M10.59,13.41C11,13.8 11,14.44 10.59,14.83C10.2,15.22 9.56,15.22 9.17,14.83C7.22,12.88 7.22,9.71 9.17,7.76V7.76L12.71,4.22C14.66,2.27 17.83,2.27 19.78,4.22C21.73,6.17 21.73,9.34 19.78,11.29L18.29,12.78C18.3,11.96 18.17,11.14 17.89,10.36L18.36,9.88C19.54,8.71 19.54,6.81 18.36,5.64C17.19,4.46 15.29,4.46 14.12,5.64L10.59,9.17C9.41,10.34 9.41,12.24 10.59,13.41M13.41,9.17C13.8,8.78 14.44,8.78 14.83,9.17C16.78,11.12 16.78,14.29 14.83,16.24V16.24L11.29,19.78C9.34,21.73 6.17,21.73 4.22,19.78C2.27,17.83 2.27,14.66 4.22,12.71L5.71,11.22C5.7,12.04 5.83,12.86 6.11,13.65L5.64,14.12C4.46,15.29 4.46,17.19 5.64,18.36C6.81,19.54 8.71,19.54 9.88,18.36L13.41,14.83C14.59,13.66 14.59,11.76 13.41,10.59C13,10.2 13,9.56 13.41,9.17Z" />\n </svg>important links</h2>\n\n <ul class="bars">\n <li><strong><a href="getting-started.htm">documentation / getting started</a></strong></li>\n <li><a href="https://github.com/ZigEmbeddedGroup/">code</a></li>\n <li><a href="https://ziglang.org/">Zig programming language</a></li>\n </ul>\n </div>\n\n <div>\n <h2><svg viewBox="0 0 24 24">\n <path\n d="M12,5.5A3.5,3.5 0 0,1 15.5,9A3.5,3.5 0 0,1 12,12.5A3.5,3.5 0 0,1 8.5,9A3.5,3.5 0 0,1 12,5.5M5,8C5.56,8 6.08,8.15 6.53,8.42C6.38,9.85 6.8,11.27 7.66,12.38C7.16,13.34 6.16,14 5,14A3,3 0 0,1 2,11A3,3 0 0,1 5,8M19,8A3,3 0 0,1 22,11A3,3 0 0,1 19,14C17.84,14 16.84,13.34 16.34,12.38C17.2,11.27 17.62,9.85 17.47,8.42C17.92,8.15 18.44,8 19,8M5.5,18.25C5.5,16.18 8.41,14.5 12,14.5C15.59,14.5 18.5,16.18 18.5,18.25V20H5.5V18.25M0,20V18.5C0,17.11 1.89,15.94 4.45,15.6C3.86,16.28 3.5,17.22 3.5,18.25V20H0M24,20H20.5V18.25C20.5,17.22 20.14,16.28 19.55,15.6C22.11,15.94 24,17.11 24,18.5V20Z" />\n </svg>community</h2>\n\n <ul class="bars">\n <li><img class="inline" src="img/chat-discord.svg"> <a href="https://discord.gg/zqa3fgv6Ma">zig\n embedded group\n discord</a></li>\n <li><img class="inline" src="img/chat-irc.svg"> <a href="irc://irc.libera.chat/microzig">microzig\n irc channel</a> (<a target="_blank"\n href="https://kiwiirc.com/nextclient/irc.libera.chat/#microzig">webchat</a>)\n </li>\n <li><img class="inline" src="img/chat-discord.svg"> <a href="https://discord.gg/TyzJXjser6">zig\n language\n discord</a>\n </li>\n </ul>\n </div>\n\n <div>\n <h2><svg viewBox="0 0 24 24">\n <path\n d="M19,20H4C2.89,20 2,19.1 2,18V6C2,4.89 2.89,4 4,4H10L12,6H19A2,2 0 0,1 21,8H21L4,8V18L6.14,10H23.21L20.93,18.5C20.7,19.37 19.92,20 19,20Z" />\n </svg>projects</h2>\n\n <ul class="bars">\n <li><a href="https://github.com/ZigEmbeddedGroup/microzig/">microzig - Cross-Device Embedded\n Framework</a></li>\n <li><a href="https://github.com/ZigEmbeddedGroup/regz/">regz - SVD and ATDF Code Generator</a></li>\n <li><a href="https://github.com/ZigEmbeddedGroup/uf2">uf2 - Generate UF2 files in your build</a></li>\n <li><a href="https://github.com/orgs/ZigEmbeddedGroup/repositories">read more…</a></li>\n </ul>\n </div>\n\n <div>\n <h2><svg viewBox="0 0 24 24">\n <path\n d="M21.33,12.91C21.42,14.46 20.71,15.95 19.44,16.86L20.21,18.35C20.44,18.8 20.47,19.33 20.27,19.8C20.08,20.27 19.69,20.64 19.21,20.8L18.42,21.05C18.25,21.11 18.06,21.14 17.88,21.14C17.37,21.14 16.89,20.91 16.56,20.5L14.44,18C13.55,17.85 12.71,17.47 12,16.9C11.5,17.05 11,17.13 10.5,17.13C9.62,17.13 8.74,16.86 8,16.34C7.47,16.5 6.93,16.57 6.38,16.56C5.59,16.57 4.81,16.41 4.08,16.11C2.65,15.47 1.7,14.07 1.65,12.5C1.57,11.78 1.69,11.05 2,10.39C1.71,9.64 1.68,8.82 1.93,8.06C2.3,7.11 3,6.32 3.87,5.82C4.45,4.13 6.08,3 7.87,3.12C9.47,1.62 11.92,1.46 13.7,2.75C14.12,2.64 14.56,2.58 15,2.58C16.36,2.55 17.65,3.15 18.5,4.22C20.54,4.75 22,6.57 22.08,8.69C22.13,9.8 21.83,10.89 21.22,11.82C21.29,12.18 21.33,12.54 21.33,12.91M16.33,11.5C16.9,11.57 17.35,12 17.35,12.57A1,1 0 0,1 16.35,13.57H15.72C15.4,14.47 14.84,15.26 14.1,15.86C14.35,15.95 14.61,16 14.87,16.07C20,16 19.4,12.87 19.4,12.82C19.34,11.39 18.14,10.27 16.71,10.33A1,1 0 0,1 15.71,9.33A1,1 0 0,1 16.71,8.33C17.94,8.36 19.12,8.82 20.04,9.63C20.09,9.34 20.12,9.04 20.12,8.74C20.06,7.5 19.5,6.42 17.25,6.21C16,3.25 12.85,4.89 12.85,5.81V5.81C12.82,6.04 13.06,6.53 13.1,6.56A1,1 0 0,1 14.1,7.56C14.1,8.11 13.65,8.56 13.1,8.56V8.56C12.57,8.54 12.07,8.34 11.67,8C11.19,8.31 10.64,8.5 10.07,8.56V8.56C9.5,8.61 9.03,8.21 9,7.66C8.92,7.1 9.33,6.61 9.88,6.56C10.04,6.54 10.82,6.42 10.82,5.79V5.79C10.82,5.13 11.07,4.5 11.5,4C10.58,3.75 9.59,4.08 8.59,5.29C6.75,5 6,5.25 5.45,7.2C4.5,7.67 4,8 3.78,9C4.86,8.78 5.97,8.87 7,9.25C7.5,9.44 7.78,10 7.59,10.54C7.4,11.06 6.82,11.32 6.3,11.13C5.57,10.81 4.75,10.79 4,11.07C3.68,11.34 3.68,11.9 3.68,12.34C3.68,13.08 4.05,13.77 4.68,14.17C5.21,14.44 5.8,14.58 6.39,14.57C6.24,14.31 6.11,14.04 6,13.76C5.81,13.22 6.1,12.63 6.64,12.44C7.18,12.25 7.77,12.54 7.96,13.08C8.36,14.22 9.38,15 10.58,15.13C11.95,15.06 13.17,14.25 13.77,13C14,11.62 15.11,11.5 16.33,11.5M18.33,18.97L17.71,17.67L17,17.83L18,19.08L18.33,18.97M13.68,10.36C13.7,9.83 13.3,9.38 12.77,9.33C12.06,9.29 11.37,9.53 10.84,10C10.27,10.58 9.97,11.38 10,12.19A1,1 0 0,0 11,13.19C11.57,13.19 12,12.74 12,12.19C12,11.92 12.07,11.65 12.23,11.43C12.35,11.33 12.5,11.28 12.66,11.28C13.21,11.31 13.68,10.9 13.68,10.36Z" />\n </svg>core members</h2>\n\n <ul class="bars">\n <li><a href="https://github.com/MasterQ32/">Felix "xq" Queißner</a></li>\n <li><a href="https://github.com/mattnite/">Matthew "mattnite" Knight</a></li>\n <li><a href="https://github.com/vesim987/">Vesim</a></li>\n <li><a href="https://github.com/FireFox317">Timon "FireFox317" Kruiper</a></li>\n <li><a href="https://github.com/SpexGuy">Martin "SpexGuy" Wickham</a></li>\n </ul>\n </div>\n </div>\n\n <footer>\n <img src="img/ember.svg" alt="vectorized Ember, the awesome zeg mascot!">\n </footer>\n</div>\n' } }, textDocument = { uri = "file:///Users/esauder/source/repos/personal/microzig-website/layouts/index.html", version = 3 } }}
[DEBUG][2024-07-24 13:11:10] .../vim/lsp/rpc.lua:408 "rpc.receive" { jsonrpc = "2.0", method = "textDocument/publishDiagnostics", params = { diagnostics = {}, uri = "file:///Users/esauder/source/repos/personal/microzig-website/layouts/index.html" }}
[DEBUG][2024-07-24 13:11:11] ...m/lsp/client.lua:676 "LSP[superhtml]" "client.request" 1 "textDocument/formatting" { options = { insertSpaces = true, tabSize = 4 }, textDocument = { uri = "file:///Users/esauder/source/repos/personal/microzig-website/layouts/index.html" }} <function 1> 8
[DEBUG][2024-07-24 13:11:11] .../vim/lsp/rpc.lua:286 "rpc.send" { id = 2, jsonrpc = "2.0", method = "textDocument/formatting", params = { options = { insertSpaces = true, tabSize = 4 }, textDocument = { uri = "file:///Users/esauder/source/repos/personal/microzig-website/layouts/index.html" } }}
[DEBUG][2024-07-24 13:11:11] .../vim/lsp/rpc.lua:286 "rpc.send" { jsonrpc = "2.0", method = "$/cancelRequest", params = { id = 2 }}
superhtml log: superhtml.log
Realized I forgot to include what I did to produce that error. In the vein of my work on the zeg website (now in the monorepo), this is the file I used to test. https://github.com/ZigEmbeddedGroup/website/blob/master/layouts/index.html
Steps:
1. Open up file 2. Attach LSP on filetype shtml (which is then translated to superhtml language id) 3. Delete the first '<' of `<extend`.
These are the steps I do to reproduce this issue.
If you want to try testing this on your end, here is the a branch in my nvim config that points to all of my forks. It isn't a min-config, but it should work
https://github.com/EliSauder/nvim-config/tree/superhtml-testing
Notes for using:
:MasonUpdate
after opening a file (mason binds on buffer open):set filetype=shtml
(I'll update this later, but for now). This will attach the superhtml lsp to the current buffer.:LspLog
. To clear the logs just delete the contents of the file.Sorry I'm having trouble reproducing, I got your config to load by replacing my previous one in.config/nvim
but I get this error on startup:
[mason-lspconfig.nvim] Server "superhtml" is not a valid entry in ensure_installed. Make su
re to only provide lspconfig server names.
I did run the other commands but the message keeps popping up on application load
Btw if you want to do this with fewer RTTs, I'm currently in the Software You Can Love Discord server, in a voice channel and will be there for a couple of hours :^)
So I've also cloned locally the mason registry and changed lsp.lua to reflect that, I'm confused by this error because I can see that you're referring to your own mason-lspconfig and nvim-lspconfig.
Well if you can help me get past this issue I'll be happy to continue debugging the issue.
Btw if you want to do this with fewer RTTs, I'm currently in the Software You Can Love Discord server, in a voice channel and will be there for a couple of hours :^)
Sorry, I was busy, but I did join the server for the future.
Sorry I'm having trouble reproducing, I got your config to load by replacing my previous one in
.config/nvim
but I get this error on startup:[mason-lspconfig.nvim] Server "superhtml" is not a valid entry in ensure_installed. Make su re to only provide lspconfig server names.
I did run the other commands but the message keeps popping up on application load
Maybe try :Lazy update
and then restart nvim? Also make sure you are running nvim 10 just in case. Also unless there is stuff that you want to keep for nvim, you could try removing the local files ~/.local/*/nvim
, occasionally I've had some cached value from a previous config mess things up for me.
I did also push a change that updates a reference to the upstream nvim-lspconfig plugin rather than my fork, but I don't think this will help since the issue is with mason-lspconfig.nvim.
P.S. if you haven't already you may want to remove some of if not all of the contents of remap.lua since I have some weird remaps to support my colemak layout. (like setting m,./ instead of hjkl).
Thank you, clearing .local
did the trick.
I've now been able to make it work but could not reproduce the errors on didChange, everything kept working even after messing with the <extend>
tag, maybe I didn't do it in the right way?
Since we're now getting to a point where I can repro bugs, I'll add a couple comments / questions with how the packaging that you're doing for nvim works:
I see that you invoke zig build
in the package to compile superhtml, beware that without any extra flags you're creating a debug build of superhtml. If you're doing it right now for testing purposes that's great, just make sure to add -Doptimize=ReleaseFast
once done, otherwise people will get worse performance and extremely verbose logging.
Related to that, there's also the question of building with Zig on the client machine at all. While in the case of Zine it makes total sense (you need to have Zig to use Zine), in the future this might make less sense, especially for the usecase of using SuperHTML as a pure-html language server, at which point it would be much preferable to use pre-built binaries from GitHub Releases. That said there's no point to complicate the current PR if you don't want to since you're just adding support for superhtml templates and as of today Zine is the only user of that.
Lastly, just to let you know, SuperHTML templates also have a tree-sitter grammar. I developed all highlighting queries using Helix as a test bench but I'd be happy to create a set fine-tuned for NeoVim if you also decide to add that integration. SuperHTML highlighting is normal HTML highlighting + special rules for semantically meaningful attributes and tags (like <super>
or <extend>
). This seems a much more relevant concern already today since otherwise you will get no syntax highlighting at all when editing .shtml files.
Thank you, clearing
.local
did the trick.I've now been able to make it work but could not reproduce the errors on didChange, everything kept working even after messing with the
<extend>
tag, maybe I didn't do it in the right way?
Make sure you write to the buffer after you make the change :w
. Also I did some local testing, the issue doesn't seem to happen with only the extend tag, but also with the rest of the file.
I did some testing, it seems it may be more related to svg tags, here is a minimal content with which I could reproduce the crash.
Some notes on reproducibility: It seems to only crash on deleting the first character of the buffer <
. If I edit other characters including other opening <
there is no crash. Additionally, adding a pre-removed <
back in does not cause a crash.
<extend template="base.html"/>
<div id="content">
<svg viewBox="0 0 24 24">
<path d="M14.4,6H20V16H13L12.6,14H7V21H5V4H14L14.4,6M14,14H16V12H18V10H16V8H14V10L13,8V6H11V8H9V6H7V8H9V10H7V12H9V10H11V12H13V10L14,12V14M11,10V8H13V10H11M14,10H16V12H14V10Z" />
</svg>
</div>
Some further testing provides these setups as well:
Without div: Crashes
<extend template="base.html"/>
<svg viewBox="0 0 24 24">
<path d="M14.4,6H20V16H13L12.6,14H7V21H5V4H14L14.4,6M14,14H16V12H18V10H16V8H14V10L13,8V6H11V8H9V6H7V8H9V10H7V12H9V10H11V12H13V10L14,12V14M11,10V8H13V10H11M14,10H16V12H14V10Z" />
</svg>
Without svg (invalid html I know): Does not crash
<extend template="base.html"/>
<path d="M14.4,6H20V16H13L12.6,14H7V21H5V4H14L14.4,6M14,14H16V12H18V10H16V8H14V10L13,8V6H11V8H9V6H7V8H9V10H7V12H9V10H11V12H13V10L14,12V14M11,10V8H13V10H11M14,10H16V12H14V10Z" />
Without path: Does not crash
<extend template="base.html"/>
<svg viewBox="0 0 24 24">
</svg>
No extend (svg as first tag): Does not crash
<svg viewBox="0 0 24 24">
<path d="M14.4,6H20V16H13L12.6,14H7V21H5V4H14L14.4,6M14,14H16V12H18V10H16V8H14V10L13,8V6H11V8H9V6H7V8H9V10H7V12H9V10H11V12H13V10L14,12V14M11,10V8H13V10H11M14,10H16V12H14V10Z" />
</svg>
Thank you for the report, I was able to repro and added a unit test for this crash.
I'm not quite sure what is going on here, Mason uses very minimal clones and checkouts which remove tag information. This breaks the changes added in v0.4.* to rely on the version from git.
For now I'm going to try tarballs and see if that will work. Edit: it does so far.
Steps to reproduce:
The issue is coming from git describe --match *.*.* --tags
which shows up when running zig build after doing the setup steps that mason does:
git clone --depth 1 https://github.com/kristoff-it/superhtml.git
git fetch --depth 1 origin v0.4.2
git checkout --quiet FETCH_HEAD
zig build
-- where there error occursZig build output:
fatal: No names found, cannot describe anything.
unable to spawn the following command: ExitCodeFailure
/opt/homebrew/Cellar/git/2.45.1/bin/git -C /Users/esauder/source/repos/personal/superhtml describe --match *.*.* --tags
error: the following build command failed with exit code 1:
/Users/esauder/source/repos/personal/superhtml/.zig-cache/o/82ba92dd72391affe687d367e0d2babf/build /Users/esauder/.zvm/0.13.0/zig /Users/esauder/source/repos/personal/superhtml /Users/esauder/source/repos/personal/superhtml/.zig-cache /Users/esauder/.cache/zig --seed 0x912b9b5c -Zb3d40962a427d997
:Mason error output:
Cloning git repository "https://github.com/kristoff-it/superhtml.git"…
Cloning into '.'...
From https://github.com/kristoff-it/superhtml
* tag v0.4.2 -> FETCH_HEAD
+ zig build
fatal: No names found, cannot describe anything.
unable to spawn the following command: ExitCodeFailure
/opt/homebrew/Cellar/git/2.45.1/bin/git -C /Users/esauder/.local/share/nvim/mason/staging/superhtml describe --match *.*.* --tags
error: the following build command failed with exit code 1:
/Users/esauder/.local/share/nvim/mason/staging/superhtml/.zig-cache/o/e58c2d35409e23d2fa78eaf8780801d0/build /Users/esauder/.zvm/0.13.0/zig /Users/esauder/.local/share/nvim/mason/staging/superhtml /Users/esauder/.local/share/nvim/mason/staging/superhtml/.zig-cache /Users/esauder/.cache/zig --seed 0x7cccf26d -Z0d10b0dae8690006
spawn: bash failed with exit code 1 and signal 0.
MasonLog Debug Info
[INFO 木 7/25 21:43:53 2024] ...e/nvim/lazy/mason.nvim/lua/mason-core/installer/init.lua:184: Executing installer for Package(name=superhtml) {}
[DEBUG 木 7/25 21:43:53 2024] ...e/nvim/lazy/mason.nvim/lua/mason-core/installer/init.lua:58: Attempting to lock package Package(name=superhtml)
[DEBUG 木 7/25 21:43:53 2024] ...e/nvim/lazy/mason.nvim/lua/mason-core/installer/init.lua:70: Wrote lockfile Package(name=superhtml)
[DEBUG 木 7/25 21:43:53 2024] .../.local/share/nvim/lazy/mason.nvim/lua/mason-core/fs.lua:71: fs: mkdirp /Users/esauder/.local/share/nvim/mason/staging/superhtml
[DEBUG 木 7/25 21:43:53 2024] ...zy/mason.nvim/lua/mason-core/installer/registry/init.lua:149: Compiling installer. superhtml {}
[DEBUG 木 7/25 21:43:53 2024] ...azy/mason.nvim/lua/mason-core/installer/managers/std.lua:247: std: clone "https://github.com/kristoff-it/superhtml.git" {
rev = "v0.4.2"
}
[DEBUG 木 7/25 21:43:53 2024] ...al/share/nvim/lazy/mason.nvim/lua/mason-core/process.lua:116: Spawning cmd="git", spawn_opts={
args = { "clone", "--depth", "1", "https://github.com/kristoff-it/superhtml.git", "." },
cwd = "/Users/esauder/.local/share/nvim/mason/staging/superhtml"
}
[DEBUG 木 7/25 21:43:53 2024] ...al/share/nvim/lazy/mason.nvim/lua/mason-core/process.lua:162: Spawned with pid 13188
[DEBUG 木 7/25 21:43:54 2024] ...al/share/nvim/lazy/mason.nvim/lua/mason-core/process.lua:148: Job pid=13188 exited with exit_code=0, signal=0
[DEBUG 木 7/25 21:43:54 2024] ...al/share/nvim/lazy/mason.nvim/lua/mason-core/process.lua:116: Spawning cmd="git", spawn_opts={
args = { "fetch", "--depth", "1", "origin", "v0.4.2" },
cwd = "/Users/esauder/.local/share/nvim/mason/staging/superhtml"
}
[DEBUG 木 7/25 21:43:54 2024] ...al/share/nvim/lazy/mason.nvim/lua/mason-core/process.lua:162: Spawned with pid 13198
[DEBUG 木 7/25 21:43:55 2024] ...al/share/nvim/lazy/mason.nvim/lua/mason-core/process.lua:148: Job pid=13198 exited with exit_code=0, signal=0
[DEBUG 木 7/25 21:43:55 2024] ...al/share/nvim/lazy/mason.nvim/lua/mason-core/process.lua:116: Spawning cmd="git", spawn_opts={
args = { "checkout", "--quiet", "FETCH_HEAD" },
cwd = "/Users/esauder/.local/share/nvim/mason/staging/superhtml"
}
[DEBUG 木 7/25 21:43:55 2024] ...al/share/nvim/lazy/mason.nvim/lua/mason-core/process.lua:162: Spawned with pid 13207
[DEBUG 木 7/25 21:43:55 2024] ...al/share/nvim/lazy/mason.nvim/lua/mason-core/process.lua:148: Job pid=13207 exited with exit_code=0, signal=0
[DEBUG 木 7/25 21:43:55 2024] .../mason.nvim/lua/mason-core/installer/managers/common.lua:100: build: run {
bin = "zig-out/bin/superhtml",
env = {
MASON_VERSION = "v0.4.2"
},
run = "zig build\n",
target = "unix"
}
[DEBUG 木 7/25 21:43:55 2024] ...al/share/nvim/lazy/mason.nvim/lua/mason-core/process.lua:116: Spawning cmd="bash", spawn_opts={
args = {},
cwd = "/Users/esauder/.local/share/nvim/mason/staging/superhtml",
env = { "NVIM_LOG_FILE=<redacted>", "SSH_AUTH_SOCK=<redacted>", "LC_TERMINAL_VERSION=<redacted>", "TERMINFO_DIRS=<redacted>", "COLORFGBG=<redacted>", "LaunchInstanceID=<redacted>", "__CF_USER_TEXT_ENCODING=<redacted>", "TERM_FEATURES=<redacted>", "ITERM_SESSION_ID=<redacted>", "TERM_SESSION_ID=<redacted>", "PATH=/Users/esauder/.local/share/nvim/mason/bin:/opt/local/bin:/opt/local/sbin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/cmsis-toolbox/bin/:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/usr/local/MacGPG2/bin:/Applications/Wireshark.app/Contents/MacOS:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/esauder/.cargo/bin:/Applications/iTerm.app/Contents/Resources/utilities:/Users/esauder/Library/Application Support/JetBrains/Toolbox/scripts:/Users/esauder/.dotnet/tools:/Users/esauder/.zvm/bin:/Users/esauder/.zvm/self/", "OLDPWD=<redacted>", "COLORTERM=<redacted>", "POSH_THEME=<redacted>", "ZLE_RPROMPT_INDENT=<redacted>", "TMPDIR=<redacted>", "ZVM_INSTALL=<redacted>", "POSH_PROMPT_COUNT=<redacted>", "XPC_FLAGS=<redacted>", "__CFBundleIdentifier=<redacted>", "XPC_SERVICE_NAME=<redacted>", "MANPATH=<redacted>", "POSH_PID=<redacted>", "HOMEBREW_CELLAR=<redacted>", "USER=<redacted>", "OP_PLUGIN_ALIASES_SOURCED=<redacted>", "INFOPATH=<redacted>", "PWD=<redacted>", "POSH_SHELL_VERSION=<redacted>", "MASON=<redacted>", "TERM_PROGRAM_VERSION=<redacted>", "LOGNAME=<redacted>", "SECURITYSESSIONID=<redacted>", "LC_TERMINAL=<redacted>", "YSU_VERSION=<redacted>", "SHLVL=<redacted>", "TERM_PROGRAM=<redacted>", "HOMEBREW_PREFIX=<redacted>", "LSCOLORS=<redacted>", "TERM=<redacted>", "POWERLINE_COMMAND=<redacted>", "VIMRUNTIME=<redacted>", "_=<redacted>", "HOMEBREW_REPOSITORY=<redacted>", "LANG=<redacted>", "SHELL=<redacted>", "ITERM_PROFILE=<redacted>", "COMMAND_MODE=<redacted>", "HOME=<redacted>", "CONDA_PROMPT_MODIFIER=<redacted>", "MYVIMRC=<redacted>", "VIM=<redacted>", "MASON_VERSION=<redacted>" }
}
[DEBUG 木 7/25 21:43:55 2024] ...al/share/nvim/lazy/mason.nvim/lua/mason-core/process.lua:162: Spawned with pid 13216
[DEBUG 木 7/25 21:43:59 2024] ...al/share/nvim/lazy/mason.nvim/lua/mason-core/process.lua:148: Job pid=13216 exited with exit_code=1, signal=0
[DEBUG 木 7/25 21:43:59 2024] .../.local/share/nvim/lazy/mason.nvim/lua/mason-core/fs.lua:59: fs: unlink /Users/esauder/.local/share/nvim/mason/staging/superhtml.lock
[DEBUG 木 7/25 21:43:59 2024] .../.local/share/nvim/lazy/mason.nvim/lua/mason-core/fs.lua:47: fs: rmrf /Users/esauder/.local/share/nvim/mason/staging/superhtml
[DEBUG 木 7/25 21:43:59 2024] ...e/nvim/lazy/mason.nvim/lua/mason-core/installer/init.lua:39: Building receipt for Package(name=superhtml)
[ERROR 木 7/25 21:43:59 2024] ...e/nvim/lazy/mason.nvim/lua/mason-core/installer/init.lua:249: Installation failed for Package(name=superhtml) error=spawn: bash failed with exit code 1 and signal 0.
I'll add a flag to specify manually the version and make a new release.
Done, v0.4.3 has -Dforce-version
now.
Unless you need strict version matching with the tag, I would suggest defining the flag with a -mason
(or something similar) suffix, in order to make it clear that it was built via the package manager (and is different from any potential user-managed copy of superhtml
in PATH).
So something like this: -Dforce-version={tag}-mason
.
Seems to be good with the changes. Manual version tag works and it build correctly now (I also added the release optimization that you mentioned. Closed by https://github.com/kristoff-it/superhtml/releases/tag/v0.4.3
Hello, I've been doing some legwork to add superhtml into various neovim ecosystems (mason, lspconfig, etc.) however, now that I have got a preliminary setup running, I get this error while trying to execute the lsp:
Here is a screenshot of what it is running (superhtml lsp).