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

Is there any chance of implementing new tree sitter functionality? #123

Open
eo1989 opened this issue Apr 10, 2022 · 3 comments
Open

Is there any chance of implementing new tree sitter functionality? #123

eo1989 opened this issue Apr 10, 2022 · 3 comments

Comments

@eo1989
Copy link

eo1989 commented Apr 10, 2022

As the title states, and I do recall it being discussed in chats (zulip, iirc)/forums, but it has been a minute since then. Is there any news on where this plugins' development may lead? Any plans to implement/merge treesitter/lsp features?

Thank you for this great plugin! @numirias

@wookayin
Copy link
Contributor

This project seems no longer maintained, and treesitter functionality is IMHO outside the scope of this plugin, so don't get your hopes too high. Could you elaborate what kind of functionality/features are you specifically expecting?

@Freed-Wu
Copy link

Hey, what is the difference between this plugin and nvim-treesitter?

@wookayin
Copy link
Contributor

wookayin commented Oct 12, 2023

Treesitter and Semshi have different focus and goals. In a nutshell treesitter is only for "syntax" and not concerned about "semantics", where the goal of semshi is semantic highlighting.

Treesitter is parser, it can parse python code into a syntax tree using the internal parser, for highlight, indentation, or any other vim-related features. Semshi also builds python AST but relies on the python's built-in ast module. Both allows simple and basic highlighting (actually for "syntax" highlighting purpose treesitter is much better), what semshi can do apart from treesitter is semantic highlighting.

For example, highlighting unused variables, local variables v.s. closure, scope-awareness, deprecated functions, etc. This requires more language-aware understanding of the code beyond the abstract syntax tree. This can be also achieved by LSP's semantic tokens, but the current language servers like pyright, python-language-server do not have a feature of semantic tokens. Semshi makes uses python's symbol table or environments to understand a bit more of semantics to make this possible, although not fully comprehensive.

So you can use treesitter (or regex-based vim syntax) and semshi together complementarily. Features other than semantic highlighting (such as renaming variables, syntax errors, goto, etc.) were useful before the advent of LSPs but are now superseded by neovim's built-in LSP support. Eventually semshi won't be needed if python LSPs provide a full support of semantic tokens, but until then semshi can provide users with some goodies.

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

No branches or pull requests

3 participants