diff options
| author | Amaan Qureshi <amaanq12@gmail.com> | 2023-04-25 13:09:18 -0400 |
|---|---|---|
| committer | Amaan Qureshi <amaanq12@gmail.com> | 2023-04-25 14:19:44 -0400 |
| commit | 82bcd8483e0b802bd5f639046c88aecfddbab508 (patch) | |
| tree | 807e64f62057905337c0b208c2e05f7da02862c9 /queries | |
| parent | injections(lua): tweak query to capture string content (#4707) (diff) | |
| download | nvim-treesitter-82bcd8483e0b802bd5f639046c88aecfddbab508.tar nvim-treesitter-82bcd8483e0b802bd5f639046c88aecfddbab508.tar.gz nvim-treesitter-82bcd8483e0b802bd5f639046c88aecfddbab508.tar.bz2 nvim-treesitter-82bcd8483e0b802bd5f639046c88aecfddbab508.tar.lz nvim-treesitter-82bcd8483e0b802bd5f639046c88aecfddbab508.tar.xz nvim-treesitter-82bcd8483e0b802bd5f639046c88aecfddbab508.tar.zst nvim-treesitter-82bcd8483e0b802bd5f639046c88aecfddbab508.zip | |
fix(solidity): variable should not match last, tidy up highlights
Diffstat (limited to 'queries')
| -rw-r--r-- | queries/solidity/highlights.scm | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/queries/solidity/highlights.scm b/queries/solidity/highlights.scm index 76a623267..717f11f7c 100644 --- a/queries/solidity/highlights.scm +++ b/queries/solidity/highlights.scm @@ -12,6 +12,8 @@ (solidity_version_comparison_operator) @operator +(solidity_version) @text.underline @string.special + ; Literals [ @@ -35,8 +37,17 @@ (yul_boolean) @boolean -; Type +; Variables + +[ + (identifier) + (yul_identifier) +] @variable + +; Types + (type_name (identifier) @type) +(type_name (user_defined_type (identifier) @type)) (type_name "mapping" @function.builtin) [ @@ -55,9 +66,9 @@ ; Functions and parameters (function_definition - name: (identifier) @function) + name: (identifier) @function) (modifier_definition - name: (identifier) @function) + name: (identifier) @function) (yul_evm_builtin) @function.builtin ; Use constructor coloring for special functions @@ -88,8 +99,8 @@ (struct_field_assignment name: (identifier) @field) (enum_value) @constant - ; Keywords + [ "contract" "interface" @@ -173,7 +184,8 @@ ] @include (import_directive "as" @include) (import_directive "from" @include) -(import_directive "*" @character.special) +((import_directive source: (string) @text.underline) + (#offset! @text.underline 0 1 0 -1)) ; Punctuation @@ -186,21 +198,13 @@ [ "." "," + ":" ; FIXME: update grammar ; (semicolon) "->" "=>" ] @punctuation.delimiter -(call_struct_argument - ":" @punctuation.delimiter) -(slice_access - ":" @punctuation.delimiter) -(struct_field_assignment - ":" @punctuation.delimiter) -(yul_label - ":" @punctuation.delimiter) - ; Operators [ @@ -218,6 +222,7 @@ "/" "%" "**" + "=" "<" "<=" "==" @@ -234,19 +239,12 @@ ":=" ] @operator -(yul_assignment - ":" @operator - "=" @operator) - [ "delete" "new" ] @keyword.operator -[ - (identifier) - (yul_identifier) -] @variable +(import_directive "*" @character.special) ; Comments |
