Compare commits

...

9 Commits

Author SHA1 Message Date
may
f59dc9e48f mark arguments of case-lambda as variable, mark case-lambda as keyword (#14386) 2025-09-04 09:08:20 -05:00
Kristoffer Plagborg Bak Sørensen
d63c2d2fea feat: add runhaskell and stack as haskell shebangs (#14385) 2025-09-04 09:06:27 -05:00
Kristoffer Plagborg Bak Sørensen
0a4207be32 feat: detect .wslconfig as ini filetype (#14383) 2025-09-04 09:06:01 -05:00
Kristoffer Plagborg Bak Sørensen
3adc021c06 feat(ruby): detect .irbrc file as ruby (#14382) 2025-09-04 09:05:34 -05:00
Axlefublr
d1750a7502 fish injection query for nu, on nu -c (#14376) 2025-09-03 10:17:07 -05:00
dependabot[bot]
c5f0a4bc22 build(deps): bump the rust-dependencies group with 2 updates (#14373)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-03 08:16:33 -05:00
Kristoffer Plagborg Bak Sørensen
4967229e85 feat(ruby): inject bash into builtin ways of running system commands (#14372) 2025-09-02 17:51:42 -05:00
Nora Breitmoser-Widdecke
68f11f9324 language support for strictdoc (#14314) 2025-09-02 08:56:15 -05:00
Kristoffer Plagborg Bak Sørensen
af74a61ad4 feat(languages): detect more vim file-types (#14365) 2025-09-02 08:39:21 -05:00
10 changed files with 458 additions and 9 deletions

36
Cargo.lock generated
View File

@@ -138,10 +138,11 @@ checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53"
[[package]]
name = "cc"
version = "1.2.34"
version = "1.2.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42bc4aea80032b7bf409b0bc7ccad88853858911b7713a8062fdc0623867bedc"
checksum = "590f9024a68a8c40351881787f1934dc11afd69090f5edb6831464694d836ea3"
dependencies = [
"find-msvc-tools",
"shlex",
]
@@ -398,6 +399,12 @@ dependencies = [
"windows-sys 0.59.0",
]
[[package]]
name = "find-msvc-tools"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e178e4fba8a2726903f6ba98a6d221e76f9c12c650d5dc0e6afdc50677b49650"
[[package]]
name = "flate2"
version = "1.1.1"
@@ -421,6 +428,12 @@ version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
[[package]]
name = "foldhash"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"
[[package]]
name = "form_urlencoded"
version = "1.2.1"
@@ -1327,7 +1340,18 @@ checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
dependencies = [
"allocator-api2",
"equivalent",
"foldhash",
"foldhash 0.1.5",
]
[[package]]
name = "hashbrown"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d"
dependencies = [
"allocator-api2",
"equivalent",
"foldhash 0.2.0",
]
[[package]]
@@ -1349,7 +1373,7 @@ dependencies = [
"bitflags",
"chrono",
"encoding_rs",
"foldhash",
"foldhash 0.1.5",
"globset",
"helix-loader",
"helix-parsec",
@@ -1402,9 +1426,9 @@ name = "helix-event"
version = "25.7.1"
dependencies = [
"anyhow",
"foldhash",
"foldhash 0.1.5",
"futures-executor",
"hashbrown 0.15.5",
"hashbrown 0.16.0",
"log",
"once_cell",
"parking_lot",

View File

@@ -242,6 +242,7 @@
| sshclientconfig | ✓ | | | | | |
| starlark | ✓ | ✓ | ✓ | | ✓ | `starpls` |
| strace | ✓ | | | | | |
| strictdoc | ✓ | | | ✓ | | |
| supercollider | ✓ | | | | | |
| svelte | ✓ | | ✓ | | | `svelteserver` |
| sway | ✓ | ✓ | ✓ | | | `forc` |

View File

@@ -13,7 +13,7 @@ homepage.workspace = true
[dependencies]
foldhash.workspace = true
hashbrown = "0.15"
hashbrown = "0.16"
tokio = { version = "1", features = ["rt", "rt-multi-thread", "time", "sync", "parking_lot", "macros"] }
# the event registry is essentially read only but must be an rwlock so we can
# setup new events on initialization, hardware-lock-elision hugely benefits this case

View File

@@ -1091,6 +1091,7 @@ file-types = [
{ glob = "Scanfile" },
{ glob = "Snapfile" },
{ glob = "Gymfile" },
{ glob = ".irbrc" },
]
shebangs = ["ruby"]
comment-token = "#"
@@ -1521,6 +1522,7 @@ scope = "source.haskell"
injection-regex = "hs|haskell"
file-types = ["hs", "hs-boot", "hsc"]
roots = ["Setup.hs", "stack.yaml", "cabal.project"]
shebangs = ["runhaskell", "stack"]
comment-token = "--"
block-comment-tokens = { start = "{-", end = "-}" }
language-servers = [ "haskell-language-server" ]
@@ -3109,7 +3111,8 @@ file-types = [
{ glob = ".aws/config" },
"properties",
"cfg",
"directory"
"directory",
{ glob = ".wslconfig" },
]
injection-regex = "ini"
comment-token = "#"
@@ -4496,6 +4499,8 @@ indent = { tab-width = 4, unit = "\t" }
file-types = [
"vim",
{ glob = ".vimrc" },
{ glob = ".nvimrc" },
{ glob = ".exrc" }
]
[[language]]
@@ -4733,3 +4738,14 @@ comment-token = "#"
[[grammar]]
name = "shellcheckrc"
source = {git = "https://codeberg.org/kpbaks/tree-sitter-shellcheckrc", rev = "ad3da4e8f7fd72dcc5e93a6b89822c59a7cd10ff"}
[[grammar]]
name = "strictdoc"
source = { git = "https://github.com/manueldiagostino/tree-sitter-strictdoc", rev = "070edcf23f7c85af355437706048f73833e0ea10" }
[[language]]
name = "strictdoc"
scope = "source.strictdoc"
injection-regex = "strictdoc"
file-types = ["sdoc", "sgra"]
comment-token = ".."

View File

@@ -5,3 +5,10 @@
name: (word) @_command (#any-of? @_command "jq" "jaq")
argument: [(double_quote_string) (single_quote_string)] @injection.content
(#set! injection.language "jq"))
(command
name: (word) @_command (#eq? @_command "nu")
argument: (word) @_flag (#match? @_flag "^-.*c$")
argument: [(single_quote_string) (double_quote_string)] @injection.content
(#set! injection.language "nu")
)

View File

@@ -21,3 +21,15 @@
(#set! injection.language "erb"))
(#eq? @name "ERB"))
; `<command>`
; %x{<command>}
(subshell
(string_content) @injection.content
(#set! injection.language "bash"))
(call
method: (identifier) @_method (#any-of? @_method "system" "spawn" "exec")
arguments: (argument_list
(string
(string_content) @injection.content))
(#set! injection.language "bash"))

View File

@@ -48,6 +48,15 @@
(symbol) @variable)
(#any-of? @_f "lambda" "λ"))
(list
.
(symbol) @_f
(list
.
(list
(symbol) @variable))
(#eq? @_f "case-lambda"))
(list
.
(symbol) @_f
@@ -92,7 +101,7 @@
.
(symbol) @keyword
(#match? @keyword
"^(define-syntax|let\\*|lambda|λ|case|=>|quote-splicing|unquote-splicing|set!|let|letrec|letrec-syntax|let-values|let\\*-values|do|else|define|cond|syntax-rules|unquote|begin|quote|let-syntax|and|if|quasiquote|letrec|delay|or|when|unless|identifier-syntax|assert|library|export|import|rename|only|except|prefix)$"
"^(define-syntax|let\\*|lambda|λ|case-lambda|case|=>|quote-splicing|unquote-splicing|set!|let|letrec|letrec-syntax|let-values|let\\*-values|do|else|define|cond|syntax-rules|unquote|begin|quote|let-syntax|and|if|quasiquote|letrec|delay|or|when|unless|identifier-syntax|assert|library|export|import|rename|only|except|prefix)$"
))
(list

View File

@@ -0,0 +1,113 @@
;; Tree-sitter highlight queries for strictdoc
;; —————————————————————————————————————————
;; Keywords “blok” del documento
;; —————————————————————————————————————————
[
"[DOCUMENT]"
"[DOCUMENT_FROM_FILE]"
"[GRAMMAR]"
"[/SECTION]"
"[SECTION]"
(sdoc_node_opening)
(sdoc_composite_node_opening)
(sdoc_composite_node_closing)
(sdoc_composite_node_type_name)
] @keyword
[
"AUTO_LEVELS"
"CLASSIFICATION"
"DATE"
"DEFAULT_VIEW"
"ELEMENTS"
"ENABLE_MID"
"FIELDS"
"FILE"
"FORMAT"
"IMPORT_FROM_FILE"
"IS_COMPOSITE"
"LAYOUT"
"LEVEL"
"MARKUP"
"METADATA"
"MID"
"NAME"
"NODE_IN_TOC"
"OBJECT_TYPE"
"OPTIONS"
"PLACEMENT"
"PREFIX"
"PROPERTIES"
"REQ_PREFIX"
"REQUIRED"
"REQUIREMENT_IN_TOC"
"REQUIREMENT_STYLE"
"ROLE"
"ROOT"
"TAG"
"TITLE"
"TYPE"
"UID"
"VALUE"
"VERSION"
"VIEW_STYLE"
"VISIBLE_FIELDS"
] @type.builtin
;; Operators
[
(multiline_opening_token)
(multiline_closing_token)
] @operator
;; Punctuation
[
":" @punctuation.delimiter
"," @punctuation.delimiter
"-" @punctuation.delimiter
]
;; Boolean literals
(boolean_choice) @constant.builtin.boolean
;; Requirement types and file formats
;; Config option values
[
"Child"
"Default"
"File"
"HTML"
"Inline"
"Narrative"
"Off"
"On"
"Parent"
"Plain"
"RST"
"Simple"
"Table"
"Text"
"Website"
"Zebra"
] @constant.builtin
;; Strings
(single_line_string) @string
[ (uid_string) (req_reference_value_id) ] @string.special.symbol
(date) @string.special
;; Fields
(document_custom_metadata_key) @type.parameter
[ "RELATIONS" (field_name) ] @variable.other.member
(choice_option) @variable.parameter
;; Anchors and links
(anchor) @label
(inline_link) @string.special.url
[
(role_id)
] @variable

View File

@@ -0,0 +1,9 @@
((text_part) @injection.content
(#set! injection.language "rst")
(#set! injection.include-children))
((single_line_text_part) @injection.content
(#set! injection.language "rst")
(#set! injection.include-children))

View File

@@ -0,0 +1,258 @@
; == StrictDoc Code Navigation Queries ==
; -- Document Configuration Definitions --
(
(document_config
uid: (uid_string) @name) @definition.document.uid
)
(
(document_version
version: (single_line_string) @name) @definition.document.version
)
(
(document_date
date: (date) @name) @definition.document.date
)
(
(document_classification
classification: (single_line_string) @name) @definition.document.classification
)
(
(document_requirement
requirement_prefix: (single_line_string) @name) @definition.document.requirement_prefix
)
(
(document_config
root: (boolean_choice) @name) @definition.document.root
)
(
(document_config
options: (document_config_options) @name) @definition.document.options
)
(
(enable_mid
(boolean_choice) @name) @definition.document.options.enable_mid
)
(
(markup
(markup_choice) @name) @definition.document.options.markup
)
(
(auto_levels
(auto_levels_choice) @name) @definition.document.options.auto_levels
)
(
(layout
(layout_choice) @name) @definition.document.options.layout
)
(
(view_style
(style_choice) @name) @definition.document.options.view_style
)
(
(in_toc_tag
(boolean_choice) @name) @definition.document.options.in_toc_tag
)
(
(default_view
(single_line_string) @name) @definition.document.options.default_view
)
(
(document_config
metadata: (document_custom_metadata) @name) @definition.document.metadata
)
; -- Grammar Definition -- ( (document_grammar) @definition.grammar.document_grammar )
; -- Import From File Reference --
(
(import_from_file
import_path: (file_path) @name) @reference.grammar.file_path
)
; -- Grammar Elements Definitions --
(
(grammar_elements) @definition.grammar.elements
)
(
(grammar_element) @definition.grammar.element
)
; -- Grammar Properties Definitions --
(
(grammar_properties) @definition.grammar.properties
)
(
(grammar_property_is_composite
(boolean_choice) @name) @definition.grammar.property.is_composite
)
(
(grammar_property_prefix
(single_line_string) @name) @definition.grammar.property.prefix
)
(
(grammar_property_view_style
(style_choice) @name) @definition.grammar.property.view_style
)
; -- Grammar Fields Definitions --
(
(grammar_fields) @definition.grammar.fields
)
(
(grammar_field_title
title: (field_name) @name) @definition.grammar.field.title
)
(
(grammar_field_required
value: (boolean_choice) @name) @definition.grammar.field.required
)
(
(grammar_field_string) @definition.grammar.field.string
)
(
(grammar_field_single_choice) @definition.grammar.field.single_choice
)
(
(grammar_field_multiple_choice) @definition.grammar.field.multiple_choice
)
(
(grammar_field_tag) @definition.grammar.field.tag
)
; -- Grammar Relations Definitions --
(
(grammar_relations) @definition.grammar.relations
)
(
(grammar_relation_parent
(single_line_string) @name) @definition.grammar.relation.parent
)
(
(grammar_relation_child
(single_line_string) @name) @definition.grammar.relation.child
)
(
(grammar_relation_file
(single_line_string) @name) @definition.grammar.relation.file
)
; -- Document Custom Metadata --
(
(document_custom_metadata) @definition.document.metadata
)
(
(document_custom_metadata_key_value_pair
key: (document_custom_metadata_key) @name
value: (single_line_string) @doc) @definition.document.metadata.entry
)
; -- Document View Definitions --
(
(document_view) @definition.document.view
)
(
(view_element
id: (uid_string) @name) @definition.view.element.id
)
(
(view_element
name: (single_line_string) @name) @definition.view.element.name
)
(
(view_element_tag
object_type: (single_line_string) @name) @definition.view.element.tag.object_type
)
(
(view_element_field
name: (single_line_string) @name) @definition.view.element.field.name
)
(
(view_element_field
placement: (single_line_string) @name) @definition.view.element.field.placement
)
(
(view_element_hidden_tag
hidden_tag: (single_line_string) @name) @definition.view.element.hidden_tag
)
; -- Section & Requirement Definitions --
(
(section_or_requirement_list) @definition.section.list
)
(
(sdoc_section) @definition.section
)
(
(section_body
mid: (single_line_string) @name) @definition.section.mid
)
(
(section_body
uid: (uid_string) @name) @definition.section.uid
)
(
(section_body
custom_level: (single_line_string) @name) @definition.section.level
)
(
(section_body
title: (single_line_string) @name) @definition.section.title
)
(
(section_body
requirement_prefix: (single_line_string) @name) @definition.section.requirement_prefix
)
; -- Document From File Reference --
(
(document_from_file
path: (file_path) @name) @definition.document.from_file
)
; -- SDoc Node Definitions --
(
(sdoc_node) @definition.node
)
(
(sdoc_composite_node) @definition.composite_node
)
(
(sdoc_composite_node_opening
node_type_opening: (sdoc_composite_node_type_name) @name) @definition.composite_node.opening
)
(
(sdoc_composite_node_type_name) @definition.composite_node.type
)
; -- SDoc Node Field Definitions --
(
(sdoc_node_field_mid
mid: (single_line_string) @name) @definition.node.mid
)
(
(sdoc_node_field_uid
uid: (uid_string) @name) @definition.node.uid
)
(
(sdoc_node_field_generic
field_name: (field_name) @name
) @definition.node.field
)
(
(parent_req_reference
ref_uid: (req_reference_value_id) @name) @reference.node.uid
)
(
(child_req_reference
ref_uid: (req_reference_value_id) @name) @reference.node.uid
)