Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.intellij.psi.util.PsiTreeUtil;
import org.jetbrains.annotations.NotNull;
import pl.thedeem.intellij.dpl.style.DPLCodeStyleSettings;
import pl.thedeem.intellij.dql.DQLFileType;
import pl.thedeem.intellij.dql.psi.DQLElementFactory;
import pl.thedeem.intellij.dql.psi.DQLMultilineString;
import pl.thedeem.intellij.dql.psi.DQLTypes;
Expand All @@ -41,9 +42,14 @@ public class DQLPostFormatProcessor implements PostFormatProcessor {
public @NotNull TextRange processText(@NotNull PsiFile hostFile, @NotNull TextRange range, @NotNull CodeStyleSettings settings) {
Project project = hostFile.getProject();
DQLCodeStyleSettings dqlSettings = settings.getCustomSettings(DQLCodeStyleSettings.class);
final PsiDocumentManager documentManager = PsiDocumentManager.getInstance(project);
processInjectedHosts(hostFile, range, settings, documentManager, project, dqlSettings);

// Process only for DQL files or injected fragments
if (!hostFile.getFileType().equals(DQLFileType.INSTANCE)) {
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

The comment on line 46 states 'Process only for DQL files or injected fragments', but the guard returns early for non-DQL files, which would also skip processing injected DQL fragments in other file types. If injected fragments should still be processed, the validation logic needs to be adjusted to allow processing when DQL is injected into other file types.

Copilot uses AI. Check for mistakes.
return range;
}
processComments(hostFile, range, dqlSettings);
processInjectedHosts(hostFile, range, settings, project, dqlSettings);

return range;
}

Expand Down Expand Up @@ -87,12 +93,12 @@ private void processInjectedHosts(
@NotNull PsiFile hostFile,
@NotNull TextRange range,
@NotNull CodeStyleSettings settings,
@NotNull PsiDocumentManager documentManager,
@NotNull Project project,
@NotNull DQLCodeStyleSettings dqlSettings
) {
InjectedLanguageManager injector = InjectedLanguageManager.getInstance(project);
CodeStyleManager styleManager = CodeStyleManager.getInstance(project);
final PsiDocumentManager documentManager = PsiDocumentManager.getInstance(project);
final InjectedLanguageManager injector = InjectedLanguageManager.getInstance(project);
final CodeStyleManager styleManager = CodeStyleManager.getInstance(project);
Collection<PsiFile> injectedFiles = findInjectionHosts(hostFile, injector, range, settings);
if (injectedFiles.isEmpty()) {
return;
Expand Down
Loading