helix-editor / helix

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

Marksman configuration may not work without adjusting verbosity levels #11638

Closed jsco2t closed 1 month ago

jsco2t commented 1 month ago

Summary

I have the following versions installed:

MacOS: 14.5
Helix: 24.7 (079f5442) - from homebrew
Marksman: 1.0.0-2023-12-09 - from homebrew

Issue: Using a Marksman configuration based on the languages.toml in this repo - I was getting the following error:

2024-09-05T15:39:10.685 helix_lsp::transport [ERROR] marksman err <- "[15:39:10 INF] <LSP Entry> Starting Marksman LSP server: {}\n"

It took me some playing around with Marksman to realize the above statement is what Marksman was logging to standard out when its started with: marksman server.

Example:

❯ marksman server
[16:38:11 INF] <LSP Entry> Starting Marksman LSP server: {}

I found that by adjusting Marksman's verbosity levels I could get the transport error to go away:

Example:

❯ marksman server --verbose 0

This lead me to adjust how I was starting Marksman in my languages.toml configuration:

[language-server]
marksman = { command = "marksman", args = ["server", "--verbose", "0"] }

.....truncated......

[[language]]
name = "markdown"
language-servers = ["vale", "marksman"]
file-types = ["md", "mdx"]
formatter = { command = 'prettier', args = ["--parser", "markdown"] }
text-width = 100
rulers = [100]
auto-format = true
indent = { tab-width = 2, unit = "  " }
block-comment-tokens = { start = "<!--", end = "-->" }

This seems to have resolved any errors I was seeing in the Helix log related to Marksman. In addition (as best I can tell) Marksman is offering it's advertised functionality in Markdown documents.

Reproduction Steps

No response

Helix log

~/.cache/helix/helix.log ``` 2024-09-05T15:39:10.685 helix_lsp::transport [ERROR] marksman err <- "[15:39:10 INF] Starting Marksman LSP server: {}\n" ```

Platform

macOS

Terminal Emulator

kitty v0.36.1

Installation Method

brew

Helix Version

Helix 24.7 (079f5442)

jsco2t commented 1 month ago

If anyone else can confirm they are seeing the same - I would be happy to open a PR on the languages.toml file to introduce a fix.

pascalkuthe commented 1 month ago

Marksman is using the intended way for LSP server to display log messages. Thsee messages don't indicate a problem of any sort and won't impact functionality.

All that changing the verbosity level does anyway is whether these messages endup saved in the log file or not.

I wouldn't change the default logging behavior of a server in our config unleß its totally unreasonable. What to log/not log by default should be up to LSP authors.