Hi,

On Fri, Jul 30, 2021 at 11:39 AM Pontus Leitzler <[email protected]>
wrote:

> *Is your feature request about something that is currently impossible or
> hard to do? Please describe the problem.*
>
> As a part of govim <http://github.com/govim/govim>, a Go development
> plugin for vim, I'm adding support for the LSP feature "semantic tokens"
> <https://microsoft.github.io/language-server-protocol/specification#textDocument_semanticTokens>
> .
>
> In essence it lets an external process (language server) provide syntax
> highlighting that is more detailed than the one provided by vim (since it
> is has more knowledge about the specific language in detail).
>
> I'm using text properties to apply these highlights to a buffer, by
> defining a couple of different text property types (like comment,
> namespace or keyword; as defined by the language server protocol).
>
> Since a file often has many different highlights, this yields many calls
> to prop_add(), even if we only highlight the visible part of a buffer
> (i.e. lines visible in a window).
>
> *Describe the solution you'd like*
> I'd like to be able to add multiple text properties (of a specific type?)
> in a single call.
>
> So that I can, instead of calling (real life example only rendering the
> visible part of a buffer):
>
> prop_add(1,1,{"type":"comment","id":2,"end_lnum":1,"end_col":55,"bufnr":1})
>
>
> I could call something like (just an example, might be better ways to
> design the parameters) :
>
> prop_add_list({"type":"command":"id":2,"bufnr":1}, [1,1,1,55], [2,1,2,54], 
> [3,1,3,50], [26,1,26,84], [27,1,27,84], [28,1,28,64], [30,1,30,55])
>
>
If the argument to the new prop_add_list() function is a List of the
arguments accepted by prop_add(), will that work? i.e.

prop_add_list([[1,1 {'type': 'comment'}], [2, 1, {'type': 'variable'}],
[26, 1, {'type': 'variable'}]])

- Yegappan


>  The nature of syntax highlighting requires a lot of text properties
> added (and removed if you only want to show the visible lines).
>
> *Describe alternatives you've considered*
> None, I currently call prop_add multiple times each time the highlight
> changes. And it could be often as the user types or scrolls through the
> code in a buffer.
>
>
>

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/CAAW7x7nDp6%2BzJQJ6_d%3DEfmQQpFpv1kVCLYf%3DYy225SwtBArPWg%40mail.gmail.com.

Raspunde prin e-mail lui