Commit graph

43 commits

Author SHA1 Message Date
Christian Clason
328ee3db54 fix(install): skip tier 4 parsers when installing and updating 2025-05-12 18:43:40 +02:00
Christian Clason
5817ff01b5 feat(locals)!: refactor locals.lua into standalone
Co-authored-by: TheLeoP <eugenio2305@hotmail.com>
2025-05-12 18:43:40 +02:00
Christian Clason
692b051b09 feat!: drop modules, general refactor and cleanup 2025-05-12 18:43:40 +02:00
Leftas
ce4adf11cf Fix find_usages 2024-01-25 19:24:18 +01:00
James Trew
cd4e090994 fix(locals): index matches with split capture names 2024-01-22 17:09:27 +01:00
Christian Clason
5b90ea2aba feat(locals)!: switch to upstream captures 2024-01-19 16:58:37 +01:00
Tom van Dijk
5c3e8dee64 fix: get_range shim for playground 2023-03-24 22:17:04 +00:00
Amaan Qureshi
853b1ab39a style: fill in missing code docs wherever applicable 2023-02-24 01:08:23 -08:00
Nir Tzachar
62fa8f77c4 adapt to vim.treesitter.query.get_node_text 2022-04-19 16:28:41 +02:00
Stephan Seitz
c3848e713a chore: deprecate ts_utils.get_node_text 2022-04-18 14:17:51 +02:00
Dundar Göc
6a4fdb317d chore: fix typos 2021-11-02 23:47:48 +01:00
Stephan Seitz
05380d700b Fix typo in locals.lua: vaild -> valid 2021-11-01 14:52:21 +01:00
mads kjeldgaard
d4c645c4d9
recurse_local_nodes: type check local_def to ensure it is a table (#1331) 2021-07-21 16:31:55 -05:00
Santos Gallegos
be8f656087
Use stylua for autoformat code (#1480) 2021-07-04 21:12:17 +00:00
Steven Sojka
6863f79118
refactor(all): language tree adaption (#1105) 2021-03-30 08:18:24 -05:00
kiyan
9d57216c0d chore: remove useless code and indent files 2021-02-27 13:36:33 +01:00
Thomas Vigouroux
808765a6c8
fix: update interface following languagetree merge (#687) 2020-11-23 12:46:27 -06:00
Thomas Vigouroux
6eca8d2f38 parser: only use parse to get a tree
This will avoid using internal data.
2020-11-03 21:16:51 +01:00
Steven Sojka
5d97cc5e09 fix(locals): add nil guard for definition id creation 2020-08-25 14:35:08 +02:00
Steven Sojka
7f7219b379 feat(definitions): allow setting of scope 2020-08-16 09:10:09 -05:00
Steven Sojka
282e33ad9c fix(definitions): optimize and fix definition highlighting 2020-08-13 07:43:09 -05:00
Steven Sojka
4f2689c501
fix(locals): fix find definition implementation (#274)
Co-authored-by: Thomas Vigouroux <39092278+vigoux@users.noreply.github.com>
2020-08-11 09:53:05 +02:00
Stephan Seitz
8cf2dc7f9a Refactor locals.lua:
- shared query group stuff -> query.lua
- local-specific stuff from ts_utils -> locals.lua
2020-07-16 09:34:31 +02:00
Stephan Seitz
a4e2692c7b Refactor: Add parsers.get_buf_lang 2020-07-16 09:34:31 +02:00
Stephan Seitz
b480d25155 feat(textobjects): Add start to include preceding things like documentation 2020-07-15 20:12:52 +02:00
Steven Sojka
26b3b3311e fix(refactor): highlight def perf issue fix 2020-07-08 09:55:12 +02:00
Stephan Seitz
ab1916f385 Allow arbitrary query files in locals.lua
This is a preparation for `textobject` queries.
2020-07-05 21:32:20 +02:00
Stephan Seitz
5642507f6a Make luacheck happy 2020-07-05 19:21:06 +02:00
Steven Sojka
d73500eaa6 refactor(refactor): use higher local apis and some cleanup 2020-06-30 08:21:01 +02:00
Steven Sojka
058e8d2296 feat(refactor): highlight usages module 2020-06-30 08:21:01 +02:00
Steven Sojka
d04a833e20 fix(locals): compute locals after later tick 2020-06-24 15:38:00 +02:00
kiyan42
def8c20dd7 rename and finish ft->lang migration 2020-06-22 13:22:30 +02:00
kiyan42
38af29a912 refacto: remove buf_state
- remove buf_state and related code
- add get_node_at_cursor()
- better incremental selection (code is localized)
2020-06-19 13:45:33 +02:00
kiyan42
45dcebb15f refacto/feat: better handling of parser updates
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-05-12 16:16:48 +02:00
Thomas Vigouroux
824b063d0d fix: change locals extraction 2020-05-07 14:03:29 +02:00
Thomas Vigouroux
ce690e550d health(refactor): move checks inside health.lua 2020-04-26 15:38:32 +02:00
Thomas Vigouroux
78b40f895c textobj: add incremental node selection 2020-04-25 21:46:22 +02:00
kiyan42
698453e50c feat: add checkhealth 2020-04-21 13:38:16 +02:00
Thomas Vigouroux
d25549917d perf: don't compute locals on buffer updates
Instead we lazily evaluate them on request.
This allow two things :
    * better performances
    * being sure the locas are up to date
2020-04-19 20:16:03 +02:00
Thomas Vigouroux
d169c0614c fix: prepare injections mechanism 2020-04-19 17:55:38 +02:00
Thomas Vigouroux
5783e7d248 style: avoid overindenting things 2020-04-19 17:31:00 +02:00
Thomas Vigouroux
b2b6e51a7c feat: add locals to setup procedure 2020-04-19 17:28:59 +02:00
Thomas Vigouroux
b706c4e8ed feat: first version of locals
Locals will be the main interface to treesitter, through some functions:
    get_definitions(bufnr) : returns all the definitions in bufnr
    get_scopes(bufnr): returns all definitions in bufnr
    get_references(bufnr): returns all references in bufnr
2020-04-19 17:28:52 +02:00