summaryrefslogtreecommitdiff
path: root/lua/nvim-treesitter/query.lua
AgeCommit message (Collapse)Author
2020-06-15Fixup: Introduce base languages for queriesStephan Seitz
Use same argument for nvim_get_runtime_file for base language
2020-06-15Introduce base languages for queriesStephan Seitz
Some treesitter grammars just extend another treesitter grammar. This enables us to use the C queries also for C++. We only need to put additional queries in the C++ files.
2020-06-14feat(queries): allow for user overridesSteven Sojka
2020-05-12refacto/feat: better handling of parser updateskiyan42
features: - node_movement is moving between scopes. - add selection initialization from normal mode - add a decremental selection improvements: - attach to buffer to run tree parsing on change - run state update on CursorMoved - the buffer state is: ``` { cursor_pos = { row=row, col=col }, current_node = node_under_cursor, selection = { range = nil, -- activates when starting a selection nodes = {} -- filling up when starting an incremental selection }, parser = parser, -- parser for current buffer } ``` - refacto all the modules reliant on parsing the tree, update the current nodes, get the current nodes... fixes: - fix has_parser to look for .so libraries - fix should select the whole file when selection root in selection
2020-04-22feat: syntax highlightingThomas Vigouroux
2020-04-19fix(matches): better storage of nodesThomas Vigouroux
2020-04-19feat: add parsers module and better match iterThomas Vigouroux
The `parsers` module manages parsers for us, for now only in a really basic way. iter_prepared_mathes iters on an enhanced versions of the matches, where captures are directly accessible via their names to allow things like : ((itentifier) @def.first (identifier) @def.last) To be handled like this in lua: match.def.first match.def.last Also adds a `set!` predicate to allow setting data within the prepared match (see queries/lua/locals.scm) for examples.