sublimelsp / LSP-rust-analyzer

Convenience package for rust-analyzer
MIT License
70 stars 11 forks source link

Syntax Highlighting in Hover Tooltips #51

Closed alterae closed 2 years ago

alterae commented 2 years ago

Currently, code in hover tooltips (such as the line that shows what module a given symbol is in, the symbol signature, and any code blocks in the documentation for a symbol) generated by this plugin lack any syntax highlighting. This somewhat impairs readability of these tooltips.

This does not seem to be a general issue with Sublime LSP, as LSP-Deno highlights code in tooltips just fine.

Screenshots

LSP-rust-analyzer tooltip, from a project of mine image

LSP-Deno tooltip, for comparisson image

rchl commented 2 years ago

Works here?

Screenshot 2022-01-03 at 16 10 04

Can you provide the output of the LSP: Troubleshoot server command?

alterae commented 2 years ago

Can you provide the output of the LSP: Troubleshoot server command?

Troubleshooting: rust-analyzer

Version

## Server Configuration
 - command
```json
[
  "${storage_path}/LSP-rust-analyzer/rust-analyzer"
]

Active view

Project / Workspace

LSP configuration

{
  "clients": {
    "ccls": {
      "auto_complete_selector": "punctuation.accessor | (meta.preprocessor.include string - punctuation.definition.string.end)", 
      "command": [
        "ccls"
      ], 
      "selector": "source.c | source.c++ | source.objc | source.objc++"
    }, 
    "ocaml": {
      "command": [
        "ocamllsp"
      ], 
      "enabled": true, 
      "selector": "source.ocaml"
    }
  }, 
  "diagnostics_highlight_style": {
    "error": "underline", 
    "hint": "stippled", 
    "info": "stippled", 
    "warning": "underline"
  }, 
  "lsp_format_on_save": true, 
  "popup_max_characters_height": 25, 
  "popup_max_characters_width": 78, 
  "semantic_highlighting": true, 
  "show_code_lens": "phantom", 
  "show_diagnostics_panel_on_save": 0
}

System PATH

rchl commented 2 years ago

I'm using built-in Rust syntax from Packages/Rust/Rust.sublime-syntax. You are using Packages/Rust Enhanced/RustEnhanced.sublime-syntax.

I guess you've disabled the built-in syntax so the mdpopups dependency used for highlighting the code blocks can't find it and defaults to plain text.

I guess one option is to re-enable the built-in syntax. You should still be able to use "RustEnhanced" for the files themselves.

alterae commented 2 years ago

Ah, yeah. Re-enabling the Rust package solved the issue. Thank you.