0oastro / dim.lua Goto Github PK
View Code? Open in Web Editor NEWDim unused words in neovim
Dim unused words in neovim
Hi ๐๐ฟ
Thanks for this plugin, it's really cool. I'm currently running nvim 0.8 nightly and noticed that when I leave neovim I now get this output. It seems that something invalid is being sent to the query function. I'm not super familiar with how the query is being use, but maybe you can pick something out of the output
Error detected while processing DiagnosticChanged Autocommands for "*":
E5108: Error executing lua ...-c87a5eb/share/nvim/runtime/lua/vim/treesitter/query.lua:434: bad argument #2 to 'handler' (string expected, got nil)
stack traceback:
[C]: in function 'handler'
...-c87a5eb/share/nvim/runtime/lua/vim/treesitter/query.lua:434: in function 'match_preds'
...-c87a5eb/share/nvim/runtime/lua/vim/treesitter/query.lua:519: in function '(for generator)'
...al/share/nvim/site/pack/packer/start/dim.lua/lua/dim.lua:105: in function 'fn'
...b/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:194: in function 'for_each_tree'
...al/share/nvim/site/pack/packer/start/dim.lua/lua/dim.lua:85: in function 'get_treesitter_hl'
...al/share/nvim/site/pack/packer/start/dim.lua/lua/dim.lua:47: in function 'highlight_word'
...al/share/nvim/site/pack/packer/start/dim.lua/lua/dim.lua:129: in function 'hig_unused'
[string ":lua"]:1: in main chunk
[C]: in function 'nvim_exec_autocmds'
...m/HEAD-c87a5eb/share/nvim/runtime/lua/vim/diagnostic.lua:1414: in function 'reset'
...r/neovim/HEAD-c87a5eb/share/nvim/runtime/lua/vim/lsp.lua:955: in function <...r/neovim/HEAD-c87a5eb/share/nvim/runtime/lua/vim/lsp.lua:947>%
Upon exiting nvim I see this in the shell:
Error detected while processing DiagnosticChanged Autocommands for "*":
E5108: Error executing lua ...ganf/usr/share/nvim/runtime/lua/vim/treesitter/query.lua:434: bad argument #1 to 'handler' (string expected, got nil)
stack traceback:
[C]: in function 'handler'
...ganf/usr/share/nvim/runtime/lua/vim/treesitter/query.lua:434: in function 'match_preds'
...ganf/usr/share/nvim/runtime/lua/vim/treesitter/query.lua:519: in function '(for generator)'
/home/ajitid/.local/share/nvim/plugged/dim.lua/lua/dim.lua:110: in function 'fn'
...r/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:194: in function 'for_each_tree'
/home/ajitid/.local/share/nvim/plugged/dim.lua/lua/dim.lua:90: in function 'get_treesitter_hl'
/home/ajitid/.local/share/nvim/plugged/dim.lua/lua/dim.lua:47: in function 'highlight_word'
/home/ajitid/.local/share/nvim/plugged/dim.lua/lua/dim.lua:135: in function 'hig_unused'
[string ":lua"]:1: in main chunk
[C]: in function 'nvim_exec_autocmds'
...im.a2Cganf/usr/share/nvim/runtime/lua/vim/diagnostic.lua:1414: in function 'reset'
...ount_nvim.a2Cganf/usr/share/nvim/runtime/lua/vim/lsp.lua:955: in function <...ount_nvim.a2Cganf/usr/share/nvim/runtime/lua/vim/lsp.lua:947>โ
I've seen this happening when I open a typescript file and close neovim afterwards.
PS: Is it possible for this plugin to only update dimming highlights after I exit insert or select mode?
The following error is displayed in the latest version of Neovim Nightly:
Error detected while processing DiagnosticChanged Autocommands for "*":
E5108: Error executing lua ...al/share/nvim/site/pack/packer/start/dim.lua/lua/dim.lua:121: attempt to call method '_get_hl_from_capture' (a nil value)
stack traceback:
...al/share/nvim/site/pack/packer/start/dim.lua/lua/dim.lua:121: in function 'fn'
...1/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:210: in function 'for_each_tree'
...al/share/nvim/site/pack/packer/start/dim.lua/lua/dim.lua:95: in function 'get_treesitter_hl'
...al/share/nvim/site/pack/packer/start/dim.lua/lua/dim.lua:47: in function 'highlight_word'
...al/share/nvim/site/pack/packer/start/dim.lua/lua/dim.lua:140: in function 'hig_unused'
[string ":lua"]:1: in main chunk
[C]: in function 'nvim_exec_autocmds'
...HEAD-9a5ac06_1/share/nvim/runtime/lua/vim/diagnostic.lua:727: in function 'set'
...-9a5ac06_1/share/nvim/runtime/lua/vim/lsp/diagnostic.lua:206: in function 'handler'
...neovim/HEAD-9a5ac06_1/share/nvim/runtime/lua/vim/lsp.lua:1056: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
This could be related to the breaking change neovim/neovim#14090 (comment) as I can see in the code that that function is used:
The following error appears after updating to the latest version of Neovim nightly:
Error in packer_compiled: ...al/share/nvim/site/pack/packer/start/dim.lua/lua/dim.lua:158: attempt to call field 'nvim__set_hl_ns' (a nil value)
This was probably caused by neovim/neovim#14090 (comment), which is a breaking change.
https://github.com/NarutoXY/dim.lua/blob/2cdca0e3c43dc36ac09d7096794aa6908ca53196/lua/dim.lua#L14
If I'm not mistaken, this is the same as vim.tbl_contains()
I need these:
โ clangd (c, c++)
โ omnisharp (c#)
โ pylsp (python)
Currently it doesn't work with clangd and pylsp.
As title. And it seems that even though I provide change_in_insert = false,
, it is still dimming out text in insert mode.
Without this plugin the CPU usage is always < peak=50% (with LSP enable, browsing one of my lua config <300 lines). When this plugin is enabled the number goes to >75%(when typing long text). And the delay is sensible.
This problem must be taken seriously to really make it useful in real(i.e. large) projects.
dim.lua sounds interesting. The README says near the top of "dim is a lua plugin for neovim 0.7.0 dev", but then says later "Neovim >= 0.6.0". This seems inconsistent :) Might be worth clarifying...
Thanks.
E5108: Error executing lua ...im/0.8.1/share/nvim/runtime/lua/vim/treesitter/query.lua:499: bad argument #1 to 'handler' (string expected, got nil)
stack traceback:
[C]: in function 'handler'
...im/0.8.1/share/nvim/runtime/lua/vim/treesitter/query.lua:499: in function 'match_preds'
...im/0.8.1/share/nvim/runtime/lua/vim/treesitter/query.lua:584: in function '(for generator)'
...r/neovim/0.8.1/share/nvim/runtime/lua/vim/treesitter.lua:239: in function 'fn'
...1/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:210: in function 'for_each_tree'
...r/neovim/0.8.1/share/nvim/runtime/lua/vim/treesitter.lua:217: in function 'get_captures_at_pos'
...al/share/nvim/site/pack/packer/start/dim.lua/lua/dim.lua:82: in function 'get_treesitter_hl'
...al/share/nvim/site/pack/packer/start/dim.lua/lua/dim.lua:47: in function 'highlight_word'
...al/share/nvim/site/pack/packer/start/dim.lua/lua/dim.lua:140: in function 'hig_unused'
[string ":lua"]:1: in main chunk
[C]: in function 'nvim_exec_autocmds'
...r/neovim/0.8.1/share/nvim/runtime/lua/vim/diagnostic.lua:1426: in function 'reset'
...w/Cellar/neovim/0.8.1/share/nvim/runtime/lua/vim/lsp.lua:1142: in function <...w/Cellar/neovim/0.8.1/share/nvim/runtime/lua/vim/lsp.lua:1134>
Hello,
Thank you for this plugin. I haven't been able to get it working with tsserver, but saw it mentioned on the readme. I notice there's no tests for tsserver, so I'm curious if it's supported? If so, does it require any particular diagnostic server, or setup?
I'm currently using tsserver with quick-lint-js server for diagnotics, but I tested out the eslint server (not via null-ls) to no avail.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.