Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix read action in RootFile #3898

Merged
merged 2 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Improve log parsing of 'undefined control sequence' error
* Fix a parsing issue when a verbatim command is followed by a space
* Make language injection id check case insensitive
* Fix exceptions #3843, #3853, #3852, #3846 and #3866
* Fix exceptions #3843, #3853, #3852, #3846, #3873, #3885 and #3866

## [0.10.0] - 2025-01-27

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package nl.hannahsten.texifyidea.index.file

import com.intellij.openapi.application.runInEdt
import com.intellij.openapi.application.runReadAction
import com.intellij.openapi.project.DumbService
import com.intellij.openapi.project.Project
import com.intellij.psi.search.GlobalSearchScope
Expand Down Expand Up @@ -42,8 +41,8 @@ object LatexExternalPackageInclusionCache {
runInEdt {
runInBackgroundBlocking(project, "Retrieving LaTeX package inclusions...") { indicator ->
try {
runReadAction { FileBasedIndex.getInstance().getAllKeys(LatexExternalPackageInclusionIndex.Cache.id, project) }.forEach { indexKey ->
runReadAction {
DumbService.getInstance(project).tryRunReadActionInSmartMode({ FileBasedIndex.getInstance().getAllKeys(LatexExternalPackageInclusionIndex.Cache.id, project) }, indicator.text)?.forEach { indexKey ->
DumbService.getInstance(project).tryRunReadActionInSmartMode({
FileBasedIndex.getInstance().processValues(
LatexExternalPackageInclusionIndex.Cache.id, indexKey, null, { file, _ ->
indicator.checkCanceled()
Expand All @@ -53,7 +52,7 @@ object LatexExternalPackageInclusionCache {
},
GlobalSearchScope.everythingScope(project)
)
}
}, indicator.text)
}

// Do some DFS for indirect inclusions
Expand Down
2 changes: 1 addition & 1 deletion src/nl/hannahsten/texifyidea/util/files/RootFile.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ suspend fun PsiFile.findRootFilesWithoutCache(fileset: Set<PsiFile>): Set<PsiFil

if (magicComment.contains(DefaultMagicKeys.ROOT)) {
val path = magicComment.value(DefaultMagicKeys.ROOT) ?: ""
this.findFile(path, supportsAnyExtension = true)?.let { roots.add(it) }
smartReadAction(project) { this.findFile(path, supportsAnyExtension = true) }?.let { roots.add(it) }
}

if (smartReadAction(project) { this.isRoot() }) {
Expand Down
Loading