Giter Site home page Giter Site logo

Comments (3)

wookayin avatar wookayin commented on September 25, 2024 2

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.

from semshi.

wookayin avatar wookayin commented on September 25, 2024

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?

from semshi.

Freed-Wu avatar Freed-Wu commented on September 25, 2024

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

from semshi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.