kate lsp client plugin

Mark Nauwelaerts mark.nauwelaerts at gmail.com
Sun Jul 14 11:15:24 BST 2019


On 14/07/19 09:27, Dominik Haumann wrote:
> I symlinked compile_commands.json in my KTextEditor git folder to the existing 
> one in the build folder. Have to investigate whether any wrong paths appear...
>
> I am not using the cmake kate generator, I only have the option 
> -DCMAKE_COMPILE_COMMANDS enabled...
>
> Have to check again...
>
> Best regards
> Dominik
>
>
>
> Christoph Cullmann <christoph at cullmann.io <mailto:christoph at cullmann.io>> 
> schrieb am Sa., 13. Juli 2019, 17:07:
>
>     Hi,
>
>     > For "Goto Declaration", this is actually "normal" and that also
>     > happens here.  That is because a (slightly older) clangd does not
>     > support that method, as reported in the (error) reply. Unfortunately
>     > there is no (spec'ed) way to detect that client-side, which is why the
>     > action is still enabled.  So as long as "Goto Definition" and the
>     > others still work, then it is about as OK as it can be ...
>     >
>     > More generally, there will always be some cases where the server does
>     > not handle something in some way, and where it may feel that is due to
>     > kate/lspclient.  In this case it might be detected by the error reply
>     > but there are other cases as well.  For instance, the
>     > "includeDeclaration" (for Find References) is checkable, but neither
>     > clangd nor python-language-server consider that setting (when
>     > translated to protocol level), and so the result of "Find References"
>     > will be the same whether or not enabled ...  So no way at all to
>     > detect that, which is why I was considering disabling that
>     > configuration option, but then again other servers might properly
>     > support it (or also clangd in some time) ...
>     >
>     > The "Failed to find compilation database" part that clangd reports
>     > might also be a bit worrying here, but may or may not be relevant ...
>
>     For me the plugin didn't work with clangd because I did setup my
>     development
>     stuff via symlinks and therefore the compilation database file names
>     didn't match
>     the "canonical" file names Kate provided.
>
>     I changed my config to use the canonical file names for the
>     kdesrc-buildrc and
>     since then this errors vanished.
>
>     Btw., I just tried the current state, very nice!
>
>     Find references is really useful!
>
>     Highlight with the jump list is nice, too.
>
>     Greetings
>     Christoph
>
>     -- 
>     Ignorance is bliss...
>     https://cullmann.io | https://kate-editor.org
>

If files have "several identities" due to symlinks, then things might get 
confused indeed.

I pushed some more commits that add support for diagnostics; a tab to display 
those as well as adding highlighting and marks (configurable in either case).  
On that topic, I selected markType30 (and markType31 for "references" and so 
on), not clear on if/how this is coordinated in some way, but looks like those 
are not yet in use elsewhere, so I picked those (for now at least) along with 
the predefined for Error, Warning.

Perhaps some of the presentation could be improved (also not on my best points 
;-) ), but it should be ok-ish as it is ...  If enabled (by default), and the 
compilation database is not properly found, things might turn quite colorful 
real fast ;-)

Along the way I noticed that a 'showToolView' call seems to move focus away (to 
where??) from the main (text) window if the toolview is not yet shown (otherwise 
focus stays on text).  The same happens when clicking around on one of the 
toolview tabs. Perhaps that is intentional, but also a bit surprising when only 
showing a listing (in a toolview) that needs no focus, and have not found a way 
around that.

In next steps, I will probably tweak some configuration a bit, consider 
"document revision id" (as mentioned earlier) and use those in positions and 
dealing with TextEdit (as to be returned from e.g. (range)formatting commands 
and "fixit" commands).

Regards,
Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwrite-devel/attachments/20190714/248fc697/attachment-0001.html>


More information about the KWrite-Devel mailing list