Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vim: use text properties? #51

Open
blueyed opened this issue Oct 4, 2019 · 1 comment
Open

Vim: use text properties? #51

blueyed opened this issue Oct 4, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@blueyed
Copy link
Contributor

blueyed commented Oct 4, 2019

Is Vim 8 supported?
No. Semshi relies on Neovim's fast highlighting API to quickly update lots of highlights. Regular Vim unfortunately doesn't have an equivalent API. (If you think this can be implemented for Vim 8, let me know.)

You could use text properties in Vim probably.

Pseudo / Python code (from my WIP for jedi-vim using it to highlight usages):

if not vim_prop_type_added:
    vim.eval("prop_type_add('jediUsage', {'highlight': 'jediUsage'})")
    vim_prop_type_added = True

vim_prop_add(lnum, start_col+1, {
    'type': 'jediUsage',
    'bufnr': buf.number,
    'length': length,
})

JFI.
As for Neovim there are nice changes planned using tree-sitter for 0.5. Are you aware of them?

@numirias numirias added the enhancement New feature or request label Oct 8, 2019
@numirias
Copy link
Owner

numirias commented Oct 8, 2019

You could use text properties in Vim probably.

Ah, thanks, that sounds helpful! I'm going to look into that.

As for Neovim there are nice changes planned using tree-sitter for 0.5. Are you aware of them?

I saw it come up a few times on the issue tracker - is there a current ticket/PR?

In theory, being able to take advantage of tree-sitter's incremental parsing would be a huge upgrade. However, Semshi doesn't just parse the syntax, but also determines scopes, etc. That is, Semshi also needs symbol lookup logic, whereas tree-sitter AFAIK only provides grammar parsing. Updating symbol tables incrementally seems like a challenge on its own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants