[DQL] Detecting DQL Expression files#132
Conversation
In cases where a DQL expression is written in a DQL file, the inspection will suggest renaming it into the `.dqlexpr` file.
There was a problem hiding this comment.
Pull request overview
This PR introduces detection of DQL expression files to help users properly categorize their DQL content. When a DQL file contains only expressions without valid command context, the inspection suggests renaming it to use the .dqlexpr extension. This enables proper parsing and validation of expression-only content.
Changes:
- Added a new
PotentialExpressionFileinspection that detects when DQL files contain expressions without valid query commands - Updated external validation and autocomplete features to skip
.dqlexprfiles since they don't contain full queries - Enhanced the
RenameFileQuickFixto support renaming files without starting a write action (allowing the rename processor to handle transactions)
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/resources/messages/DQLBundle.properties | Added message keys for the new inspection and updated the rename file message to be more generic |
| src/main/resources/inspectionDescriptions/DQLPotentialExpressionFile.html | Added HTML documentation describing the new inspection |
| src/main/resources/META-INF/plugin.xml | Registered the new PotentialExpressionFile inspection |
| src/main/java/pl/thedeem/intellij/dql/inspections/fixes/RenameFileQuickFix.java | Added startInWriteAction() override to prevent automatic write action wrapping |
| src/main/java/pl/thedeem/intellij/dql/inspections/external/DQLVerificationAnnotator.java | Updated to skip external validation for .dqlexpr files |
| src/main/java/pl/thedeem/intellij/dql/inspections/commands/PotentialExpressionFileInspection.java | New inspection implementation that detects potential expression files |
| src/main/java/pl/thedeem/intellij/dql/completion/DQLExternalCompletionContributor.java | Updated to skip Dynatrace autocomplete for .dqlexpr files |
| CHANGELOG.md | Added entry documenting the new quick fix for renaming to .dqlexpr |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...ain/java/pl/thedeem/intellij/dql/inspections/commands/PotentialExpressionFileInspection.java
Outdated
Show resolved
Hide resolved
...ain/java/pl/thedeem/intellij/dql/inspections/commands/PotentialExpressionFileInspection.java
Outdated
Show resolved
Hide resolved
src/main/resources/inspectionDescriptions/DQLPotentialExpressionFile.html
Outdated
Show resolved
Hide resolved
src/main/resources/inspectionDescriptions/DQLPotentialExpressionFile.html
Outdated
Show resolved
Hide resolved
...ain/java/pl/thedeem/intellij/dql/inspections/commands/PotentialExpressionFileInspection.java
Show resolved
Hide resolved
...ain/java/pl/thedeem/intellij/dql/inspections/commands/PotentialExpressionFileInspection.java
Show resolved
Hide resolved
Qodana for JVMIt seems all right 👌 No new problems were found according to the checks applied 💡 Qodana analysis was run in the pull request mode: only the changed files were checked View the detailed Qodana reportTo be able to view the detailed Qodana report, you can either:
To get - name: 'Qodana Scan'
uses: JetBrains/qodana-action@v2025.3.1
with:
upload-result: trueContact Qodana teamContact us at qodana-support@jetbrains.com
|
In cases where a DQL expression is written in a DQL file, the inspection will suggest renaming it into the
.dqlexprfile.