Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ git2 = { version = "0.20.3", features = ["vendored-openssl"] }
tempfile = "3.24.0"
serde_json5 = "0.2.1"
tree-sitter-swift = "0.7.1"
tree-sitter-lua = "0.4.1"
glob = "0.3.3"
async-trait = "0.1.89"
sysinfo = "0.37.2"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ The difference: Codanna understands code structure. It knows `parseConfig` is a

**Performance:** Sub-10ms lookups, 75,000+ symbols/second parsing.

**Languages:** Rust, Python, JavaScript, TypeScript, Java, Kotlin, Go, PHP, C, C++, C#, Swift, GDScript.
**Languages:** Rust, Python, JavaScript, TypeScript, Java, Kotlin, Go, PHP, C, C++, C#, Lua, Swift, GDScript.

## Integration

Expand Down
2 changes: 2 additions & 0 deletions contributing/development/language-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Languages self-register via the modular registry system. Each language lives in
- **TypeScript** - Interfaces, type aliases, generics, inheritance tracking, TSX/JSX support
- **Java** - Classes, interfaces, enums, methods, fields, package-based modules with Maven integration
- **Kotlin** - Classes, objects, interfaces, data classes, companion objects, nested scopes
- **Lua** - Tables, metatables, functions, modules, colon-syntax methods
- **Python** - Classes, functions, type hints, inheritance
- **PHP** - Classes, traits, interfaces, namespaces
- **Go** - Structs, interfaces, methods, generics (1.18+), package visibility
Expand All @@ -34,6 +35,7 @@ All languages have custom resolution contexts with language-specific scoping:
| **Rust** | RustResolutionContext | Crate hierarchy | ✅ Traits | ✅ use statements |
| **Java** | JavaResolutionContext | Package hierarchy | ✅ Interfaces + Abstract | ✅ import + Maven pom.xml |
| **Kotlin** | KotlinResolutionContext | Package-based | ✅ Interfaces | ✅ import statements |
| **Lua** | LuaResolutionContext | Function/block scope | ✅ Metatables | ✅ require() |
| **Python** | PythonResolutionContext | LEGB scoping | ✅ Classes | ✅ import/from |
| **Go** | GoResolutionContext | Package-level | ✅ Interfaces (implicit) | ✅ go.mod imports |
| **PHP** | PhpResolutionContext | Namespace-based | ✅ Traits + Interfaces | ✅ use/namespace |
Expand Down
45 changes: 45 additions & 0 deletions contributing/parsers/lua/AUDIT_REPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Lua Parser Symbol Extraction Coverage Report

*Generated: 2026-01-25 22:44:47 UTC*

## Summary
- Key nodes: 21/21 (100%)
- Symbol kinds extracted: 6

> **Note:** Key nodes are symbol-producing constructs (functions, tables, imports).

## Coverage Table

| Node Type | ID | Status |
|-----------|-----|--------|
| chunk | 72 | ✅ implemented |
| function_declaration | 92 | ✅ implemented |
| function_definition | 110 | ✅ implemented |
| variable_declaration | 98 | ✅ implemented |
| assignment_statement | 77 | ✅ implemented |
| table_constructor | 122 | ✅ implemented |
| field | 125 | ✅ implemented |
| function_call | 118 | ✅ implemented |
| method_index_expression | 119 | ✅ implemented |
| dot_index_expression | 117 | ✅ implemented |
| bracket_index_expression | 116 | ✅ implemented |
| for_statement | 88 | ✅ implemented |
| for_generic_clause | 89 | ✅ implemented |
| for_numeric_clause | 90 | ✅ implemented |
| while_statement | 83 | ✅ implemented |
| repeat_statement | 84 | ✅ implemented |
| if_statement | 85 | ✅ implemented |
| do_statement | 82 | ✅ implemented |
| block | 73 | ✅ implemented |
| return_statement | 75 | ✅ implemented |
| comment | 128 | ✅ implemented |

## Legend

- ✅ **implemented**: Node type is recognized and handled by the parser
- ⚠️ **gap**: Node type exists in the grammar but not handled by parser (needs implementation)
- ❌ **not found**: Node type not present in the example file (may need better examples)

## Recommended Actions

✨ **Excellent coverage!** All key nodes are implemented.
98 changes: 98 additions & 0 deletions contributing/parsers/lua/GRAMMAR_ANALYSIS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Lua Grammar Analysis

*Generated: 2026-01-25 22:44:47 UTC*

## Statistics
- Total nodes in grammar JSON: 0
- Nodes found in comprehensive.lua: 75
- Nodes handled by parser: 75
- Symbol kinds extracted: 6

## Warning
Missing node-types.json for Lua (No such file or directory (os error 2)). Run `./contributing/tree-sitter/scripts/setup.sh lua` and copy tree-sitter-lua/src/node-types.json to contributing/parsers/lua/node-types.json.

## ✅ Successfully Handled Nodes
- "
- #
- (
- )
- *
- +
- ,
- -
- --
- .
- ..
- /
- :
- <=
- =
- ==
- >
- [
- ]
- and
- arguments
- assignment_statement
- binary_expression
- block
- bracket_index_expression
- chunk
- comment
- comment_content
- do
- do_statement
- dot_index_expression
- else
- else_statement
- elseif
- elseif_statement
- end
- expression_list
- false
- field
- for
- for_generic_clause
- for_numeric_clause
- for_statement
- function
- function_call
- function_declaration
- function_definition
- identifier
- if
- if_statement
- in
- local
- method_index_expression
- nil
- number
- or
- parameters
- repeat
- repeat_statement
- return
- return_statement
- string
- string_content
- table_constructor
- then
- true
- unary_expression
- until
- vararg_expression
- variable_declaration
- variable_list
- while
- while_statement
- {
- }

## 🎯 Symbol Kinds Extracted
- Constant
- Field
- Function
- Method
- Parameter
- Variable

52 changes: 52 additions & 0 deletions contributing/parsers/lua/node_discovery.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
=== Lua Language COMPREHENSIVE NODE MAPPING ===
Generated: 2026-01-25 22:44:47 UTC
ABI Version: 15
Node kind count: 75

== FUNCTION NODES ==
✓ function_declaration (ID: 92)
✓ function_definition (ID: 110)
✓ function_call (ID: 118)
✓ parameters (ID: 112)
✓ return_statement (ID: 75)

== VARIABLE NODES ==
✓ variable_declaration (ID: 98)
✓ assignment_statement (ID: 77)
✓ variable_list (ID: 78)
✓ expression_list (ID: 79)
✓ identifier (ID: 1)

== TABLE NODES ==
✓ table_constructor (ID: 122)
✓ field (ID: 125)
✓ dot_index_expression (ID: 117)
✓ bracket_index_expression (ID: 116)
✓ method_index_expression (ID: 119)

== CONTROL FLOW NODES ==
✓ if_statement (ID: 85)
✓ elseif_statement (ID: 86)
✓ else_statement (ID: 87)
✓ for_statement (ID: 88)
✗ for_in_statement (not found)
✓ while_statement (ID: 83)
✓ repeat_statement (ID: 84)
✓ do_statement (ID: 82)
✓ block (ID: 73)

== EXPRESSION NODES ==
✓ binary_expression (ID: 126)
✓ unary_expression (ID: 127)
✗ parenthesized_expression (not found)
✓ string (ID: 105)
✓ number (ID: 30)
✓ true (ID: 29)
✓ false (ID: 28)
✓ nil (ID: 27)

== COMMENT NODES ==
✓ comment (ID: 128)


Legend: ✓ = found in file, ○ = in grammar but not in file, ✗ = not in grammar
2 changes: 1 addition & 1 deletion contributing/tree-sitter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ The setup script configures tree-sitter and installs grammars on-demand:
./contributing/tree-sitter/scripts/setup.sh go
```

Supported languages: typescript, javascript, python, rust, go, php, c, cpp, csharp, java, kotlin, swift, gdscript
Supported languages: typescript, javascript, python, rust, go, php, c, cpp, csharp, java, kotlin, lua, swift, gdscript

## Available Scripts

Expand Down
2 changes: 1 addition & 1 deletion contributing/tree-sitter/scripts/check-grammar-updates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ PROJECT_ROOT="$(cd "$SCRIPT_DIR/../../.." && pwd)"
LOCKFILE="$PROJECT_ROOT/contributing/parsers/grammar-versions.lock"

# Supported languages
LANGUAGES="c cpp csharp gdscript go java javascript kotlin php python rust swift typescript"
LANGUAGES="c cpp csharp gdscript go java javascript kotlin lua php python rust swift typescript"

echo "🔍 Checking for grammar updates from remote..."
echo ""
Expand Down
5 changes: 3 additions & 2 deletions contributing/tree-sitter/scripts/compare-nodes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ -z "$INPUT" ]; then
echo " $0 <language> # Compare using comprehensive.* (with audit)"
echo " $0 <file> # Compare specific file (output to .log)"
echo ""
echo "Languages: typescript, javascript, python, rust, go, php, c, cpp, csharp, gdscript, java, kotlin"
echo "Languages: typescript, javascript, python, rust, go, php, c, cpp, csharp, gdscript, java, kotlin, lua"
exit 1
fi

Expand Down Expand Up @@ -163,9 +163,10 @@ else
gdscript) EXT="gd" ;;
java) EXT="java" ;;
kotlin) EXT="kt" ;;
lua) EXT="lua" ;;
*)
echo "❌ Unsupported language: $LANG"
echo "Supported: typescript, javascript, python, rust, go, php, c, cpp, csharp, gdscript, java, kotlin"
echo "Supported: typescript, javascript, python, rust, go, php, c, cpp, csharp, gdscript, java, kotlin, lua"
exit 1
;;
esac
Expand Down
3 changes: 2 additions & 1 deletion contributing/tree-sitter/scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ if [ -n "$LANG" ]; then
gdscript) REPO="https://github.com/PrestonKnopp/tree-sitter-gdscript" ;;
kotlin) REPO="https://github.com/bartolli/tree-sitter-kotlin" ;;
java) REPO="https://github.com/tree-sitter/tree-sitter-java" ;;
lua) REPO="https://github.com/tree-sitter-grammars/tree-sitter-lua" ;;
swift) REPO="https://github.com/alex-pinkus/tree-sitter-swift" ;;
*)
echo "❌ Unknown language: $LANG"
echo "Supported: typescript, javascript, python, rust, go, php, c, cpp, csharp, gdscript, kotlin, java, swift"
echo "Supported: typescript, javascript, python, rust, go, php, c, cpp, csharp, gdscript, kotlin, java, lua, swift"
exit 1
;;
esac
Expand Down
3 changes: 2 additions & 1 deletion contributing/tree-sitter/scripts/update-grammar-lock.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ get_repo_url() {
java) echo "https://github.com/tree-sitter/tree-sitter-java" ;;
javascript) echo "https://github.com/tree-sitter/tree-sitter-javascript" ;;
kotlin) echo "https://github.com/bartolli/tree-sitter-kotlin" ;;
lua) echo "https://github.com/tree-sitter-grammars/tree-sitter-lua" ;;
php) echo "https://github.com/tree-sitter/tree-sitter-php" ;;
python) echo "https://github.com/tree-sitter/tree-sitter-python" ;;
rust) echo "https://github.com/tree-sitter/tree-sitter-rust" ;;
Expand All @@ -27,7 +28,7 @@ get_repo_url() {
}

# Supported languages
LANGUAGES="c cpp csharp gdscript go java javascript kotlin php python rust swift typescript"
LANGUAGES="c cpp csharp gdscript go java javascript kotlin lua php python rust swift typescript"

echo "🔍 Checking grammar versions..."
echo ""
Expand Down
Loading