-
Notifications
You must be signed in to change notification settings - Fork 312
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(qsync): Enable basic syntax highlighting in 'analysis disabled' m…
…ode (#6941) * fix(qsync): Enable basic syntax highlighting in 'analysis disabled' mode * fix(qsync): Less configsing registry key * Fix xml tag in blaze-base.xml
- Loading branch information
Tomasz Pasternak
authored
Oct 29, 2024
1 parent
22a4474
commit 13b1799
Showing
3 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
base/src/com/google/idea/blaze/base/qsync/QuerySyncHighlightingSettingProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.google.idea.blaze.base.qsync; | ||
|
||
import com.google.idea.blaze.base.settings.Blaze; | ||
import com.google.idea.blaze.base.settings.BlazeImportSettings; | ||
import com.intellij.codeInsight.daemon.impl.analysis.DefaultHighlightingSettingProvider; | ||
import com.intellij.codeInsight.daemon.impl.analysis.FileHighlightingSetting; | ||
import com.intellij.openapi.project.Project; | ||
import com.intellij.openapi.vfs.VirtualFile; | ||
import com.intellij.psi.PsiManager; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public class QuerySyncHighlightingSettingProvider extends DefaultHighlightingSettingProvider { | ||
@Override | ||
public @Nullable FileHighlightingSetting getDefaultSetting(@NotNull Project project, @NotNull VirtualFile file) { | ||
var psiFile = PsiManager.getInstance(project).findFile(file); | ||
if (Blaze.getProjectType(psiFile.getProject()) == BlazeImportSettings.ProjectType.QUERY_SYNC) { | ||
if(!QuerySyncManager.getInstance(psiFile.getProject()).isReadyForAnalysis(psiFile)){ | ||
return FileHighlightingSetting.ESSENTIAL; | ||
} | ||
} | ||
return null; | ||
|
||
} | ||
} |