Bug 447185 - LSP Client should work for languages without KSyntaxHightlighting definitions
Summary: LSP Client should work for languages without KSyntaxHightlighting definitions
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (other bugs)
Version First Reported In: 21.12.0
Platform: Neon Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-18 16:20 UTC by Jonathan Rubenstein
Modified: 2023-02-04 20:53 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 23.04.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Rubenstein 2021-12-18 16:20:11 UTC
SUMMARY
Kate's LSP Client plugin matches LSP servers only on a file's Highlighting mode, which requires a KSyntaxHighlighting .xml definition for the language. LSP has the ability to provide syntax highlighting itself since 3.16, which Kate has supported since 21.08.0. If a language or filetype does not have a matching definition in KSyntaxHightlighting, you cannot use LSP.

To easily support any language with an LSP server, the LSP client plugin should expose a few options for matching, not just the file's Highlighting mode (highlightingModeRegex).

Kate file Modes—which are easy to author in the Settings dialog—are a good choice. Alternatively, LSP Client could match against file extensions directly.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: KDE neon 5.23 user edition
KDE Plasma Version: 5.23.4
KDE Frameworks Version: 5.89.0
Qt Version: 5.15.3

ADDITIONAL INFORMATION

(This is similar to Bug 447172, however that bug was unclear and messy)
Comment 1 Christoph Cullmann 2022-03-13 20:48:33 UTC
I would propose to go the way to match the mode, too, if the highlighting mode didn't lead to a result.
Comment 2 gl.ivanovsky 2023-01-24 14:50:10 UTC
I am potentially interested in contributing this feature.
Comment 3 Christoph Cullmann 2023-02-04 20:53:20 UTC
lspclient: fallback to document mode for unsupported highlight mode

https://invent.kde.org/utilities/kate/-/commit/6ae42a782999385b715b041aa11966a22b206593