Skip to content

Feat various improvements#1

Merged
LordTermor merged 7 commits intomainfrom
feat-various-improvements
Dec 14, 2025
Merged

Feat various improvements#1
LordTermor merged 7 commits intomainfrom
feat-various-improvements

Conversation

@LordTermor
Copy link
Copy Markdown
Owner

Small features and fixes here and there

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for imperative JavaScript code in QML files, introduces syntax error diagnostics, and improves the completion provider's error handling. The changes follow the codebase's vertical architecture pattern by adding new classification rules for JavaScript contexts and a new diagnostics provider.

Key changes:

  • Added semantic token classification for JavaScript expressions (console.log, Math operations, ternary operators, etc.)
  • Introduced real-time syntax error diagnostics via tree-sitter parsing
  • Enhanced completion provider to avoid suggesting completions in broken syntax contexts

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test-workspace/ImportTest.qml Adds onClicked handler test case for button interaction
test-workspace/ImperativeTest.qml Comprehensive new test file covering JavaScript expressions, Math/console APIs, ternary operators, and imperative bindings
syntaxes/qml.tmLanguage.json Adds TextMate grammar patterns for operators (ternary, comparison, logical, arithmetic, bitwise) to improve syntax highlighting
src/providers/semanticTokens/tokenClassifier.ts Reorganizes rule application to prioritize QML rules, then imperative rules, with proper fallback chain
src/providers/semanticTokens/imperativeClassificationRules.ts New file implementing the Rules pattern for JavaScript context classification (builtins, member expressions, variables)
src/providers/semanticTokens/classificationRules.ts Refactors rules into qmlRules array and delegates JavaScript contexts to imperative rules
src/providers/semanticTokens/builtinTypes.ts Adds JavaScript global objects (console, Math, JSON, etc.) and their methods/properties for semantic classification
src/providers/diagnostics/syntaxDiagnosticsProvider.ts New provider implementing real-time syntax error detection and reporting using tree-sitter ERROR nodes
src/providers/completion/completionProvider.ts Adds error context detection to prevent completions when syntax is broken
src/indexer/shared/CacheValidator.ts Removes unused getFileModTime function
src/extension.ts Registers the new syntax diagnostics provider during extension activation

@LordTermor LordTermor force-pushed the feat-various-improvements branch from 8d5f709 to a252360 Compare December 14, 2025 16:32
@LordTermor LordTermor force-pushed the feat-various-improvements branch from 2f062fa to aa1fcba Compare December 14, 2025 18:31
@LordTermor LordTermor merged commit 125efaa into main Dec 14, 2025
1 check passed
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