mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Node.JS Docker remote execution: in case of docker debug, change host that debugger listens to, to docker machine ip, also do not change debugger port to reported by docker local debug port
- debugging works now! refactor other node-docker code for clarity, create only 1 supporting image per project, cache its id in workspace.xml, keep Dockerfile for image under project (cherry picked from commit d026324)
This commit is contained in:
committed by
Alexander Koshevoy
parent
2533adc0f2
commit
f65687ef5e
@@ -39,6 +39,7 @@ import javax.swing.JList
|
||||
|
||||
abstract class RemoteVmConnection : VmConnection<Vm>() {
|
||||
var port = -1
|
||||
var isLocalAddress = true
|
||||
|
||||
private val connectCancelHandler = AtomicReference<() -> Unit>()
|
||||
|
||||
@@ -47,6 +48,7 @@ abstract class RemoteVmConnection : VmConnection<Vm>() {
|
||||
@JvmOverloads
|
||||
fun open(address: InetSocketAddress, stopCondition: Condition<Void>? = null): Promise<Vm> {
|
||||
port = address.port
|
||||
isLocalAddress = address.getAddress().isAnyLocalAddress() || address.getAddress().isLoopbackAddress()
|
||||
setState(ConnectionStatus.WAITING_FOR_CONNECTION, "Connecting to ${address.hostName}:${port}")
|
||||
val result = AsyncPromise<Vm>()
|
||||
val future = ApplicationManager.getApplication().executeOnPooledThread {
|
||||
|
||||
+2
-1
@@ -19,6 +19,7 @@ import com.intellij.execution.ExecutionException;
|
||||
import com.intellij.execution.ExecutionResult;
|
||||
import com.intellij.execution.configurations.RunConfiguration;
|
||||
import com.intellij.execution.configurations.RunProfile;
|
||||
import com.intellij.execution.configurations.RunProfileState;
|
||||
import com.intellij.execution.runners.ExecutionEnvironment;
|
||||
import com.intellij.util.net.NetUtils;
|
||||
import com.intellij.xdebugger.XDebugProcess;
|
||||
@@ -32,7 +33,7 @@ import java.net.InetSocketAddress;
|
||||
|
||||
public interface DebuggableRunConfiguration extends RunConfiguration {
|
||||
@NotNull
|
||||
default InetSocketAddress computeDebugAddress() throws ExecutionException {
|
||||
default InetSocketAddress computeDebugAddress(RunProfileState state) throws ExecutionException {
|
||||
try {
|
||||
return new InetSocketAddress(InetAddress.getLoopbackAddress(), NetUtils.findAvailableSocketPort());
|
||||
}
|
||||
|
||||
+1
-1
@@ -127,7 +127,7 @@ public abstract class RemoteDebugConfiguration extends LocatableConfigurationBas
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public InetSocketAddress computeDebugAddress() {
|
||||
public InetSocketAddress computeDebugAddress(RunProfileState state) {
|
||||
if (host == null) {
|
||||
return new InetSocketAddress(InetAddress.getLoopbackAddress(), port);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user