Skip to content

Conversation

@Ra77a3l3-jar
Copy link
Contributor

Summary

This PR adds tree-sitter grammar support for BASIC and FreeBASIC languages.

Changes

Testing

Tested with hx --health basic and hx --health freebasic:

  • ✅ Tree-sitter parser loads correctly
  • ✅ Highlight queries work
  • ✅ Indent queries work
  • ✅ Textobject queries work
  • ✅ Tags queries work

Ran tests as per contribution guidelines:

  • cargo test --workspace
  • cargo integration-test

Notes

  • Both languages share the .bas file extension but can be distinguished by content
  • FreeBASIC additionally supports .bi (include) files

@Ra77a3l3-jar Ra77a3l3-jar force-pushed the basic-freebasic-tree-sitter branch 2 times, most recently from b569590 to 34c04b7 Compare November 2, 2025 12:37
Comment on lines 2 to 5
variable: (identifier) @name.definition.variable)

(let_statement
variable: (identifier) @name.definition.variable)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
variable: (identifier) @name.definition.variable)
(let_statement
variable: (identifier) @name.definition.variable)
variable: (identifier) @definition.variable)
(let_statement
variable: (identifier) @definition.variable)

tags.scm queries should only have @definition.*, @reference.* and @name captures, the definition and name one can't be combined

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reviewing! I’ve pushed the requested update. Let me know if anything else needs to be changed.

Remove invalid node references from query files:
- basic: Remove while_statement, do_statement, function_definition, sub_definition, and if_statement (only for_statement is supported)
- freebasic: Remove if_statement (not used for indentation in this grammar)
FreeBASIC grammar supports multi-line IF...THEN...END IF blocks
that should be indented properly.
@Ra77a3l3-jar Ra77a3l3-jar force-pushed the basic-freebasic-tree-sitter branch from 3546f4a to f17989e Compare November 11, 2025 17:10
@the-mikedavis the-mikedavis merged commit 24b187a into helix-editor:master Nov 12, 2025
7 checks passed
alschena pushed a commit to alschena/helix that referenced this pull request Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants