Update generated neovim config
This commit is contained in:
@ -0,0 +1,61 @@
|
||||
;-------------------------------------------------------------------------------
|
||||
;
|
||||
; Maintainer: superzanti
|
||||
; Feature Reference: https://github.com/nvim-treesitter/nvim-treesitter-context
|
||||
;-------------------------------------------------------------------------------
|
||||
;
|
||||
[
|
||||
(block_comment)
|
||||
(architecture_definition)
|
||||
(architecture_head)
|
||||
(concurrent_block)
|
||||
(configuration_declaration)
|
||||
(component_instantiation_statement)
|
||||
(generic_map_aspect)
|
||||
(port_map_aspect)
|
||||
(process_statement)
|
||||
(process_head)
|
||||
(sequential_block)
|
||||
(block_configuration)
|
||||
(block_statement)
|
||||
(block_head)
|
||||
(component_declaration)
|
||||
(component_configuration)
|
||||
(generic_clause)
|
||||
(port_clause)
|
||||
(entity_declaration)
|
||||
(entity_head)
|
||||
(entity_body)
|
||||
(package_declaration)
|
||||
(package_definition)
|
||||
(function_specification)
|
||||
(subprogram_declaration)
|
||||
(subprogram_definition)
|
||||
(subprogram_head)
|
||||
(procedure_specification
|
||||
(identifier) @context.end)
|
||||
(sequential_block)
|
||||
(loop_statement)
|
||||
(if_statement
|
||||
(if_statement_body) @context.end)
|
||||
(elsif_statement
|
||||
(if_statement_body) @context.end)
|
||||
(else_statement
|
||||
(if_statement_body) @context.end)
|
||||
(case_statement)
|
||||
(case_statement_alternative)
|
||||
(for_generate_statement)
|
||||
(if_generate)
|
||||
(elsif_generate)
|
||||
(else_generate)
|
||||
(case_generate_statement)
|
||||
(case_generate_alternative)
|
||||
(type_declaration)
|
||||
] @context
|
||||
|
||||
; A nice to have, unfortunately, treesitter-context does not support the make-range function
|
||||
; https://github.com/nvim-treesitter/nvim-treesitter-context/issues/454
|
||||
; (_
|
||||
; (if_conditional_analysis) @_start @context.start @context.end
|
||||
; (end_conditional_analysis) @_end
|
||||
; (#make-range! "context" @_start @_end))
|
||||
@ -0,0 +1,59 @@
|
||||
;-------------------------------------------------------------------------------
|
||||
;
|
||||
; Maintainer: superzanti
|
||||
; Feature Reference: https://github.com/nvim-treesitter/nvim-treesitter?tab=readme-ov-file#folding
|
||||
;-------------------------------------------------------------------------------
|
||||
;
|
||||
[
|
||||
(block_comment)
|
||||
(architecture_definition)
|
||||
(architecture_head)
|
||||
(concurrent_block)
|
||||
(configuration_declaration)
|
||||
(component_instantiation_statement)
|
||||
(generic_map_aspect)
|
||||
(port_map_aspect)
|
||||
(process_statement)
|
||||
(process_head)
|
||||
(sequential_block)
|
||||
(block_configuration)
|
||||
(block_statement)
|
||||
(block_head)
|
||||
(component_declaration)
|
||||
(component_configuration)
|
||||
(generic_clause)
|
||||
(port_clause)
|
||||
(entity_declaration)
|
||||
(entity_head)
|
||||
(entity_body)
|
||||
(package_declaration)
|
||||
(package_definition)
|
||||
(function_specification)
|
||||
(subprogram_declaration)
|
||||
(subprogram_definition)
|
||||
(subprogram_head)
|
||||
(procedure_specification)
|
||||
(sequential_block)
|
||||
(loop_statement)
|
||||
(if_statement_block)
|
||||
(if_statement)
|
||||
(elsif_statement)
|
||||
(else_statement)
|
||||
(case_statement)
|
||||
(case_statement_alternative)
|
||||
(for_generate_statement)
|
||||
(if_generate_statement)
|
||||
(if_generate)
|
||||
(elsif_generate)
|
||||
(else_generate)
|
||||
(case_generate_statement)
|
||||
(case_generate_alternative)
|
||||
(type_declaration)
|
||||
] @fold
|
||||
|
||||
; A nice to have, unfortunately, treesitter-context does not support the make-range function
|
||||
; https://github.com/nvim-treesitter/nvim-treesitter-context/issues/454
|
||||
; (_
|
||||
; (if_conditional_analysis) @_start @context.start @context.end
|
||||
; (end_conditional_analysis) @_end
|
||||
; (#make-range! "context" @_start @_end))
|
||||
@ -0,0 +1,435 @@
|
||||
;-------------------------------------------------------------------------------
|
||||
;
|
||||
; Maintainer: jpt13653903
|
||||
; Capture Reference: https://neovim.io/doc/user/treesitter.html#treesitter-highlight-groups
|
||||
;-------------------------------------------------------------------------------
|
||||
;
|
||||
(line_comment
|
||||
(comment_content) @spell) @comment
|
||||
|
||||
(block_comment
|
||||
(comment_content) @spell) @comment.documentation
|
||||
|
||||
(identifier) @variable
|
||||
|
||||
[
|
||||
"access"
|
||||
"after"
|
||||
"alias"
|
||||
"architecture"
|
||||
"array"
|
||||
; "assume"
|
||||
"attribute"
|
||||
"block"
|
||||
"body"
|
||||
"component"
|
||||
"configuration"
|
||||
"context"
|
||||
; "cover"
|
||||
"disconnect"
|
||||
"entity"
|
||||
; "fairness"
|
||||
"file"
|
||||
"force"
|
||||
"generate"
|
||||
"generic"
|
||||
"group"
|
||||
"label"
|
||||
"literal"
|
||||
"map"
|
||||
"new"
|
||||
"package"
|
||||
"parameter"
|
||||
"port"
|
||||
"property"
|
||||
"range"
|
||||
"reject"
|
||||
"release"
|
||||
; "restrict"
|
||||
"sequence"
|
||||
"transport"
|
||||
"unaffected"
|
||||
"view"
|
||||
; "vmode"
|
||||
; "vpkg"
|
||||
; "vprop"
|
||||
"vunit"
|
||||
] @keyword
|
||||
|
||||
[
|
||||
(ALL)
|
||||
(OTHERS)
|
||||
"<>"
|
||||
(DEFAULT)
|
||||
(OPEN)
|
||||
] @constant.builtin
|
||||
|
||||
[
|
||||
"is"
|
||||
"begin"
|
||||
"end"
|
||||
] @keyword
|
||||
|
||||
(parameter_specification
|
||||
"in" @keyword)
|
||||
|
||||
[
|
||||
"process"
|
||||
"wait"
|
||||
"on"
|
||||
"until"
|
||||
] @keyword.coroutine
|
||||
|
||||
(end_process
|
||||
"end" @keyword.coroutine)
|
||||
|
||||
(timeout_clause
|
||||
"for" @keyword.coroutine)
|
||||
|
||||
[
|
||||
"function"
|
||||
"procedure"
|
||||
] @keyword.function
|
||||
|
||||
(subprogram_end
|
||||
"end" @keyword.function)
|
||||
|
||||
[
|
||||
"to"
|
||||
"downto"
|
||||
"of"
|
||||
] @keyword.operator
|
||||
|
||||
[
|
||||
"library"
|
||||
"use"
|
||||
] @keyword.import
|
||||
|
||||
[
|
||||
"subtype"
|
||||
"type"
|
||||
"record"
|
||||
"units"
|
||||
"constant"
|
||||
"signal"
|
||||
"variable"
|
||||
] @keyword.type
|
||||
|
||||
[
|
||||
"protected"
|
||||
"private"
|
||||
"pure"
|
||||
"impure"
|
||||
"inertial"
|
||||
"postponed"
|
||||
; "strong"
|
||||
"guarded"
|
||||
"out"
|
||||
"inout"
|
||||
"linkage"
|
||||
"buffer"
|
||||
"register"
|
||||
"bus"
|
||||
"shared"
|
||||
] @keyword.modifier
|
||||
|
||||
(mode
|
||||
"in" @keyword.modifier)
|
||||
|
||||
(force_mode
|
||||
"in" @keyword.modifier)
|
||||
|
||||
[
|
||||
"while"
|
||||
"loop"
|
||||
"next"
|
||||
"exit"
|
||||
] @keyword.repeat
|
||||
|
||||
(end_loop
|
||||
"end" @keyword.repeat)
|
||||
|
||||
(for_loop
|
||||
"for" @keyword.repeat)
|
||||
|
||||
(block_configuration
|
||||
"for" @keyword)
|
||||
|
||||
(configuration_specification
|
||||
"for" @keyword)
|
||||
|
||||
(component_configuration
|
||||
"for" @keyword)
|
||||
|
||||
(end_for
|
||||
"for" @keyword)
|
||||
|
||||
"return" @keyword.return
|
||||
|
||||
[
|
||||
"assert"
|
||||
"report"
|
||||
"severity"
|
||||
] @keyword.debug
|
||||
|
||||
[
|
||||
"if"
|
||||
"then"
|
||||
"elsif"
|
||||
"case"
|
||||
] @keyword.conditional
|
||||
|
||||
(end_if
|
||||
"end" @keyword.conditional)
|
||||
|
||||
(end_case
|
||||
"end" @keyword.conditional)
|
||||
|
||||
(when_element
|
||||
"when" @keyword.conditional)
|
||||
|
||||
(case_generate_alternative
|
||||
"when" @keyword.conditional)
|
||||
|
||||
(else_statement
|
||||
"else" @keyword.conditional)
|
||||
|
||||
(else_generate
|
||||
"else" @keyword.conditional)
|
||||
|
||||
[
|
||||
"with"
|
||||
"select"
|
||||
] @keyword.conditional.ternary
|
||||
|
||||
(when_expression
|
||||
"when" @keyword.conditional.ternary)
|
||||
|
||||
(else_expression
|
||||
"else" @keyword.conditional.ternary)
|
||||
|
||||
(else_waveform
|
||||
"else" @keyword.conditional.ternary)
|
||||
|
||||
(else_expression_or_unaffected
|
||||
"else" @keyword.conditional.ternary)
|
||||
|
||||
"null" @constant.builtin
|
||||
|
||||
(user_directive) @keyword.directive
|
||||
|
||||
(protect_directive) @keyword.directive
|
||||
|
||||
(warning_directive) @keyword.directive
|
||||
|
||||
(error_directive) @keyword.directive
|
||||
|
||||
(if_conditional_analysis
|
||||
"if" @keyword.directive)
|
||||
|
||||
(if_conditional_analysis
|
||||
"then" @keyword.directive)
|
||||
|
||||
(elsif_conditional_analysis
|
||||
"elsif" @keyword.directive)
|
||||
|
||||
(else_conditional_analysis
|
||||
"else" @keyword.directive)
|
||||
|
||||
(end_conditional_analysis
|
||||
"end" @keyword.directive)
|
||||
|
||||
(end_conditional_analysis
|
||||
"if" @keyword.directive)
|
||||
|
||||
(directive_body) @keyword.directive
|
||||
|
||||
(directive_constant_builtin) @constant.macro
|
||||
|
||||
(directive_error) @comment.error
|
||||
|
||||
(directive_protect) @keyword.directive
|
||||
|
||||
(directive_warning) @comment.warning
|
||||
|
||||
[
|
||||
(condition_conversion)
|
||||
(relational_operator)
|
||||
(sign)
|
||||
(adding_operator)
|
||||
(exponentiate)
|
||||
(variable_assignment)
|
||||
(signal_assignment)
|
||||
"*"
|
||||
"/"
|
||||
":"
|
||||
"=>"
|
||||
] @operator
|
||||
|
||||
[
|
||||
(unary_operator)
|
||||
(logical_operator)
|
||||
(shift_operator)
|
||||
"mod"
|
||||
"not"
|
||||
"rem"
|
||||
] @keyword.operator
|
||||
|
||||
[
|
||||
"'"
|
||||
","
|
||||
"."
|
||||
";"
|
||||
] @punctuation.delimiter
|
||||
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"["
|
||||
"]"
|
||||
"<<"
|
||||
">>"
|
||||
] @punctuation.bracket
|
||||
|
||||
"@" @punctuation.special
|
||||
|
||||
[
|
||||
(decimal_integer)
|
||||
(string_literal_std_logic)
|
||||
] @number
|
||||
|
||||
(decimal_float) @number.float
|
||||
|
||||
(bit_string_length) @property
|
||||
|
||||
(bit_string_base) @type.builtin
|
||||
|
||||
(bit_string_value) @number
|
||||
|
||||
(based_literal
|
||||
(based_base) @type.builtin
|
||||
(based_integer) @number)
|
||||
|
||||
(based_literal
|
||||
(based_base) @type.builtin
|
||||
(based_float) @number.float)
|
||||
|
||||
(string_literal) @string @spell
|
||||
|
||||
(character_literal) @character
|
||||
|
||||
(library_constant_std_logic) @constant.builtin
|
||||
|
||||
(library_constant) @constant.builtin
|
||||
|
||||
(library_function) @function.builtin
|
||||
|
||||
(library_constant_boolean) @boolean
|
||||
|
||||
(library_constant_character) @character
|
||||
|
||||
(library_constant_debug) @keyword.debug
|
||||
|
||||
(unit) @keyword.modifier
|
||||
|
||||
(library_constant_unit) @keyword.modifier
|
||||
|
||||
(label) @label
|
||||
|
||||
(generic_map_aspect
|
||||
"generic" @constructor
|
||||
"map" @constructor)
|
||||
|
||||
(port_map_aspect
|
||||
"port" @constructor
|
||||
"map" @constructor)
|
||||
|
||||
(selection
|
||||
(identifier) @variable.member)
|
||||
|
||||
(_
|
||||
view: (_) @type)
|
||||
|
||||
(_
|
||||
type: (_) @type)
|
||||
|
||||
(_
|
||||
library: (_) @module)
|
||||
|
||||
(_
|
||||
package: (_) @module)
|
||||
|
||||
(_
|
||||
entity: (_) @module)
|
||||
|
||||
(_
|
||||
component: (_) @module)
|
||||
|
||||
(_
|
||||
configuration: (_) @property)
|
||||
|
||||
(_
|
||||
architecture: (_) @property)
|
||||
|
||||
(_
|
||||
function: (_) @function)
|
||||
|
||||
(_
|
||||
procedure: (_) @function.method)
|
||||
|
||||
(_
|
||||
attribute: (_) @attribute)
|
||||
|
||||
(_
|
||||
constant: (_) @constant)
|
||||
|
||||
(_
|
||||
generic: (_) @variable.parameter)
|
||||
|
||||
(_
|
||||
view: (name
|
||||
(_)) @type)
|
||||
|
||||
(_
|
||||
type: (name
|
||||
(_)) @type)
|
||||
|
||||
(_
|
||||
entity: (name
|
||||
(_)) @module)
|
||||
|
||||
(_
|
||||
component: (name
|
||||
(_)) @module)
|
||||
|
||||
(_
|
||||
configuration: (name
|
||||
(_)) @module)
|
||||
|
||||
(library_type) @type.builtin
|
||||
|
||||
[
|
||||
(attribute_function)
|
||||
(attribute_impure_function)
|
||||
(attribute_mode_view)
|
||||
(attribute_pure_function)
|
||||
(attribute_range)
|
||||
(attribute_signal)
|
||||
(attribute_subtype)
|
||||
(attribute_type)
|
||||
(attribute_value)
|
||||
(library_attribute)
|
||||
] @attribute.builtin
|
||||
|
||||
(library_namespace) @module.builtin
|
||||
|
||||
(subtype_declaration
|
||||
(identifier) @type.definition)
|
||||
|
||||
(type_declaration
|
||||
(identifier) @type.definition)
|
||||
|
||||
(mode_view_declaration
|
||||
(identifier) @type.definition)
|
||||
|
||||
; (ERROR) @error
|
||||
@ -0,0 +1,14 @@
|
||||
;-------------------------------------------------------------------------------
|
||||
;
|
||||
; Maintainer: jpt13653903
|
||||
; Capture Reference: https://neovim.io/doc/user/treesitter.html#_treesitter-language-injections
|
||||
; Language Reference: https://github.com/stsewd/tree-sitter-comment
|
||||
;-------------------------------------------------------------------------------
|
||||
;
|
||||
(line_comment
|
||||
(comment_content) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
|
||||
(block_comment
|
||||
(comment_content) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
@ -0,0 +1,439 @@
|
||||
;-------------------------------------------------------------------------------
|
||||
;
|
||||
; Maintainer: superzanti
|
||||
; Feature Reference: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
|
||||
;-------------------------------------------------------------------------------
|
||||
;
|
||||
; Comments
|
||||
; Remove the two dashes for "inner"
|
||||
(line_comment
|
||||
(comment_content) @comment.inner) @comment.outer
|
||||
|
||||
(block_comment
|
||||
(comment_content) @comment.inner) @comment.outer
|
||||
|
||||
; Conditional constructs
|
||||
(if_statement_block
|
||||
(if_statement
|
||||
(if_statement_body) @_start @_end
|
||||
(_)? @_end .)
|
||||
(_)? @_end
|
||||
.
|
||||
(end_if)
|
||||
(#make-range! "conditional.inner" @_start @_end)) @conditional.outer
|
||||
|
||||
(if_statement
|
||||
(simple_expression) @_start
|
||||
(if_statement_body) @_end @conditional.inner
|
||||
(#make-range! "conditional.outer" @_start @_end)) @conditional.outer
|
||||
|
||||
(elsif_statement
|
||||
(if_statement_body) @conditional.inner) @conditional.outer
|
||||
|
||||
(else_statement
|
||||
(if_statement_body) @conditional.inner) @conditional.outer
|
||||
|
||||
(case_statement
|
||||
(case_body) @conditional.inner) @conditional.outer
|
||||
|
||||
(case_statement_alternative
|
||||
(when_element)
|
||||
.
|
||||
(_) @_start @_end
|
||||
(_)? @_end
|
||||
.
|
||||
(#make-range! "conditional.inner" @_start @_end)) @conditional.outer
|
||||
|
||||
; Class
|
||||
(architecture_definition
|
||||
(architecture_head
|
||||
"is"
|
||||
.
|
||||
(_) @_start)
|
||||
(_) @_end
|
||||
.
|
||||
(end_architecture)
|
||||
(#make-range! "class.inner" @_start @_end)) @class.outer
|
||||
|
||||
(architecture_definition
|
||||
(architecture_head)
|
||||
.
|
||||
(_) @_start @_end
|
||||
(_)? @_end
|
||||
.
|
||||
(end_architecture)
|
||||
(#make-range! "class.inner" @_start @_end)) @class.outer
|
||||
|
||||
(concurrent_block
|
||||
"begin"
|
||||
.
|
||||
(_) @_start @_end
|
||||
(_)? @_end
|
||||
.
|
||||
(#make-range! "class.inner" @_start @_end)) @class.outer
|
||||
|
||||
(entity_declaration
|
||||
(entity_head
|
||||
"is"
|
||||
.
|
||||
(_) @_start @_end
|
||||
(_)? @_end .)
|
||||
(_)? @_end
|
||||
.
|
||||
(end_entity)
|
||||
(#make-range! "class.inner" @_start @_end)) @class.outer
|
||||
|
||||
(entity_declaration
|
||||
(entity_head)
|
||||
.
|
||||
(_) @_start @_end
|
||||
(_)? @_end
|
||||
.
|
||||
(end_entity)
|
||||
(#make-range! "class.inner" @_start @_end)) @class.outer
|
||||
|
||||
(entity_body
|
||||
"begin"
|
||||
.
|
||||
(_) @_start @_end
|
||||
(_)? @_end
|
||||
.
|
||||
(#make-range! "class.inner" @_start @_end)) @class.outer
|
||||
|
||||
(process_statement
|
||||
(process_head
|
||||
"is"
|
||||
.
|
||||
(_) @_start @_end
|
||||
(_)? @_end
|
||||
.
|
||||
(#make-range! "class.inner" @_start @_end))) @class.outer
|
||||
|
||||
(process_statement
|
||||
(sequential_block
|
||||
"begin"
|
||||
.
|
||||
(_) @_start @_end
|
||||
(_)? @_end
|
||||
.
|
||||
(#make-range! "class.inner" @_start @_end))) @class.outer
|
||||
|
||||
(configuration_declaration
|
||||
(configuration_head)
|
||||
.
|
||||
(_) @_start @_end
|
||||
(_)? @_end
|
||||
.
|
||||
(end_configuration)
|
||||
(#make-range! "class.inner" @_start @_end)) @class.outer
|
||||
|
||||
(package_declaration
|
||||
(package_declaration_body
|
||||
"is"
|
||||
.
|
||||
(_) @_start @_end
|
||||
(_)? @_end
|
||||
.
|
||||
(#make-range! "class.inner" @_start @_end))) @class.outer
|
||||
|
||||
(package_definition
|
||||
(package_definition_body
|
||||
"is"
|
||||
.
|
||||
(_) @_start @_end
|
||||
(_)? @_end
|
||||
.
|
||||
(#make-range! "class.inner" @_start @_end))) @class.outer
|
||||
|
||||
; Blocks
|
||||
(component_instantiation_statement
|
||||
(instantiated_unit)
|
||||
.
|
||||
(_) @_start @_end
|
||||
(_)? @_end
|
||||
.
|
||||
";"? @_end
|
||||
.
|
||||
(#make-range! "block.inner" @_start @_end)) @block.outer
|
||||
|
||||
(block_statement
|
||||
(block_head) @block.inner) @block.outer
|
||||
|
||||
(block_statement
|
||||
(concurrent_block
|
||||
"begin"
|
||||
.
|
||||
(_) @_start @_end
|
||||
(_)? @_end
|
||||
.
|
||||
(#make-range! "block.inner" @_start @_end))) @block.outer
|
||||
|
||||
(component_declaration
|
||||
(component_body
|
||||
"is"
|
||||
.
|
||||
(_) @_start @_end
|
||||
(_)? @_end
|
||||
.
|
||||
(#make-range! "block.inner" @_start @_end))) @block.outer
|
||||
|
||||
(if_generate_statement
|
||||
(if_generate
|
||||
(generate_body
|
||||
"generate"
|
||||
(generate_block
|
||||
.
|
||||
(_) @_start @_end
|
||||
(_)? @_end .)))
|
||||
(_)? @_end
|
||||
.
|
||||
(end_generate)
|
||||
(#make-range! "block.inner" @_start @_end)) @block.outer
|
||||
|
||||
(if_generate
|
||||
(generate_body
|
||||
"generate"
|
||||
(generate_block
|
||||
.
|
||||
(_) @_start @_end
|
||||
(_)? @_end
|
||||
.
|
||||
(#make-range! "block.inner" @_start @_end)))) @block.outer
|
||||
|
||||
(elsif_generate
|
||||
(generate_body
|
||||
"generate"
|
||||
(generate_block
|
||||
.
|
||||
(_) @_start @_end
|
||||
(_)? @_end
|
||||
.
|
||||
(#make-range! "block.inner" @_start @_end)))) @block.outer
|
||||
|
||||
(else_generate
|
||||
(generate_body
|
||||
"generate"
|
||||
(generate_block
|
||||
.
|
||||
(_) @_start @_end
|
||||
(_)? @_end
|
||||
.
|
||||
(#make-range! "block.inner" @_start @_end)))) @block.outer
|
||||
|
||||
(for_generate_statement
|
||||
(generate_body
|
||||
"generate"
|
||||
(generate_block
|
||||
.
|
||||
(_) @_start @_end
|
||||
(_)? @_end
|
||||
.
|
||||
(#make-range! "block.inner" @_start @_end)))) @block.outer
|
||||
|
||||
(case_generate_statement
|
||||
"generate"
|
||||
(case_generate_block
|
||||
.
|
||||
(_) @_start @_end
|
||||
(_)? @_end
|
||||
.
|
||||
(#make-range! "block.inner" @_start @_end))) @block.outer
|
||||
|
||||
(case_generate_alternative
|
||||
(case_generate_body
|
||||
"=>"
|
||||
(generate_block
|
||||
.
|
||||
(_) @_start @_end
|
||||
(_)? @_end
|
||||
.
|
||||
";"? @_end
|
||||
.
|
||||
(#make-range! "block.inner" @_start @_end)))) @block.outer
|
||||
|
||||
; Loops
|
||||
(loop_statement
|
||||
(loop_body
|
||||
"loop"
|
||||
.
|
||||
(_) @_start @_end
|
||||
(_)? @_end
|
||||
.
|
||||
(#make-range! "loop.inner" @_start @_end))) @loop.outer
|
||||
|
||||
; Functions and Procedures
|
||||
(subprogram_definition
|
||||
(sequential_block
|
||||
"begin"
|
||||
.
|
||||
(_) @_start @_end
|
||||
(_)? @_end
|
||||
.
|
||||
(#make-range! "function.inner" @_start @_end))) @function.outer
|
||||
|
||||
(subprogram_declaration
|
||||
(function_specification
|
||||
(parameter_list_specification) @_start) @_end
|
||||
(#make-range! "call.inner" @_start @_end)) @call.outer
|
||||
|
||||
(procedure_call_statement
|
||||
(name
|
||||
(parenthesis_group
|
||||
(association_or_range_list) @call.inner))) @call.outer
|
||||
|
||||
; Parameters
|
||||
(generic_clause
|
||||
(interface_list) @parameter.inner) @parameter.outer
|
||||
|
||||
(port_clause
|
||||
(interface_list) @parameter.inner) @parameter.outer
|
||||
|
||||
(generic_map_aspect
|
||||
(association_list
|
||||
"("
|
||||
.
|
||||
(_) @_start @_end
|
||||
(_)? @_end
|
||||
.
|
||||
")"
|
||||
(#make-range! "parameter.inner" @_start @_end))) @parameter.outer
|
||||
|
||||
(port_map_aspect
|
||||
(association_list
|
||||
"("
|
||||
.
|
||||
(_) @_start @_end
|
||||
(_)? @_end
|
||||
.
|
||||
")"
|
||||
(#make-range! "parameter.inner" @_start @_end))) @parameter.outer
|
||||
|
||||
; Returns
|
||||
(_
|
||||
"return" @_start1
|
||||
.
|
||||
(_) @_start2 @_end2 @_end1
|
||||
(_)? @_end2 @_end1
|
||||
.
|
||||
";"? @_end1
|
||||
(#make-range! "return.inner" @_start2 @_end2)
|
||||
(#make-range! "return.outer" @_start1 @_end1))
|
||||
|
||||
; Numbers
|
||||
[
|
||||
(bit_string_value)
|
||||
(string_literal_std_logic)
|
||||
(library_constant_std_logic)
|
||||
(decimal_float)
|
||||
(decimal_integer)
|
||||
] @number.inner
|
||||
|
||||
; Attributes
|
||||
(signal_declaration
|
||||
(subtype_indication) @attribute.inner) @attribute.outer
|
||||
|
||||
(constant_declaration
|
||||
(subtype_indication) @attribute.inner) @attribute.outer
|
||||
|
||||
(variable_declaration
|
||||
(subtype_indication) @attribute.inner) @attribute.outer
|
||||
|
||||
(attribute_declaration
|
||||
(name) @attribute.inner) @attribute.outer
|
||||
|
||||
(attribute_specification
|
||||
(entity_specification) @attribute.inner) @attribute.outer
|
||||
|
||||
(interface_declaration
|
||||
(simple_mode_indication) @attribute.inner) @attribute.outer
|
||||
|
||||
(interface_signal_declaration
|
||||
(simple_mode_indication) @attribute.inner) @attribute.outer
|
||||
|
||||
(interface_constant_declaration
|
||||
(simple_mode_indication) @attribute.inner) @attribute.outer
|
||||
|
||||
(interface_variable_declaration
|
||||
(simple_mode_indication) @attribute.inner) @attribute.outer
|
||||
|
||||
(element_declaration
|
||||
(subtype_indication) @attribute.inner) @attribute.outer
|
||||
|
||||
; Assignments
|
||||
(simple_variable_assignment
|
||||
(name) @assignment.lhs
|
||||
(conditional_or_unaffected_expression) @assignment.rhs @assignment.inner) @assignment.outer
|
||||
|
||||
(simple_waveform_assignment
|
||||
(name) @assignment.lhs
|
||||
(waveform) @assignment.rhs @assignment.inner) @assignment.outer
|
||||
|
||||
; constant declaration, interface signal declaration, interface declaration
|
||||
(_
|
||||
(identifier_list) @assignment.lhs
|
||||
(_
|
||||
(subtype_indication) @assignment.rhs @assignment.inner
|
||||
(initialiser
|
||||
(conditional_expression) @assignment.rhs)?)) @assignment.outer
|
||||
|
||||
(concurrent_simple_signal_assignment
|
||||
(name) @assignment.lhs
|
||||
(waveform) @assignment.rhs @assignment.inner) @assignment.outer
|
||||
|
||||
(association_element
|
||||
(name) @assignment.lhs
|
||||
(conditional_expression) @assignment.rhs @assignment.inner) @assignment.outer
|
||||
|
||||
(element_association
|
||||
(_) @assignment.lhs
|
||||
(conditional_expression) @assignment.rhs @assignment.inner) @assignment.outer
|
||||
|
||||
(type_declaration
|
||||
(identifier) @assignment.lhs
|
||||
(enumeration_type_definition) @assignment.rhs @assignment.inner) @assignment.outer
|
||||
|
||||
(type_declaration
|
||||
(identifier) @assignment.lhs
|
||||
(record_type_definition
|
||||
.
|
||||
(_) @_start
|
||||
(_) @_end
|
||||
.
|
||||
(end_record)
|
||||
(#make-range! "assignment.inner" @_start @_end)) @assignment.rhs) @assignment.outer
|
||||
|
||||
; Attributes
|
||||
(attribute_declaration
|
||||
(identifier)
|
||||
(name) @attribute.inner) @attribute.outer
|
||||
|
||||
(attribute_specification
|
||||
(attribute_identifier)
|
||||
(entity_specification) @attribute.inner
|
||||
(conditional_expression)) @attribute.outer
|
||||
|
||||
; Scope names
|
||||
(package_declaration
|
||||
(identifier) @scopename.inner) @scopename.outer
|
||||
|
||||
(package_definition
|
||||
(identifier) @scopename.inner) @scopename.outer
|
||||
|
||||
(entity_declaration
|
||||
(identifier) @scopename.inner) @scopename.outer
|
||||
|
||||
(architecture_definition
|
||||
(identifier) @scopename.inner) @scopename.outer
|
||||
|
||||
(configuration_declaration
|
||||
(identifier) @scopename.inner) @scopename.outer
|
||||
|
||||
(library_clause
|
||||
(logical_name_list) @scopename.inner) @scopename.outer
|
||||
|
||||
(use_clause
|
||||
(selected_name_list
|
||||
(selected_name) @scopename.inner)) @scopename.outer
|
||||
|
||||
(component_instantiation_statement
|
||||
(instantiated_unit) @scopename.inner) @scopename.outer
|
||||
Reference in New Issue
Block a user