Added support for DQLPart language#123
Conversation
The language is a better option than the DQL file name part as it is much easier to disable some parts of the language feature support when the file type is different.
There was a problem hiding this comment.
Pull request overview
Adds a dedicated DQLPart language/file type (.dqlpart) to better support DQL query fragments (e.g., for string injection / dynamic query building), and introduces migration tooling away from legacy *.partial.dql naming.
Changes:
- Register new
DQLPartlanguage + file type and reuse DQL lexer/parser/highlighting infrastructure for fragments. - Add an inspection + quick-fix to migrate
.partial.dqlsuffix usage to.dqlpart. - Update existing inspections/docs/changelog to reference the new
.dqlpartapproach.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/resources/messages/DQLBundle.properties | Adds new inspection messages and renames metric series migration keys |
| src/main/resources/inspectionDescriptions/DQLPartialFileMigration.html | Adds description for the new partial-file migration inspection |
| src/main/resources/META-INF/plugin.xml | Registers DQLPart file type/language and new inspection; updates metric-series inspection key |
| src/main/java/pl/thedeem/intellij/dqlpart/DQLPartParserDefinition.java | New parser definition for DQLPart using existing DQL lexer/parser |
| src/main/java/pl/thedeem/intellij/dqlpart/DQLPartLanguage.java | New language ID declaration for DQLPart |
| src/main/java/pl/thedeem/intellij/dqlpart/DQLPartFileType.java | New .dqlpart file type |
| src/main/java/pl/thedeem/intellij/dqlpart/DQLPartFile.java | PSI file implementation for DQLPart |
| src/main/java/pl/thedeem/intellij/dql/inspections/migrations/PartialFileMigrationInspection.java | New inspection to detect legacy .partial.dql files and offer rename |
| src/main/java/pl/thedeem/intellij/dql/inspections/migrations/MetricSeriesMigrationInspection.java | Updates message key reference after bundle rename |
| src/main/java/pl/thedeem/intellij/dql/inspections/fixes/ReplaceFetchWithMetricsQuickFix.java | Updates message key reference after bundle rename |
| src/main/java/pl/thedeem/intellij/dql/inspections/fixes/RenameFileQuickFix.java | Adds empty intention preview implementation |
| src/main/java/pl/thedeem/intellij/dql/inspections/commands/InvalidCommandContextInspection.java | Updates proposed partial filename logic to .dqlpart |
| src/main/java/pl/thedeem/intellij/dql/actions/ExecuteDQLQueryAction.java | Prevents executing partial files by detecting .dqlpart/partial naming |
| src/main/java/pl/thedeem/intellij/dql/DQLUtil.java | Updates partial-file detection to include DQLPart file type |
| docs/wiki/Home.md | Updates wiki links and adds DQL Part documentation entry |
| docs/wiki/DQL-Part.md | New documentation page for DQLPart usage |
| docs/wiki/DQL-Expression.md | Clarifies/structures usage section and code fence identifier |
| CHANGELOG.md | Documents new .dqlpart support and updated rename behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/main/java/pl/thedeem/intellij/dql/inspections/commands/InvalidCommandContextInspection.java
Show resolved
Hide resolved
...main/java/pl/thedeem/intellij/dql/inspections/migrations/PartialFileMigrationInspection.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
|
The language is a better option than the DQL file name part as it is much easier to disable some parts of the language feature support when the file type is different.
Also, it allows to specify that this is a partial file for IntelliJ annotations: