chore: adjust for plugin-only scope after split
After splitting from the original scl_lsp repo, update for plugin-only scope: - README.md: focused on Neovim plugin installation, configuration, commands, keybindings, and editor features - AGENTS.md: plugin-only project structure and conventions - test/run_tests.lua: run only plugin tests (udt, db, fb, integration) - test/test_integration.lua: remove plc_json dependency (server module) - queries/: move from queries/*.scm to queries/scl/*.scm (nvim-treesitter per-language convention) - ftdetect/scl.vim: add filetype detection for .scl/.udt/.db files
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
; Folds for SCL code blocks
|
||||
|
||||
[
|
||||
(organization_block)
|
||||
(function_block)
|
||||
(var_declaration)
|
||||
(if_statement)
|
||||
(case_statement)
|
||||
(for_statement)
|
||||
(while_statement)
|
||||
(repeat_statement)
|
||||
(region_statement)
|
||||
(block_comment)
|
||||
] @fold
|
||||
@@ -0,0 +1,95 @@
|
||||
; SCL highlights
|
||||
|
||||
(line_comment) @comment
|
||||
(block_comment) @comment
|
||||
(c_style_comment) @comment
|
||||
|
||||
(number) @number
|
||||
(hex_number) @number
|
||||
(string) @string
|
||||
(time_value) @number
|
||||
|
||||
(prefix) @punctuation.special
|
||||
|
||||
(identifier) @variable
|
||||
|
||||
; FB instance calls - highlight instance name as type
|
||||
(fb_call
|
||||
instance: (prefixed_identifier
|
||||
(identifier) @type))
|
||||
(fb_call
|
||||
instance: (identifier) @type)
|
||||
|
||||
; FB parameter names (IN :=, PT :=, etc.)
|
||||
(fb_parameter
|
||||
name: (identifier) @property)
|
||||
|
||||
; Function call names
|
||||
(function_call
|
||||
(identifier) @function)
|
||||
|
||||
; Variable declarations
|
||||
(var_item
|
||||
name: (identifier) @variable)
|
||||
|
||||
; Type references in declarations
|
||||
(type
|
||||
(identifier) @type)
|
||||
|
||||
(type_builtin) @type.builtin
|
||||
|
||||
(keyword) @keyword
|
||||
(constant) @constant.builtin
|
||||
(operator) @operator
|
||||
|
||||
(assignment) @operator
|
||||
(binary_expression) @operator
|
||||
(unary_expression) @operator
|
||||
|
||||
(field_access
|
||||
"."
|
||||
(identifier) @property)
|
||||
|
||||
(array_access) @property
|
||||
|
||||
(attribute_list) @attribute
|
||||
(attribute) @attribute
|
||||
(attribute_value) @string
|
||||
|
||||
(var_item) @property
|
||||
|
||||
(function_call) @function.call
|
||||
(fb_call) @function.call
|
||||
|
||||
(if_statement) @conditional
|
||||
(elsif_clause) @conditional
|
||||
(else_clause) @conditional
|
||||
(case_statement) @conditional
|
||||
(case_item) @conditional
|
||||
|
||||
(for_statement) @repeat
|
||||
(while_statement) @repeat
|
||||
(repeat_statement) @repeat
|
||||
|
||||
";" @punctuation.delimiter
|
||||
":" @punctuation.delimiter
|
||||
"," @punctuation.delimiter
|
||||
"(" @punctuation.bracket
|
||||
")" @punctuation.bracket
|
||||
"[" @punctuation.bracket
|
||||
"]" @punctuation.bracket
|
||||
"." @punctuation.delimiter
|
||||
|
||||
":=" @operator
|
||||
"=>" @operator
|
||||
"=" @operator
|
||||
"<>" @operator
|
||||
"<" @operator
|
||||
">" @operator
|
||||
"<=" @operator
|
||||
">=" @operator
|
||||
|
||||
"+" @operator
|
||||
"-" @operator
|
||||
"*" @operator
|
||||
"/" @operator
|
||||
@@ -0,0 +1,41 @@
|
||||
; Indentation rules for SCL
|
||||
|
||||
; Indent after block keywords
|
||||
[
|
||||
(organization_block)
|
||||
(function_block)
|
||||
(var_declaration)
|
||||
(if_statement)
|
||||
(case_statement)
|
||||
(for_statement)
|
||||
(while_statement)
|
||||
(repeat_statement)
|
||||
(region_statement)
|
||||
] @indent.begin
|
||||
|
||||
; Indent after THEN, DO, etc.
|
||||
[
|
||||
"THEN"
|
||||
"DO"
|
||||
"ELSE"
|
||||
"ELSIF"
|
||||
] @indent.branch
|
||||
|
||||
; Outdent at end keywords
|
||||
[
|
||||
"END_VAR"
|
||||
"END_IF"
|
||||
"END_CASE"
|
||||
"END_FOR"
|
||||
"END_WHILE"
|
||||
"END_REPEAT"
|
||||
"END_REGION"
|
||||
"END_ORGANIZATION_BLOCK"
|
||||
"END_FUNCTION_BLOCK"
|
||||
] @indent.end
|
||||
|
||||
; Outdent for ELSE and ELSIF
|
||||
[
|
||||
"ELSE"
|
||||
"ELSIF"
|
||||
] @indent.dedent
|
||||
@@ -0,0 +1,15 @@
|
||||
; Local variable scoping for SCL - matches grammar.js structure
|
||||
|
||||
; Variable declarations define local variables
|
||||
(var_item
|
||||
name: (identifier) @definition.var)
|
||||
|
||||
; Variable sections create scopes
|
||||
(var_declaration) @local.scope
|
||||
|
||||
; Blocks create scopes
|
||||
(organization_block) @local.scope
|
||||
(function_block) @local.scope
|
||||
|
||||
; Identifiers are references
|
||||
(identifier) @reference
|
||||
@@ -0,0 +1,27 @@
|
||||
; Tag queries for SCL - matches grammar.js structure
|
||||
|
||||
; Organization blocks
|
||||
(organization_block
|
||||
name: (string) @name) @definition.function
|
||||
|
||||
; Function blocks
|
||||
(function_block
|
||||
name: (string) @name) @definition.function
|
||||
|
||||
; Variable definitions within blocks
|
||||
(var_item
|
||||
name: (identifier) @name
|
||||
type: (type) @type) @definition.variable
|
||||
|
||||
; Parameter definitions (inputs/outputs)
|
||||
(var_declaration
|
||||
(var_item
|
||||
name: (identifier) @name
|
||||
type: (type) @type)) @definition.variable
|
||||
|
||||
; Function calls (references)
|
||||
(function_call
|
||||
(identifier) @name) @reference.call
|
||||
|
||||
(function_call
|
||||
(string) @name) @reference.call
|
||||
Reference in New Issue
Block a user