Comments (13)
actually the following patch works for me:
But I don't know if this is too simple where a lot of cases are not taken into account. But for Python
vs python
, JSON
vs json
, R
vs r
, it just works.
diff --git a/lua/nvim-treesitter/query_predicates.lua b/lua/nvim-treesitter/query_predicates.lua
index d4726107..e48f3279 100644
--- a/lua/nvim-treesitter/query_predicates.lua
+++ b/lua/nvim-treesitter/query_predicates.lua
@@ -17,7 +17,7 @@ local non_filetype_match_injection_language_aliases = {
local function get_parser_from_markdown_info_string(injection_alias)
local match = vim.filetype.match { filename = "a." .. injection_alias }
- return match or non_filetype_match_injection_language_aliases[injection_alias] or injection_alias
+ return match or non_filetype_match_injection_language_aliases[injection_alias] or injection_alias:lower()
end
local function error(str)
from nvim-treesitter.
Hmm, no, because we can't do optional queries. So let's go with your patch. Do you want to make a PR for it?
Ok. I can submit a PR for it.
from nvim-treesitter.
This is intended. See neovim/neovim#28546
from nvim-treesitter.
This is intended. See neovim/neovim#28546
But you can never ensure language name in markdown code block is lower case. Others who do not use neovim write markdown code block in other cases, and then you open that file and your neovim session just freezes...
from nvim-treesitter.
I have encountered the same issue and it is annoying which make me unable to view the file with infinite error message pops. I used command lua vim.treesitter.stop()
to stop the error in order to correct the error...
from nvim-treesitter.
I cannot reproduce this on macOS. And it's important here to distinguish the codeblock annotation (which is case-insensitive) and the language/parser name in your config/on your hard-drive (which must be lower-case).
from nvim-treesitter.
Screen.Recording.2024-05-17.at.03.49.29.mov
Please let me know if this is clear enough. The minimal config file and the sample markdown file has been already provided in the issue.
It is worth to note that The r parser is automatically installed by nvim-treesitter
, and it is r.so
, but the code block name in the markdown is R
, not r
.
from nvim-treesitter.
I use the release from github, not from homebrew. I delete all the files from ~/.cache/nvim
. And the issue is still there. Are there any other potential problems occurred?
from nvim-treesitter.
I'll have to investigate. It's a race condition (it doesn't happen if you :e
the file after starting) that only appears with nvim-treesitter -- and only on master
. If this is not an easy fix (which it looks like it isn't), then I'm afraid this will be "wontfix" and you are recommended to use the main
branch on Nvim 0.10+.
from nvim-treesitter.
Thank you, I forgot that master
still uses that kludge (it's obsolete with 0.10). Your fix is correct, but I'll see how to best deal with that in the deprecation PR.
from nvim-treesitter.
Hmm, no, because we can't do optional queries. So let's go with your patch. Do you want to make a PR for it? (Best to just lower
the input argument, though, so the lookup also works.)
from nvim-treesitter.
you are recommended to use the
main
branch on Nvim 0.10+.
Thanks. Good to know that there is a main branch. Will definitely play around with the new main branch.
from nvim-treesitter.
Fixed by #6648
from nvim-treesitter.
Related Issues (20)
- Bugs Happend When Encounter Math Equations in Markdown or Latex. HOT 1
- No highlighting for svelte HOT 2
- Treesitter not showing italics and bold in markdown files HOT 2
- (latex) Highlight even multiple `&` as a delimiter
- Add VHDL support HOT 1
- Help file tags are disappearing on MacOS neovim with treesitter HOT 3
- SIGSEV error during parsing html HOT 2
- `:TOhtml` does not preserve semantic highlighting HOT 1
- ECMAScript: remove several `@variable.builtins`
- Suggested modification to current roadmap
- vimwiki parser issue HOT 11
- Unable to enable indent only for specific languages HOT 3
- Impossible pattern in highlighter.win for tex files HOT 1
- Doxygen syntax - embedded parameters like `\p len` aren't highlighted HOT 1
- HTML file causes neovim segv HOT 6
- Links and images are underlined with dashes in markdown HOT 22
- latest update to vimdoc error HOT 6
- MyST directives with colon fence notation HOT 2
- [Rust] Ability to fold scopes explicitely defined by curly braces
- Highlighs in .dart goes crazy sometimes
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.