helix-editor / helix

A post-modern modal text editor.
https://helix-editor.com
Mozilla Public License 2.0
33.75k stars 2.51k forks source link

Markdown syntax highlighting broken in Nord theme #9131

Closed dani0854 closed 10 months ago

dani0854 commented 10 months ago

Summary

At some point markdown syntax highlighting has disappeared, and only a couple of elements are still highlighted, while most of the file is white. And it happens only with md files. While all other languages work fine within same helix instance. image

I noticed it when I installed markdown LSP, but I couldn't establish any connection. Removing LSP doesn't fix the problem.

What I did find related, is that when COLORTERM= then highlighting works in Markdown, though theme doesn't, which to be expected. Normally COLORTERM=truecolor.

hx --health markdown:

Configured language servers:
  ✓ marksman: /run/current-system/sw/bin/marksman
  ✓ ltex-ls: /run/current-system/sw/bin/ltex-ls
Configured debug adapter: None
Highlight queries: ✓
Textobject queries: ✘
Indent queries: ✘

My config:

theme = "nord"

[editor]
bufferline = "multiple"
color-modes = true

Reproduction Steps

I tried this: 1. `RUST_BACKTRACE=1 hx -vv --log log test.md` I expected this to happen: Syntax highlighting of all markdown elements Instead, this happened: Only 2 elements had different colors, like in the picture above ### Helix log
~/tmp/hx/log ``` 2023-12-22T02:26:06.564 helix_view::clipboard [DEBUG] Using wl-copy+wl-paste to interact with the system and selection (primary) clipboard 2023-12-22T02:26:06.590 helix_vcs [INFO] Error { context: "failed to open git repo", source: Discover( NoGitRepository { path: "/tmp/hx", }, ), } 2023-12-22T02:26:06.590 helix_vcs [INFO] failed to open diff base for /tmp/hx/test.md 2023-12-22T02:26:06.590 helix_vcs [INFO] Error { context: "failed to open git repo", source: Discover( NoGitRepository { path: "/tmp/hx", }, ), } 2023-12-22T02:26:06.590 helix_vcs [INFO] failed to obtain current head name for /tmp/hx/test.md 2023-12-22T02:26:06.590 helix_lsp::transport [INFO] marksman -> {"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"]}},"dataSupport":true,"disabledSupport":true,"isPreferredSupport":true,"resolveSupport":{"properties":["edit","command"]}},"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},"didChangeWatchedFiles":{"dynamicRegistration":true,"relativePatternSupport":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.10 (f6021dd0)"},"processId":42851,"rootPath":"/tmp/hx","rootUri":null,"workspaceFolders":[]},"id":0} 2023-12-22T02:26:06.590 helix_view::editor [DEBUG] editor status: Loaded 1 file. 2023-12-22T02:26:06.590 helix_lsp::client [INFO] Using custom LSP config: {"ltex":{"languageToolHttpServerUri":"http://localhost:8081/"}} 2023-12-22T02:26:06.591 helix_lsp::transport [INFO] ltex-ls -> {"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"]}},"dataSupport":true,"disabledSupport":true,"isPreferredSupport":true,"resolveSupport":{"properties":["edit","command"]}},"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},"didChangeWatchedFiles":{"dynamicRegistration":true,"relativePatternSupport":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.10 (f6021dd0)"},"initializationOptions":{"ltex":{"languageToolHttpServerUri":"http://localhost:8081/"}},"processId":42851,"rootPath":"/tmp/hx","rootUri":null,"workspaceFolders":[]},"id":0} 2023-12-22T02:26:06.595 helix_tui::backend::crossterm [DEBUG] The keyboard enhancement protocol is not supported in this terminal (checked in 3.911876ms) 2023-12-22T02:26:06.596 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0 2023-12-22T02:26:06.745 helix_lsp::transport [ERROR] marksman err <- "[02:26:06 INF] Starting Marksman LSP server: {}\n" 2023-12-22T02:26:06.815 helix_term::application [DEBUG] received editor event: IdleTimer 2023-12-22T02:26:06.894 helix_lsp::transport [ERROR] ltex-ls err <- "SLF4J: Failed to load class \"org.slf4j.impl.StaticLoggerBinder\".\n" 2023-12-22T02:26:06.894 helix_lsp::transport [ERROR] ltex-ls err <- "SLF4J: Defaulting to no-operation (NOP) logger implementation\n" 2023-12-22T02:26:06.894 helix_lsp::transport [ERROR] ltex-ls err <- "SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.\n" 2023-12-22T02:26:07.232 helix_lsp::transport [INFO] marksman <- {"jsonrpc":"2.0","id":0,"result":{"capabilities":{"textDocumentSync":{"openClose":true,"change":1},"hoverProvider":true,"completionProvider":{"triggerCharacters":["[","#","("]},"definitionProvider":true,"referencesProvider":true,"documentSymbolProvider":true,"workspaceSymbolProvider":true,"codeActionProvider":{"resolveProvider":false},"renameProvider":{"prepareProvider":true},"semanticTokensProvider":{"legend":{"tokenTypes":["class","class","enumMember"],"tokenModifiers":[]},"range":true,"full":{"delta":false}},"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":true},"fileOperations":{"didCreate":{"filters":[{"pattern":{"glob":"**/*.{}","matches":"file","options":{"ignoreCase":true}}}]},"didDelete":{"filters":[{"pattern":{"glob":"**/*.{}","matches":"file","options":{"ignoreCase":true}}}]}}}}}} 2023-12-22T02:26:07.232 helix_lsp::transport [INFO] marksman <- {"capabilities":{"codeActionProvider":{"resolveProvider":false},"completionProvider":{"triggerCharacters":["[","#","("]},"definitionProvider":true,"documentSymbolProvider":true,"hoverProvider":true,"referencesProvider":true,"renameProvider":{"prepareProvider":true},"semanticTokensProvider":{"full":{"delta":false},"legend":{"tokenModifiers":[],"tokenTypes":["class","class","enumMember"]},"range":true},"textDocumentSync":{"change":1,"openClose":true},"workspace":{"fileOperations":{"didCreate":{"filters":[{"pattern":{"glob":"**/*.{}","matches":"file","options":{"ignoreCase":true}}}]},"didDelete":{"filters":[{"pattern":{"glob":"**/*.{}","matches":"file","options":{"ignoreCase":true}}}]}},"workspaceFolders":{"changeNotifications":true,"supported":true}},"workspaceSymbolProvider":true}} 2023-12-22T02:26:07.232 helix_lsp::transport [INFO] marksman -> {"jsonrpc":"2.0","method":"initialized","params":{}} 2023-12-22T02:26:07.232 helix_term::application [DEBUG] received editor event: LanguageServerMessage((0, Notification(Notification { jsonrpc: None, method: "initialized", params: None }))) 2023-12-22T02:26:07.232 helix_lsp::transport [INFO] marksman -> {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"languageId":"markdown","text":"# Markdown: Syntax\n\n* [Overview](#overview)\n * [Philosophy](#philosophy)\n\n**Note:** This document is itself written using Markdown; you\ncan [see the source for it by adding '.text' to the URL](/projects/markdown/syntax.text).\n\n----\n\n```console\nhx -v\n```\n\n## Overview\n\n### Philosophy\n\nMarkdown is intended to be as easy-to-read and easy-to-write as is feasible.\n\nReadability, however, is emphasized above all else. A Markdown-formatted\ndocument should be publishable as-is, as plain text, without looking\nlike it's been marked up with tags or formatting instructions. While\nMarkdown's syntax has been influenced by several existing text-to-HTML\nfilters -- including [Setext](http://docutils.sourceforge.net/mirror/setext.html), [atx](http://www.aaronsw.com/2002/atx/), [Textile](http://textism.com/tools/textile/), [reStructuredText](http://docutils.sourceforge.net/rst.html),\n[Grutatext](http://www.triptico.com/software/grutatxt.html), and [EtText](http://ettext.taint.org/doc/) -- the single biggest source of\ninspiration for Markdown's syntax is the format of plain text email.\n","uri":"file:///tmp/hx/test.md","version":0}}} 2023-12-22T02:26:07.267 helix_term::application [DEBUG] received editor event: Redraw 2023-12-22T02:26:07.267 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0 2023-12-22T02:26:08.952 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0 2023-12-22T02:26:09.202 helix_term::application [DEBUG] received editor event: IdleTimer 2023-12-22T02:26:09.229 helix_term::commands::typed [DEBUG] quitting... 2023-12-22T02:26:09.230 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0 2023-12-22T02:26:09.739 helix_term::commands::typed [DEBUG] quitting... 2023-12-22T02:26:09.739 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0 2023-12-22T02:26:09.739 helix_term::job [DEBUG] waiting on jobs... 2023-12-22T02:26:09.739 helix_term::job [DEBUG] waiting on jobs... 2023-12-22T02:26:09.739 helix_lsp::file_event [DEBUG] Removing LSP client: 0 2023-12-22T02:26:09.739 helix_lsp::file_event [DEBUG] Removing LSP client: 1 2023-12-22T02:26:09.739 helix_lsp::transport [INFO] Language server not initialized, shutting down 2023-12-22T02:26:09.739 helix_lsp::transport [INFO] marksman -> {"jsonrpc":"2.0","method":"shutdown","id":1} 2023-12-22T02:26:09.739 helix_lsp::client [WARN] language server failed to terminate gracefully - server closed the stream 2023-12-22T02:26:09.742 helix_lsp::transport [INFO] marksman <- {"jsonrpc":"2.0","id":1,"result":null} 2023-12-22T02:26:09.742 helix_lsp::transport [INFO] marksman <- null 2023-12-22T02:26:09.742 helix_lsp::transport [INFO] marksman -> {"jsonrpc":"2.0","method":"exit"} ```
### Platform Linux ### Terminal Emulator wezterm e3cd2e93d0ee5f3af7f3fe0af86ffad0cf8c7ea8 (latest commit) ### Installation Method nixpkgs ### Helix Version helix 23.10 (f6021dd0)
the-mikedavis commented 10 months ago

It looks like https://github.com/helix-editor/helix/pull/7490 removed the markup.* scopes for the theme (https://docs.helix-editor.com/master/themes.html#syntax-highlighting) which provide highlighting for things like headers, bold and italic in markdown.

\cc @sharpenedblade