Comments (9)
jdummy
must be the name of your grammar in grammar.js. Only then tree_sitter_jdummy
will end up in the compiled shared object. You can check the symbols in the parser binary with nm
from nvim-treesitter.
set ft=jdummy
?
from nvim-treesitter.
yes it is. set ft=jdummy
will set the filetype of your buffer to jdummy (:help filetype
)
from nvim-treesitter.
Calling this
require "nvim-treesitter.parsers".get_parser_configs().clojure = {
install_info = {
url = "https://github.com/oakmac/tree-sitter-clojure",
files = {"src/parser.c"}
}
}
before setup
works for me.
from nvim-treesitter.
That's nice, I also added some things too, pr to come.
from nvim-treesitter.
I'm trying to add my own parser to nvim-tree-sitter.
:TSPlaygroundToggle
does not show anything.
What I did:
- Built a custom parser,
grammar.js
andhighlights.scm
.
No errors running the following snippet,
tree-sitter generate
tree-sitter test
- Added the following snippet to
init.vim
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
parser_config.jdummy = {
install_info = {
url = <path_to_repo>,
files = { "src/parser.c" },
branch= 'main'
},
filetype = "jdummy", -- if filetype does not agrees with parser name
}
- Installed the parsers without any errors,
:TSInstall jdummy
Thejdummy.so
is created in the/home/farzaneh/.local/share/nvim/plugged/nvim-treesitter/parser
path nvim test.jdummy
:TSPlaygroundToggle
does not show anything for me.
Am I missing something?
from nvim-treesitter.
Is that a command?
Where should I run set ft=jdummy
?
from nvim-treesitter.
I took these steps:
nvim test.jdummy
:set filetype=jdummy
:TSPlaygroundToggle
an error occurred:
Error executing vim.schedule lua callback: Failed to load parser: uv_dlsym: /home/farzaneh/.local/share/nvim/plugged/nvim-treesitter/parser/jdummy.so: undefined symbol: tree_sitter_jdummy
stack traceback:
[C]: in function '_ts_add_language'
...local/share/nvim/runtime/lua/vim/treesitter/language.lua:33: in function 'require_language'
/usr/local/share/nvim/runtime/lua/vim/treesitter.lua:38: in function '_create_parser'
/usr/local/share/nvim/runtime/lua/vim/treesitter.lua:93: in function 'get_parser'
...d/playground/lua/nvim-treesitter-playground/internal.lua:50: in function 'get_node_at_cursor'
...d/playground/lua/nvim-treesitter-playground/internal.lua:413: in function 'fn'
...gged/playground/lua/nvim-treesitter-playground/utils.lua:23: in function 'cb'
vim.lua:291: in function <vim.lua:291>
Do I have to set anything else?
from nvim-treesitter.
Although the grammar name in grammar.js
is jdummy
,
after running nm jdummy.so
, I see no tree_sitter_jdummy
.
What am I missing?
...
0000000000004020 d __TMC_END__
00000000000017f9 T tree_sitter_json
0000000000002790 r ts_alias_sequences
00000000000027a0 r ts_field_map_entries
...
from nvim-treesitter.
Related Issues (20)
- Crash of PHP parser with free(): invalid pointer briefly displayed HOT 3
- ts_utils.swap_nodes can handle newlines better
- Opening multiple files with -p with nightly neovim has different tabstop & expandtab values on second tab HOT 2
- `Makefile` highlighting some values and arguments as text HOT 8
- Bug: vim.tbl_flatten is deprecated in latest Neovim HOT 4
- Issuing Installing tree-sitter for PowerShell in nvim HOT 2
- Error (freezes nvim) when opening markdown with code block name in different case (e.g. "Python", "JSON", "R"): `no such language: R` HOT 13
- `ocaml` and `ocaml_interface` could not be compiled on Windows HOT 20
- java query error with vim.lsp.buf.signature_help() HOT 1
- Treesitter crashes when opening a buffer HOT 14
- New `compat.flatten` replacement in-compatible HOT 8
- zig not working for treesitter build after update to neovim nightly and lazyvim rewrite HOT 8
- [Windows] Trouble Moving Generated .so on `TSInstall powershell` HOT 7
- :TSInstall not install parsers to parser_install_dir HOT 2
- Wrong indentation with elixir HOT 1
- Failed to load parser for language 'lua' : uv_dlopen : no error (on windows) HOT 19
- crash: segfault due to trying to free() an invalid pointer during TreeSitter HTML parsing HOT 1
- TreeSitter fails to load parser HOT 2
- Treesitter error when opening cpp file HOT 1
- Luau variables are highlighted as type
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.