Giter VIP home page Giter VIP logo

Comments (8)

steelsojka avatar steelsojka commented on May 27, 2024 1

#154 This fixes a lot of the slowness when I was testing. I will explore making the api async as well, but this is probably a good solution for now.

from nvim-treesitter.

vigoux avatar vigoux commented on May 27, 2024

Oh we can move that as an async method, to avoid blocking, maybe...
It will need to be cancellable though

from nvim-treesitter.

steelsojka avatar steelsojka commented on May 27, 2024

@vigoux What's the nvim/lua api for making this async? I can take a look at this.

from nvim-treesitter.

vigoux avatar vigoux commented on May 27, 2024

@steelsojka, I never used it personnally, but I think that the help page is located at :h lua-loop.

from nvim-treesitter.

theHamsta avatar theHamsta commented on May 27, 2024

I think we just wait for lua support for jobs. There is a PR for it in Neovim. I think it was called vim_wrap or something like that. Can give you hints tomorrow.

You would start the async job with a counter and only perform the highlighting when its finished when the counter was not incremented in the mean time. This is easier to implement that directly using vim.loop.

from nvim-treesitter.

steelsojka avatar steelsojka commented on May 27, 2024

Most of the performance issue is coming from checking if the node is a reference when recursing over the tree.

  M.recurse_tree(scope_node, function(iter_node, _, next)
    if vim.tbl_contains(references, iter_node) and M.get_node_text(iter_node)[1] == node_text then
      table.insert(usages, iter_node)
    end
    next()
  end)

I'll find a better way to check if it's a reference

from nvim-treesitter.

steelsojka avatar steelsojka commented on May 27, 2024

I'll also make it async as well 👍

from nvim-treesitter.

vigoux avatar vigoux commented on May 27, 2024

Is the issue still happening with latest master? If not, we will close this.

from nvim-treesitter.

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.