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

Target eap 5 #1019

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencies {
intellijPlatform {
rider(platformVersion, false)
jetbrainsRuntime()
bundledModule("intellij.libraries.microba")
bundledModules("intellij.libraries.microba", "intellij.json.split")
bundledPlugins(listOf("com.intellij.properties", "com.intellij.modules.json"))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ import javax.swing.Icon

class FunctionProjectSessionDebugProfile(
private val sessionId: String,
projectName: String,
projectPath: Path,
dotnetExecutable: DotNetExecutable,
private val dotnetRuntime: DotNetCoreRuntime,
private val sessionProcessEventListener: ProcessListener,
private val sessionProcessLifetime: Lifetime,
aspireHostProjectPath: Path?
) : ProjectSessionProfile(projectName, dotnetExecutable, aspireHostProjectPath), IRiderDebuggable {
) : ProjectSessionProfile(projectPath, dotnetExecutable, aspireHostProjectPath, true), IRiderDebuggable {

override fun getIcon(): Icon = IntelliJAzureIcons.getIcon(AzureIcons.FunctionApp.RUN)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* Copyright 2018-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the MIT license.
*/

@file:Suppress("UnstableApiUsage")

package com.microsoft.azure.toolkit.intellij.aspire

import com.intellij.execution.executors.DefaultDebugExecutor
Expand All @@ -19,6 +21,8 @@ import com.jetbrains.rd.util.lifetime.Lifetime
import com.jetbrains.rider.aspire.generated.CreateSessionRequest
import com.jetbrains.rider.aspire.run.AspireHostConfiguration
import com.jetbrains.rider.aspire.sessionHost.projectLaunchers.SessionProcessLauncherExtension
import com.jetbrains.rider.aspire.sessionHost.projectLaunchers.getAspireHostRunConfiguration
import com.jetbrains.rider.aspire.sessionHost.projectLaunchers.getDotNetRuntime
import com.jetbrains.rider.model.runnableProjectsModel
import com.jetbrains.rider.projectView.solution
import com.jetbrains.rider.runtime.DotNetExecutable
Expand All @@ -27,7 +31,6 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import java.nio.file.Path
import kotlin.io.path.Path
import kotlin.io.path.nameWithoutExtension

class FunctionProjectSessionProcessLauncher : SessionProcessLauncherExtension {
companion object {
Expand Down Expand Up @@ -64,12 +67,12 @@ class FunctionProjectSessionProcessLauncher : SessionProcessLauncherExtension {
) ?: return
val runtime = getDotNetRuntime(executable, project) ?: return

val projectName = Path(sessionModel.projectPath).nameWithoutExtension
val projectPath = Path(sessionModel.projectPath)
val aspireHostProjectPath = aspireHostRunConfig?.let { Path(it.parameters.projectFilePath) }

val profile = getRunProfile(
sessionId,
projectName,
projectPath,
executable,
runtime,
sessionProcessEventListener,
Expand Down Expand Up @@ -111,12 +114,12 @@ class FunctionProjectSessionProcessLauncher : SessionProcessLauncherExtension {
) ?: return
val runtime = getDotNetRuntime(executable, project) ?: return

val projectName = Path(sessionModel.projectPath).nameWithoutExtension
val projectPath = Path(sessionModel.projectPath)
val aspireHostProjectPath = aspireHostRunConfig?.let { Path(it.parameters.projectFilePath) }

val profile = getDebugProfile(
sessionId,
projectName,
projectPath,
executable,
runtime,
sessionProcessEventListener,
Expand Down Expand Up @@ -162,15 +165,15 @@ class FunctionProjectSessionProcessLauncher : SessionProcessLauncherExtension {

private fun getRunProfile(
sessionId: String,
projectName: String,
projectPath: Path,
dotnetExecutable: DotNetExecutable,
dotnetRuntime: DotNetCoreRuntime,
sessionProcessEventListener: ProcessListener,
sessionProcessLifetime: Lifetime,
aspireHostProjectPath: Path?
) = FunctionProjectSessionRunProfile(
sessionId,
projectName,
projectPath,
dotnetExecutable,
dotnetRuntime,
sessionProcessEventListener,
Expand All @@ -180,15 +183,15 @@ class FunctionProjectSessionProcessLauncher : SessionProcessLauncherExtension {

private fun getDebugProfile(
sessionId: String,
projectName: String,
projectPath: Path,
dotnetExecutable: DotNetExecutable,
dotnetRuntime: DotNetCoreRuntime,
sessionProcessEventListener: ProcessListener,
sessionProcessLifetime: Lifetime,
aspireHostProjectPath: Path?
) = FunctionProjectSessionDebugProfile(
sessionId,
projectName,
projectPath,
dotnetExecutable,
dotnetRuntime,
sessionProcessEventListener,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ import javax.swing.Icon

class FunctionProjectSessionRunProfile(
private val sessionId: String,
projectName: String,
projectPath: Path,
dotnetExecutable: DotNetExecutable,
private val dotnetRuntime: DotNetCoreRuntime,
private val sessionProcessEventListener: ProcessListener,
private val sessionProcessLifetime: Lifetime,
aspireHostProjectPath: Path?
) : ProjectSessionProfile(projectName, dotnetExecutable, aspireHostProjectPath) {
) : ProjectSessionProfile(projectPath, dotnetExecutable, aspireHostProjectPath, false) {

override fun getIcon(): Icon = IntelliJAzureIcons.getIcon(AzureIcons.FunctionApp.RUN)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ import com.intellij.openapi.project.Project
import com.intellij.util.io.systemIndependentPath
import com.jetbrains.rider.aspire.generated.CreateSessionRequest
import com.jetbrains.rider.aspire.run.AspireHostConfiguration
import com.jetbrains.rider.aspire.sessionHost.getLaunchProfile
import com.jetbrains.rider.aspire.sessionHost.mergeArguments
import com.jetbrains.rider.aspire.sessionHost.mergeEnvironmentVariables
import com.jetbrains.rider.aspire.settings.AspireSettings
import com.jetbrains.rider.aspire.util.MSBuildPropertyService
import com.jetbrains.rider.aspire.util.MSBuildPropertyService.ProjectRunProperties
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.microsoft.azure.toolkit.intellij.debugger.relay

import com.azure.core.credential.TokenRequestContext
import com.azure.identity.implementation.util.ScopeUtil
import com.intellij.openapi.progress.runBlockingCancellable
import com.intellij.platform.util.coroutines.childScope
import com.intellij.remote.RemoteCredentials
import com.intellij.remote.RemoteCredentialsHolder
Expand Down Expand Up @@ -64,7 +65,9 @@ abstract class RelayServer(protected val appServiceApp: AppServiceAppBase<*, *,

protected inner class SocketServer(hostName: String, port: Int = 0) {
private val selectorManager = ActorSelectorManager(Dispatchers.IO)
private val serverSocket = aSocket(selectorManager).tcp().bind(InetSocketAddress(hostName, port))
private val serverSocket: ServerSocket = runBlocking {
aSocket(selectorManager).tcp().bind(InetSocketAddress(hostName, port))
}

val port = (serverSocket.localAddress as InetSocketAddress).port

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ import kotlinx.coroutines.channels.ReceiveChannel
import kotlinx.coroutines.channels.SendChannel
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import kotlin.time.Duration.Companion.seconds

class WebSocketRelay(private val requestProvider: HttpRequestBuilder.() -> Unit) : Relay {
private val logger = logger<WebSocketRelay>()
private val client = HttpClient(CIO) {
install(WebSockets) {
pingInterval = 30000
pingInterval = 30.seconds
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import io.ktor.serialization.kotlinx.json.*
import io.ktor.utils.io.ByteReadChannel
import io.ktor.utils.io.core.isEmpty
import io.ktor.utils.io.core.readBytes
import io.ktor.utils.io.readRemaining
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pluginUntilBuild = 251.*
# Release: 2020.2
# EAP: 2020.3-EAP2-SNAPSHOT
# Nightly: 2020.3-SNAPSHOT
platformVersion = 2025.1-EAP3-SNAPSHOT
platformVersion = 2025.1-SNAPSHOT

dotnetBuildConfiguration=Release

Expand Down