Uwe Krause
Uwe Krause

Reputation: 11

How to pass options to lsp server with KDE Kate editor?

While editing Typts files, KDE Kate editor switches the tinymist lsp context every time one switches to another file in another tab.

While compiling the main-typ with the included files works (see minimal example), as soon as I edit the file to include, Kate via the language server reports [typst] label <labelnamehere> does not exist in the document.

I found that Tinymist solved this by running the pin function (pinMain) on lsp attach, but how do I either change the Kate config to "run the pin function on lsp attach", or how can I interact with the lsp server automatically started by Kate to run this function myself?

Minimal example

main.typ:

= Chapter from main
Text in `main` @adams95guide
#include "chapter1.typ"
#bibliography("bibliography.bib")

chapter1.typ:

Text in included file. @munroe14whatif
// lsp error: "[typst] label <labelnamehere> does not exist in the document"

bibliography.bib:

@book{munroe14whatif,
    title = {What If? Serious Scientific Answers to Absurd Hypothetical Questions},
    author = {Munroe, Randall},
    year = 2014
}

@book{adams95guide,
    author = {Adams, Douglas},
    title = {The Hitchhiker's Guide to the Galaxy},
    year = 1995
}

Screenshot to show references are correct:
When compiling main.typ, all references are correct.

Kate default lsp config for typst

{
  "typst": {
    "command": [
      "tinymist"
    ],
    "path": [
      "~/.cargo/bin"
    ],
    "root": ".",
    "url": "https://github.com/Myriad-Dreamin/tinymist",
    "highlightingModeRegex": "^Typst$"
  }
}

Upvotes: 1

Views: 17

Answers (0)

Related Questions