Skip to content

Commit

Permalink
Always use content roots to resolve references, as a workaround for #…
Browse files Browse the repository at this point in the history
  • Loading branch information
PHPirates committed Nov 13, 2024
1 parent 81c7f68 commit 7a0c782
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/nl/hannahsten/texifyidea/reference/InputFileReference.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ import nl.hannahsten.texifyidea.completion.pathcompletion.LatexGraphicsPathProvi
import nl.hannahsten.texifyidea.lang.commands.LatexGenericRegularCommand
import nl.hannahsten.texifyidea.psi.LatexCommands
import nl.hannahsten.texifyidea.psi.LatexPsiHelper
import nl.hannahsten.texifyidea.settings.sdk.LatexSdkUtil
import nl.hannahsten.texifyidea.util.*
import nl.hannahsten.texifyidea.util.expandCommandsOnce
import nl.hannahsten.texifyidea.util.files.*
import nl.hannahsten.texifyidea.util.getTexinputsPaths
import nl.hannahsten.texifyidea.util.includedPackages
import nl.hannahsten.texifyidea.util.isTestProject
import nl.hannahsten.texifyidea.util.magic.CommandMagic

/**
Expand Down Expand Up @@ -144,8 +146,8 @@ class InputFileReference(
}
}

// Try content roots
if (targetFile == null && LatexSdkUtil.isMiktexAvailable) {
// Try content roots, also for non-MiKTeX situations to allow using this as a workaround in case references can't be resolved the regular way
if (targetFile == null) {
for (moduleRoot in ProjectRootManager.getInstance(element.project).contentSourceRoots) {
targetFile = moduleRoot.findFile(processedKey, extensions, supportsAnyExtension)
if (targetFile != null) break
Expand Down

0 comments on commit 7a0c782

Please sign in to comment.