Giter Site home page Giter Site logo

Comments (5)

shackra avatar shackra commented on May 10, 2024

that seems to work only for the current buffer, i.e.: if a reference is defined on another file and that file is not visited by Emacs then the implementation will move you to the first reference of that symbol in the same file.

Let me ask you something: do we really want such feature? (if we don't want it, you can always write a package and publish it) I see you are part of emacs-lsp, which makes me wonder what is wrong with lsp-mode that having such feature with help of emacs-tree-sitter seems so attractive?

from elisp-tree-sitter.

leungbk avatar leungbk commented on May 10, 2024

Let me ask you something: do we really want such feature? (if we don't want it, you can always write a package and publish it) I see you are part of emacs-lsp, which makes me wonder what is wrong with lsp-mode that having such feature with help of emacs-tree-sitter seems so attractive?

There are a couple of things I like about tree-sitter here:

  1. I would expect tree-sitter-based symbol-at-point-highlighting to be faster than what we do in lsp-mode, which is to make a textDocument/documentHighlight request.
  2. I would also expect a tree-sitter-based function that goes to the next occurrence in the buffer of the symbol at point to be faster than lsp-ui-find-next-reference, which makes a new textDocument/references request each time we call it.

that seems to work only for the current buffer, i.e.: if a reference is defined on another file and that file is not visited by Emacs then the implementation will move you to the first reference of that symbol in the same file.

xref is expected to support falling back on different backends someday. So having tree-sitter-based definition-jumping should be worth it if/when that day comes.

from elisp-tree-sitter.

theHamsta avatar theHamsta commented on May 10, 2024

Why should copying our implementation be a problem for GNU MELPA? Isn't the actual problem for you the implementation in Lua? Our implementation could be improved regarding speed (better caching and look-in by hash tables) for using it for semantic highlighting (not only highlighting of current symbol but resolving the definition for queries that ask for the definition of a symbol). It's nevertheless very fast. We also helped with the draft of sidekick https://github.com/ElPiloto/sidekick.nvim which might be worth to look at.

The feature is handy for smart rename for languages that don't have a language server.

from elisp-tree-sitter.

leungbk avatar leungbk commented on May 10, 2024

Why should copying our implementation be a problem for GNU MELPA?

I've asked the #emacs and #fsf IRC channels about whether code released under a GPL-compatible license such as nvim-tree-sitter's Apache 2.0 license can be copied and included as part of Emacs without further steps (I think ELPA qualifies as "part of Emacs"). I did not receive an answer from anyone with any legal training, but some of the other people there who had contributed to Emacs speculated that for the code to be included, the people who originally wrote the copied code would need to sign papers -- presumably authorizing the FSF to redistribute the code under GPL 3+ or something.

Thanks for the implementation hints. If I ever get an affirmative answer on the whole copyrighting issue, I'll study your guys' code.

from elisp-tree-sitter.

theHamsta avatar theHamsta commented on May 10, 2024

@leungbk we know all the contributers and could ask them about dual licensing if this is an issue.

from elisp-tree-sitter.

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.