File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/main/kotlin/com/github/biomejs/intellijbiome/lsp Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,9 @@ import com.github.biomejs.intellijbiome.settings.BiomeConfigurable
6
6
import com.github.biomejs.intellijbiome.settings.BiomeSettings
7
7
import com.intellij.execution.configurations.GeneralCommandLine
8
8
import com.intellij.execution.process.OSProcessHandler
9
+ import com.intellij.openapi.project.BaseProjectDirectories.Companion.getBaseDirectories
9
10
import com.intellij.openapi.project.Project
10
- import com.intellij.openapi.project.guessProjectDir
11
+ import com.intellij.openapi.vfs.VfsUtil
11
12
import com.intellij.openapi.vfs.VirtualFile
12
13
import com.intellij.platform.lsp.api.LspServer
13
14
import com.intellij.platform.lsp.api.LspServerDescriptor
@@ -31,7 +32,10 @@ import org.eclipse.lsp4j.ConfigurationItem
31
32
32
33
// Finds the root directory of a Biome workspace. It's typically the parent directory of `biome.json`.
33
34
// If no `biome.json` file found, nothing to do.
34
- val projectRootDir = project.guessProjectDir() ? : return
35
+ val projectRootDir = project
36
+ .getBaseDirectories()
37
+ .find { VfsUtil .isUnder(file, setOf (it)) } ? : return
38
+
35
39
val root = if (configPath.isNullOrEmpty()) {
36
40
file.findNearestBiomeConfig(projectRootDir)?.parent ? : return
37
41
} else {
You can’t perform that action at this time.
0 commit comments