kate lsp client plugin

Mark Nauwelaerts mark.nauwelaerts at gmail.com
Sun Jul 7 13:39:12 BST 2019

On 07/07/19 13:57, Christoph Cullmann wrote:
> Hi,
>> Thanks for the appreciation :-)
>> I indeed intend to continue, and some more commits on server control
>> and configuration are coming up soon.
>> Following that, I plan to add another (bottom) toolview to display
>> info on diagnostics, references, (multiple) definitions ... Some
>> highlight method calls are also related to that area, so may be
>> considered along as well.  That's then heading in the direction of
>> features proposed above, one step at a time ;-)
> Nice, keep the stuff going ;=)
> I was so free to implement a initial version of documentHighlight.
> Seems to work reasonable well, just need a way to later clear the ranges again.
> I aliased
> /**
>  * Language Server Protocol Position
>  * line + column, 0 based, negative for invalid
>  * maps 1:1 to KTextEditor::Cursor
>  */
> using LSPPosition = KTextEditor::Cursor;
> /**
>  * Language Server Protocol Range
>  * start + end tuple of LSPPosition
>  * maps 1:1 to KTextEditor::Range
>  */
> using LSPRange = KTextEditor::Range;
> as these types really map 1:1, even the semantics of "negative == invalid".
> This avoid the conversions and allows to use the convenience API of the 
> cursor/range
> we provide.
> I hope this is ok?
> Greetings
> Christoph
I probably "duplicated" the Position and Range type in an attempt/idea to make 
the lower level protocol/server only depend on own or "low level" (Qt) types.  
But that is not quite primordial so if it alternatively also works and compiles 
that way ... albeit then probably with some adjustment here or there for line() 
or column() accessors.

So I kept going ;-) and then I should probably mention that I added support for 
"references".  And moreover also added a minimalistic (bottom) toolview and 
arranged for adding marks (markinterface) and highlight (movingrange) for the 
(location) results of "definition", "declaration" and "references".  They are 
also cleared at suitable times.  As such, it is then a small (planned/next) step 
to do so as well for "documentHighlight".  As you presumably already have the 
parsing for the latter, I could push the (almost finished/polished) former (on 
"references" and such) this evening, and then you could rebase (cough, or a tad 
more than that)?  Or alternatively, if you prefer I could integrate/rebase your 
patches if short on time/opportunity.

Beyond that step, I was/am planning to handle diagnostics notification, along 
with any highlighting/marking that might involve.  So that will also involve 
that (code) area ...


More information about the KWrite-Devel mailing list