b0o / SchemaStore.nvim

🛍 JSON schemas for Neovim
https://schemastore.org
Apache License 2.0
697 stars 17 forks source link

Broken links in hover window due to \ being printed #21

Closed rensftw closed 11 months ago

rensftw commented 11 months ago

Environment

NVIM v0.9.1 Build type: Release LuaJIT 2.1.0-beta3 SchemaStore.nvim a6759df My LSP config with SchemaStore.nvim

Actual behaviour

Special characters are prefixed by \ resulting in broken URLs. This behaviour happens both in YAML and JSON files.

YAML example:

image

JSON example:

image

Expected behaviour

Escaping symbols like \ is not visible in the hover window. Links are usable.

Schema to reproduce issue

https://github.com/SchemaStore/schemastore/blob/master/.pre-commit-config.yaml

---
repos:
  - repo: https://github.com/pre-commit/mirrors-prettier
    rev: 'v3.0.2'
    hooks:
      - id: prettier
        types_or: [yaml, json, javascript, css, markdown]
        always_run: true
        additional_dependencies:
          - prettier@2.8.3
          - prettier-plugin-sort-json@1.0.0
b0o commented 11 months ago

I'm not seeing the same behavior:

2023-09-01_12-57-47_region

Also, SchemaStore.nvim should really have nothing to do with this, it just provides the schema catalog from upstream. I would investigate your hover provider.

rensftw commented 11 months ago

🤔 I am using lspsaga.nvim and it does seem to be the culprit.

Using the native vim.lsp.buf.hover shows the text correctly:

image

(For anyone interested in how to style the native borders :h lsp.handlers.hover)

@b0o Thank you for the pointer and fast response 🙏