Bug 447185

Summary: LSP Client should work for languages without KSyntaxHightlighting definitions
Product: [Applications] kate Reporter: Jonathan Rubenstein <jrubcop>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist CC: christoph, gl.ivanovsky, mukdenia, uwu, waqar.17a
Priority: NOR    
Version First Reported In: 21.12.0   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 23.04.0
Sentry Crash Report:

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