summaryrefslogtreecommitdiff
path: root/lua/nvim-treesitter/query.lua
AgeCommit message (Collapse)Author
2022-10-31feat(emmy): add emmylua annotationsLewis Russell
2022-09-12fix(fold): don't include whitespace end regionsLewis Russell
Some languages that are difficult to parse via Treesitter may incorrectly include whitespace lines at the end of regions. This can makes the calculated folds sub-optimal. To recitfy, use a custom directive (trim), to calculate the range with the trailing whitespace lines removed. Note this only works if the region end column is 0. Also added folds for Make.
2022-03-26chore: placate luacheckChristian Clason
2022-01-21feat(indent): use native Query:iter_capturesMunif Tanjim
2021-08-22Query: allow to pass a list to get_capture_matches (#1693)Santos Gallegos
2021-07-04Use stylua for autoformat code (#1480)Santos Gallegos
2021-06-29fix: check if invalidate_query_cache[lang] is set before invalidatingFolke Lemaitre
2021-06-28perf: cache has_query_files: fixes TS slownessFolke Lemaitre
2021-05-31Improve check-queries (#1253)Santos Gallegos
- Add checks for injections. - Allow queries that start with [A-Z] for highlights only. - Don't stop on the first error, finish checking all queries.
2021-04-14feat: Add TSEditQueryStephan Seitz
2021-04-07Fix usage of string.sub (#1164)Santos Gallegos
From https://www.lua.org/pil/20.html > The call string.sub(s,i,j) extracts a piece of the string s, from the i-th to the j-th character inclusive. This was breaking textobjects movement.
2021-04-06Fix: allow empty path in utils.get_at_pathStephan Seitz
2021-03-30refactor(all): language tree adaption (#1105)Steven Sojka
2021-03-23fix(checkhealth): display error messages of failed queriesStephan Seitz
2021-02-27chore: remove useless code and indent fileskiyan
2021-02-11fix: remove debug print on query cache invalidationStephan Seitz
The message does not even provide any context where it's coming from and what it is exactly doing and has to be acknowledged when printed in conjunction with the "wrote xxx bytes message"
2021-01-28feat(query): add cache for get_query (#879)oberblastmeister
* added cached to get_query * added reload function * fixed message * added autocommand to reload cache on bufwrite for query file * pass filename to autocommand v:lua fn * removed comment * added metatable * fixed loop * Update lua/nvim-treesitter/query.lua Co-authored-by: Thomas Vigouroux <tomvig38@gmail.com> * Update lua/nvim-treesitter/query.lua Co-authored-by: Thomas Vigouroux <tomvig38@gmail.com> * added do ... end to local query_cache * made line shorter Co-authored-by: Thomas Vigouroux <tomvig38@gmail.com>
2020-11-23fix: update interface following languagetree merge (#687)Thomas Vigouroux
2020-10-26Add virtual range for creating node-like objects from multiple nodesStephan Seitz
2020-10-19Remove textobjects from built_in_query_groupsStephan Seitz
2020-10-19Treesitter indentkiyan42
also fixes the memoize_by_buf_tick function
2020-10-16Fix: avoid overwriting tables in insert_to_pathStephan Seitz
The following query will result in matches with only one node though it requires two nodes to be a match. ```scheme (function_definition (comment) @function.inner.start body: (block) @function.inner) ``` Why? First `insert_to_path` is called for `@function.inner.start` which will result int the following table. ```lua { function = { inner = { start { node } } } } ``` `insert_to_path` will overwrite the result ```lua { function = { inner = { node } } } ``` Related #552
2020-10-12query: remove unnecessary query parsingThomas Vigouroux
2020-10-11feat(queries): modeline mechanism for base langsThomas Vigouroux
This implements https://github.com/neovim/neovim/pull/13059#issuecomment-704414189 This behaves like modelines and remove the use of the base_language map. Also, this allows to fine-tune what we actually want to include per query, which is better IMO.
2020-09-19feat: add parser for ocaml interface filesPau Ruiz Safont
The files have the mli extension. The parser grammar uses the name ocaml_interface, but since vim the underscore has a special meaning ocamlinterface is used as the filetype.
2020-09-14Folds: rename query files to folds.scm to be consistentSantos Gallegos
We use plural names for all query files except folds.
2020-09-08Fix #418: iterator function should always return an iteratorStephan Seitz
Even if it's an empty iterator.
2020-09-08Improve startup performanceSantos Gallegos
2020-09-08Queries: merge query_extensions into base_language_mapSantos Gallegos
These two are doing the same currently.
2020-09-07fix using highlight query extension for every query typekyazdani42
2020-09-01health: add fold queries to check healthThomas Vigouroux
2020-08-22fix(modules): do not reattach if already attachedSteven Sojka
2020-08-17Merge pull request #305 from theHamsta/textobjects-submodulesSteven Sojka
Textobjects submodules
2020-08-17some refacto, doc fixes and jsx querieskiyan42
- compute query language extensions *after* default ones (jsx after javascript) - remove outdated ts_utils functions from docs - add better regex detection to javascript - javascriptreact to use javascript queries - add javascript.jsx to javascript queries - write jsx.scm hl file
2020-08-17chore(textobject): use query.find_best_match to find next/previous textobjectStephan Seitz
2020-08-15fix: check 'after' against third directoryRafaƂ Camlet
2020-08-15Merge pull request #291 from vigoux/post-upstream-workSteven Sojka
fix: refactor after upstream refactor
2020-08-14feat: intuitive runtime queriesThomas Vigouroux
Starting now, runtime queries will be sourced in this order : - Queries that are not in any `after` folder, will serve as a base, with each occurence overwriting the others (that is, .config/nvim/queries has the highest priority) - Queries within the `after` directory will be sourced one after the other. The rationale is that this reminds all the `.vim` files (ftplugin) for example, and this allows both to experiment and to override queries easily.
2020-08-14fix: refactor after upstream refactorThomas Vigouroux
2020-08-13fix(definitions): optimize and fix definition highlightingSteven Sojka
2020-08-11fix(queries): don't load queries on startupSteven Sojka
2020-07-27Add predicates moduleStephan Seitz
2020-07-16Refactor locals.lua:Stephan Seitz
- shared query group stuff -> query.lua - local-specific stuff from ts_utils -> locals.lua
2020-07-15checkhealth for all query groupsStephan Seitz
2020-07-14Add textobjects moduleStephan Seitz
2020-06-30Define multiple query for a languagekiyan42
Allows using another query file for a language, or use a query file from another language
2020-06-30feat(refactor): add smart rename moduleSteven Sojka
2020-06-30feat(refactor): highlight usages moduleSteven Sojka
2020-06-21fix: separate queries with newlinesThomas Vigouroux
2020-06-20refactor: parser list and lang->ft/ft->langkiyan42
- move parser list in `parsers.lua` - most `ft` variable where changed to `lang`, `ft` is only used on autocmd binding, and lang is used for everything else. Functions have been defined to make the switch between `ft` and `lang`