2 Commits

Author SHA1 Message Date
b20702928a Fix diagnostics box width to be a bit more smarter 2026-01-10 18:16:18 +00:00
3f2046bf9f Fix broken lsp links 2026-01-10 18:15:50 +00:00
2 changed files with 33 additions and 21 deletions

View File

@@ -64,26 +64,26 @@ For some even manual clang or gcc compilation may be required.<br>
The following lsp's are supported and can be installed anywhere in your `$PATH`<br> The following lsp's are supported and can be installed anywhere in your `$PATH`<br>
* **clangd** — [https://clangd.llvm.org/installation.html](https://clangd.llvm.org/installation.html) * [clangd](https://clangd.llvm.org/)
* **solargraph** — [https://solargraph.org/](https://solargraph.org/) * [solargraph](https://solargraph.org/)
* **bash-language-server** — [https://github.com/bash-lsp/bash-language-server](https://github.com/bash-lsp/bash-language-server) * [bash-language-server](https://github.com/bash-lsp/bash-language-server)
* **vscode-css-language-server** — [https://github.com/microsoft/vscode-css-languageservice](https://github.com/microsoft/vscode-css-languageservice) * [vscode-css-language-server](https://github.com/hrsh7th/vscode-langservers-extracted)
* **vscode-json-language-server** — [https://github.com/microsoft/vscode-langservers-extracted](https://github.com/microsoft/vscode-langservers-extracted) * [vscode-json-language-server](https://github.com/hrsh7th/vscode-langservers-extracted)
* **fish-lsp** — [https://github.com/fisho/fish-language-server](https://github.com/fisho/fish-language-server) * [fish-lsp](https://github.com/ndonfris/fish-lsp)
* **gopls** — [https://pkg.go.dev/golang.org/x/tools/gopls](https://pkg.go.dev/golang.org/x/tools/gopls) * [gopls](https://pkg.go.dev/golang.org/x/tools/gopls)
* **haskell-language-server** — [https://github.com/haskell/haskell-language-server](https://github.com/haskell/haskell-language-server) * [haskell-language-server](https://github.com/haskell/haskell-language-server)
* **emmet-ls** — [https://github.com/emmetio/emmetls](https://github.com/emmetio/emmetls) * [emmet-ls](https://github.com/aca/emmet-ls) *Autocompletion for emmet works but doesn't show popup correctly for now, use ctrl+\\ to run after writing emmet code*
* **typescript-language-server** — [https://github.com/typescript-language-server/typescript-language-server](https://github.com/typescript-language-server/typescript-language-server) * [typescript-language-server](https://github.com/typescript-language-server/typescript-language-server)
* **lua-language-server** — [https://github.com/LuaLS/lua-language-server](https://github.com/LuaLS/lua-language-server) * [lua-language-server](https://github.com/LuaLS/lua-language-server)
* **pyright-langserver** — [https://github.com/microsoft/pyright](https://github.com/microsoft/pyright) * [pyright-langserver](https://github.com/microsoft/pyright)
* **rust-analyzer** — [https://github.com/rust-analyzer/rust-analyzer](https://github.com/rust-analyzer/rust-analyzer) * [rust-analyzer](https://github.com/rust-analyzer/rust-analyzer)
* **intelephense** — [https://github.com/bmewburn/vscode-intelephense](https://github.com/bmewburn/vscode-intelephense) * [intelephense](https://intelephense.com/)
* **marksman** — [https://github.com/christianchiarulli/marksman](https://github.com/christianchiarulli/marksman) * [marksman](https://github.com/artempyanykh/marksman)
* **nginx-language-server** — [https://github.com/nginx/nginx-language-server](https://github.com/nginx/nginx-language-server) * [nginx-language-server](https://github.com/pappasam/nginx-language-server)
* **taplo** — [https://github.com/taplolang/taplo](https://github.com/taplolang/taplo) * [taplo](https://taplo.tamasfe.dev/)
* **yaml-language-server** — [https://github.com/redhat-developer/yaml-language-server](https://github.com/redhat-developer/yaml-language-server) * [yaml-language-server](https://github.com/redhat-developer/yaml-language-server)
* **sqls** — [https://github.com/lighttiger2505/sqls](https://github.com/lighttiger2505/sqls) * [sqls](https://github.com/sqls-server/sqls)
* **make-language-server** — [https://github.com/make-langserver/make-language-server](https://github.com/make-langserver/make-language-server) * [make-language-server](https://github.com/Freed-Wu/autotools-language-server)
> As it is still in development, some of these may not work as expected or that well.<br> > As it is still in development, some of these may not work as expected or that well.<br>
> But for c/ruby/lua/python it should work fine (I test more with these).<br> > But for c/ruby/lua/python it should work fine (I test more with these).<br>

View File

@@ -11,7 +11,19 @@ void DiagnosticBox::render_first() {
return; return;
uint32_t longest_line = 8 + warnings[0].source.length(); uint32_t longest_line = 8 + warnings[0].source.length();
for (auto &warn : warnings) { for (auto &warn : warnings) {
longest_line = MAX(longest_line, (uint32_t)warn.text.length() + 7); uint32_t longest = 0;
uint32_t cur = 0;
for (char ch : warn.text_full)
if (ch == '\n') {
longest = MAX(longest, cur);
cur = 0;
} else {
if (ch == '\t')
cur += 3;
++cur;
}
longest = MAX(longest, cur);
longest_line = MAX(longest_line, longest + 7);
longest_line = MAX(longest_line, (uint32_t)warn.code.length() + 4); longest_line = MAX(longest_line, (uint32_t)warn.code.length() + 4);
for (auto &see_also : warn.see_also) for (auto &see_also : warn.see_also)
longest_line = MAX(longest_line, (uint32_t)see_also.length() + 4); longest_line = MAX(longest_line, (uint32_t)see_also.length() + 4);