Commit graph

31 commits

Author SHA1 Message Date
Thomas Vigouroux
808765a6c8
fix: update interface following languagetree merge (#687) 2020-11-23 12:46:27 -06:00
Thomas Vigouroux
f7d92f663c feat(languagetree): implement language tree
Allow the LanguageTree to be used as an option for highlighting.

Co-authored-by: Santos Gallegos <stsewd@protonmail.com>
Co-authored-by: Yazdani Kiyan <yazdani.kiyan@protonmail.com>
2020-10-19 18:28:45 +02:00
Thomas Vigouroux
06452845d6 fix(highlights): use new highlighter interface 2020-10-13 09:25:09 +02:00
Thomas Vigouroux
2c8d401bb8 highlight: use new highlighter interface 2020-10-12 20:04:31 +02:00
Stephan Seitz
45397ebbd9 fix(highlights): Add TSNamespace highlight
Start adding highlights for
     - C++
     - Rust (including other scoped_identifier/scoped_type_identifier fixes)
     - JS (only namespace_import)

Addresses #516
2020-10-10 15:31:51 +02:00
Stephan Seitz
7e3c4f8089 Add @keyword.operator for operators that are English words and add @exception for Java/JS 2020-09-19 07:30:49 +02:00
Akin Sowemimo
3652bed53e Re-add attribute highlight 2020-09-18 21:30:13 +02:00
TravonteD
c366a041c8 Add TSTag and TSTagDelimiter groups
These groups will be added for use with xml-like tags such as html and
jsx.
2020-09-18 17:09:43 +02:00
kiyan42
71ba2afc70 add TSNone 2020-09-15 00:19:04 +02:00
Steven Sojka
3fe8bbcf9c fix(modules): do not reattach if already attached 2020-08-22 06:07:21 -05:00
Steven Sojka
579c9936d6 feat(highlights): add is predicate 2020-08-16 09:04:07 -05:00
Thomas Vigouroux
98b7515014 fix: refactor after upstream refactor 2020-08-14 15:00:13 +02:00
Thomas Vigouroux
5a7579c8f5 fix(highlight): Use TSParameter 2020-08-10 14:17:55 +02:00
Akin Sowemimo
1427c43cf0 Change capture groups and add variable highlights 2020-08-09 19:12:26 +02:00
Santos Gallegos
429036317a Lua: highlight function name 2020-08-09 18:38:00 +02:00
Santos Gallegos
6f01384cb2 Parsers: add reStructuredText 2020-07-27 09:16:26 +02:00
Akin Sowemimo
599bec3890 Rename attribute to annotation 2020-07-23 17:17:03 +02:00
Akin Sowemimo
ee83c3bd02 Add attribute to the highlight map 2020-07-23 17:17:03 +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
97ad374816 Fix #167: Add custom_captures config key to set highlights for custom queries 2020-07-13 22:04:24 +02:00
Thomas Vigouroux
282e18edd1 highlight: use custom highlight groups 2020-06-26 20:56:19 +02:00
Kiyan Yazdani
2c81ec3918
Merge pull request #90 from kyazdani42/fix/parser-names-as-filetypes
refacto/fix: filetype / parser name distinction
2020-06-21 17:32:37 +02:00
Jakub Łuczyński
0b4d4b4140 Updated python highlights
* allow for digits in constant names
* removed redundant/conflicting rules
* added missing hlmap
* fixed escape_sequence
* more explicit @constructor assignment
* added rules for function decoration identifiers
2020-06-21 00:11:58 +02:00
kiyan42
df17a48c85 refactor: parser list and lang->ft/ft->lang
- 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`
2020-06-20 12:31:52 +02:00
Stephan Seitz
f6bf56974e Introduce @include 2020-05-17 21:56:44 +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
5dc5695413 feat: support suggested highlights 2020-05-07 14:03:29 +02:00
kiyan42
62786ec7c6 feat/refacto: improve configurations
- You should now get the configs through functions
- Configs for languages are now inside a local object called parsers
- You can get the parser installation configurations with `get_parser_configs`
- A new object has been initialized inside configs to specify module config (called config).
- Provide functions to enable/disable a module on one buffer
- Provide functions to enable/disable a module on all buffers, and if filetype is
  specified, for specific filetype
- Provide function to determine if module is activated for a specified filetype
2020-04-24 22:15:21 +02:00
Thomas Vigouroux
f7424d23a1 highlight: retain highlighters with the buffers 2020-04-22 22:03:23 +02:00
Thomas Vigouroux
d05728e155 feat: syntax highlighting 2020-04-22 22:02:42 +02:00