Adding new LSP languages in Kate?

Mark Nauwelaerts mark.nauwelaerts at gmail.com
Thu Feb 2 17:38:39 GMT 2023


Hi,

Oops, the URL encoding sounds like a bug, which I will have a look at.

Regarding the highlightingMode(RegEx); there exists a similar
situation with Javascript/Typescript/javascript React/Typescript
React.  These are also "dialects" in some way (do not know the VDM
details).  However, in that case, all of these (distinct) modes are
mapped by one entry onto 1 server, where the latter only needs 1
command line and then figures out the "dialect" on its own.  In this
case, it seems the server needs separate options.  But then perhaps
dedicated highlightingMode are needed for each of these dialects
(which is a matter of extending KSyntaxHighlighting, as VDM seems not
supported yet presently?).  If the language is totally unknown, then
using something "random" is indeed the fallback at the moment.  Also,
if the highlightingMode is set to "None", then we could add to fall
back to looking at the "Mode".  The latter could then be set to
"random" if no correct one is available (with highlight disabled).

There is already an option for sending incremental changes, see e.g.
the plugin configuration options "Incrementally synchronize ..." (or
some such).

Regards,
Mark



On Wed, 1 Feb 2023 at 13:35, Nick Battle <nick.battle at gmail.com> wrote:
>
> Hi Kate folk,
>
> I've recently managed to get Kate working with the LSP server that we have for a suite of languages, based around the VDM formal method. Normally we use the VSCode client for our tools, but I'm interested in expanding the clients that we can support.
>
> VDM effectively has three languages or dialects, so I've tried to configure this as three separate Filetypes. It does work, but the configuration is a bit awkward and I'm wondering whether there's a better way? :-)
>
> There's a wiki page that describes what I did here: https://github.com/nickbattle/vdmj/wiki/Using-the-Kate-Editor. I'm testing with version 22.12.1.
>
> A few questions:
>
> Am I using the highlightingModeRegex correctly? The separate language "dialects" (filename extensions) translate into different options for the LSP server, -vdmsl, -vdmpp and -vdmrt. The only way I could get this working was to choose three different random highlight modes that were not used elsewhere in the configuration.
> But this means the actual highlighting is nothing like what is required! Is there any way to improve that?
> When I try to open a folder with a space in the folder name, your LSP client sends a "rootUri" with a space in it. That causes Java's URI handling to reject it (it should be %20?)
> You send the entire file contents on didChange events? That gets quite expensive with large files; is it possible to configure incremental changes somehow?
>
>
> I'm not subscribed to this list, so I would appreciate a CC in any replies. Many thanks!
>
> Cheers,
> -nick


More information about the KWrite-Devel mailing list