Comments (8)
#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.
Oh we can move that as an async method, to avoid blocking, maybe...
It will need to be cancellable though
from nvim-treesitter.
@vigoux What's the nvim/lua api for making this async? I can take a look at this.
from nvim-treesitter.
@steelsojka, I never used it personnally, but I think that the help page is located at :h lua-loop
.
from nvim-treesitter.
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.
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.
I'll also make it async as well 👍
from nvim-treesitter.
Is the issue still happening with latest master? If not, we will close this.
from nvim-treesitter.
Related Issues (20)
- Issue with syntax highlighting for yaml embedded in Typescript JSDoc comments HOT 8
- Regression in PR #6014: error "rhs: expected string|function, got nil" on incremental_selection HOT 8
- svelte indents don't dedent after closing tag HOT 1
- treesitter/highlighter Error executing lua typescript HOT 1
- ecma function call arguments indents are incorrect HOT 1
- Multiple functions in locals.lua failed for go HOT 1
- Problem with typescript files HOT 1
- [latex] Some comments highlighted incorrectly in math regions HOT 1
- Spell checking doesn't work with elixir grammar HOT 4
- (python) Incorrect try/except indentation in certain cases
- Error During Compilation: No such file or directory HOT 1
- bug: `spell` not working within TSX/JSX HOT 4
- GitHub actions syntax for context variables breaks TS in `run:` sections HOT 1
- Custom syntax highlighting not being applied to markdown fenced code HOT 4
- Only code blocks are highlighted in markdown HOT 1
- Ruby indents braces (`{`) incorrectly inside a method HOT 2
- Two parsers priority indent on the same file HOT 5
- Neovim freezes when using zig treesitter. HOT 22
- error in rust highlights HOT 1
- indentation in a multi language doc HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvim-treesitter.