From 40588da97ca5de8db025f96abb4c1efb03f590e9 Mon Sep 17 00:00:00 2001 From: Stephan Seitz Date: Wed, 6 Jan 2021 02:11:28 +0100 Subject: Remove usages of `@embedded` in highlights --- CONTRIBUTING.md | 25 +++++++++++++++---------- queries/c/highlights.scm | 1 - queries/javascript/highlights.scm | 2 +- queries/python/highlights.scm | 2 +- queries/ruby/highlights.scm | 4 ---- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 08d4237e5..e92ffc3b7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -96,16 +96,6 @@ effect on highlighting. We will work on improving highlighting in the near futur @punctuation.special for symbols with special meaning like `{}` in string interpolation. ``` -Some captures are related to language injection (like markdown code blocks). As this is not supported by neovim yet, these -are optional and will not have any effect for now. - -``` -@embedded -@injection -@injection.language -@injection.content -``` - #### Constants ``` @@ -245,3 +235,18 @@ You can define folds for a given language by adding a `folds.scm` query : If the `fold.scm` query is not present, this will fallback to the `@scope` captures in the `locals` query. + +### Injections + +Some captures are related to language injection (like markdown code blocks). They are used in `injections.scm`. +You can directly use the name of the language that you want to inject (e.g. `@html` to inject html). + +If you want to dynamically detect the language (e.g. for Markdown blocks) use the `@language` to capture +the node describing the language and `@content` to describe the injection region. + +``` +@{language} ; e.g. @html to describe a html region + +@language ; dynamic detection of the injection language (i.e. the text of the captured node describes the language) +@content ; region for the dynamically detected language +``` diff --git a/queries/c/highlights.scm b/queries/c/highlights.scm index c73405aca..a27c38135 100644 --- a/queries/c/highlights.scm +++ b/queries/c/highlights.scm @@ -117,7 +117,6 @@ (preproc_arg) (preproc_defined) ] @function.macro -; TODO (preproc_arg) @embedded (((field_expression (field_identifier) @property)) @_parent diff --git a/queries/javascript/highlights.scm b/queries/javascript/highlights.scm index 15d3361a5..09d172b6b 100644 --- a/queries/javascript/highlights.scm +++ b/queries/javascript/highlights.scm @@ -144,7 +144,7 @@ (template_substitution "${" @punctuation.special - "}" @punctuation.special) @embedded + "}" @punctuation.special) @none "..." @punctuation.special diff --git a/queries/python/highlights.scm b/queries/python/highlights.scm index 23ec979f0..2d845c4c0 100644 --- a/queries/python/highlights.scm +++ b/queries/python/highlights.scm @@ -204,7 +204,7 @@ (interpolation "{" @punctuation.special - "}" @punctuation.special) @embedded + "}" @punctuation.special) ["," "." ":" (ellipsis)] @punctuation.delimiter diff --git a/queries/ruby/highlights.scm b/queries/ruby/highlights.scm index 2fef97aa8..cef7fa767 100644 --- a/queries/ruby/highlights.scm +++ b/queries/ruby/highlights.scm @@ -153,10 +153,6 @@ (false) ] @boolean -(interpolation - "#{" @punctuation.special - "}" @punctuation.special) @embedded - (comment) @comment ; Operators -- cgit v1.2.3-70-g09d2