Skip to content

Commit c60513e

Browse files
committed
Dependencies: update to IDEA 251.20015 EAP
1 parent fa4968d commit c60513e

File tree

6 files changed

+10
-21
lines changed

6 files changed

+10
-21
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ val powerShellEditorServices: Configuration by configurations.creating
6060

6161
dependencies {
6262
intellijPlatform {
63-
intellijIdeaCommunity(libs.versions.intellij)
63+
intellijIdeaCommunity(libs.versions.intellij, useInstaller = !libs.versions.intellij.get().contains("SNAPSHOT"))
6464
bundledPlugins("org.intellij.intelliLang", "org.jetbrains.plugins.terminal")
6565
bundledLibrary(provider {
6666
// TODO[#340]: This is a workaround, remove in intellij-platform-gradle-plugin 2.2.2

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[versions]
2-
intellij = "2024.3"
2+
intellij = "251.20015-EAP-CANDIDATE-SNAPSHOT"
33
intellijPreview = "251.20015-EAP-CANDIDATE-SNAPSHOT"
44
junixsocket = "2.10.1"
55
lsp4j = "0.24.0"

intellij-updater.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
"file": "gradle/libs.versions.toml",
44
"field": "intellij",
55
"kind": "intellij-idea-community",
6-
"versionFlavor": "release",
7-
"versionConstraint": "latestWave",
8-
"order": "oldest"
6+
"versionFlavor": "eap"
97
}, {
108
"file": "gradle/libs.versions.toml",
119
"field": "intellijPreview",

src/main/kotlin/com/intellij/plugin/powershell/lang/lsp/LSPInitMain.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import com.intellij.openapi.fileEditor.FileDocumentManager
1515
import com.intellij.openapi.project.Project
1616
import com.intellij.openapi.project.ProjectManager
1717
import com.intellij.openapi.project.ProjectManagerListener
18-
import com.intellij.openapi.vfs.VfsUtil
18+
import com.intellij.openapi.util.io.toNioPathOrNull
1919
import com.intellij.openapi.vfs.VirtualFile
2020
import com.intellij.plugin.powershell.PowerShellFileType
2121
import com.intellij.plugin.powershell.ide.PluginProjectRoot
@@ -24,7 +24,6 @@ import com.intellij.plugin.powershell.lang.lsp.languagehost.EditorServicesLangua
2424
import com.intellij.plugin.powershell.lang.lsp.languagehost.LanguageServerEndpoint
2525
import com.intellij.plugin.powershell.lang.lsp.languagehost.terminal.PowerShellConsoleTerminalRunner
2626
import com.intellij.plugin.powershell.lang.lsp.util.isRemotePath
27-
import java.io.File
2827
import java.util.concurrent.ConcurrentHashMap
2928

3029
@State(name = "PowerShellSettings", storages = [Storage(value = "powerShellSettings.xml", roamingType = RoamingType.DISABLED)])
@@ -115,7 +114,7 @@ class LSPInitMain : PersistentStateComponent<LSPInitMain.PowerShellInfo>, Dispos
115114
val vfile = FileDocumentManager.getInstance().getFile(editor.document) ?: return
116115
if (vfile.fileType !is PowerShellFileType) return
117116
val server = findServer(vfile, project) ?: return
118-
server.disconnectEditor(VfsUtil.toUri(File(vfile.path)))
117+
server.disconnectEditor(vfile.path.toNioPathOrNull()?.toUri() ?: return)
119118
LOG.debug("Removed ${vfile.name} script from server: $server")
120119
}
121120

src/main/kotlin/com/intellij/plugin/powershell/lang/lsp/languagehost/LanguageServerEndpoint.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import com.intellij.openapi.editor.Editor
1111
import com.intellij.openapi.fileEditor.FileDocumentManager
1212
import com.intellij.openapi.project.Project
1313
import com.intellij.openapi.util.Disposer
14+
import com.intellij.openapi.util.io.toNioPathOrNull
1415
import com.intellij.openapi.vfs.AsyncFileListener
1516
import com.intellij.openapi.vfs.VfsUtil
1617
import com.intellij.openapi.vfs.VirtualFileManager
@@ -38,7 +39,6 @@ import org.eclipse.lsp4j.jsonrpc.messages.Either
3839
import org.eclipse.lsp4j.launch.LSPLauncher
3940
import org.eclipse.lsp4j.services.LanguageServer
4041
import org.jetbrains.annotations.TestOnly
41-
import java.io.File
4242
import java.net.URI
4343
import java.nio.file.Path
4444
import java.nio.file.Paths
@@ -98,7 +98,7 @@ class LanguageServerEndpoint(
9898
return
9999
}
100100
val file = FileDocumentManager.getInstance().getFile(editor.document) ?: return
101-
val uri = VfsUtil.toUri(File(file.path))
101+
val uri = file.path.toNioPathOrNull()?.toUri() ?: return
102102
@Suppress("DeferredResultUnused")
103103
connectedEditors.computeIfAbsent(uri) {
104104
coroutineScope.async {

src/main/kotlin/com/intellij/plugin/powershell/lang/lsp/util/FileUtils.kt

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,13 @@ import com.intellij.openapi.fileEditor.FileDocumentManager
55
import com.intellij.openapi.fileEditor.FileEditorManager
66
import com.intellij.openapi.fileEditor.TextEditor
77
import com.intellij.openapi.project.Project
8-
import com.intellij.openapi.vfs.VfsUtil
8+
import com.intellij.openapi.util.io.toNioPathOrNull
99
import com.intellij.openapi.vfs.VirtualFile
1010
import com.intellij.plugin.powershell.ide.run.join
11-
import java.io.File
12-
import java.net.URI
13-
1411

1512
fun editorToURIString(editor: Editor): String? {
1613
val file = FileDocumentManager.getInstance().getFile(editor.document)?: return null
17-
return VfsUtil.toUri(File(file.path)).toString()
18-
}
19-
20-
fun editorToURI(editor: Editor): URI? {
21-
val file = FileDocumentManager.getInstance().getFile(editor.document)?: return null
22-
return VfsUtil.toUri(File(file.path))
14+
return file.path.toNioPathOrNull()?.toUri()?.toString()
2315
}
2416

2517
fun getTextEditor(file: VirtualFile, project: Project): Editor? {
@@ -28,4 +20,4 @@ fun getTextEditor(file: VirtualFile, project: Project): Editor? {
2820

2921
fun isRemotePath(docPath: String?) = docPath != null && docPath.contains(REMOTE_FILES_DIR_PREFIX)
3022

31-
private val REMOTE_FILES_DIR_PREFIX = join(System.getProperty("java.io.tmpdir"), "PSES-")
23+
private val REMOTE_FILES_DIR_PREFIX = join(System.getProperty("java.io.tmpdir"), "PSES-")

0 commit comments

Comments
 (0)