Skip to content

Commit fca48a3

Browse files
committed
feat: set composer ddev executor to be the standard
1 parent 131dbf4 commit fca48a3

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/main/java/de/php_perfect/intellij/ddev/php/PhpInterpreterProviderImpl.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import com.jetbrains.php.config.interpreters.PhpInterpretersPhpInfoCacheImpl;
1414
import com.jetbrains.php.config.phpInfo.PhpInfo;
1515
import com.jetbrains.php.config.phpInfo.PhpInfoUtil;
16-
import com.jetbrains.php.remote.composer.ComposerRemoteInterpreterExecution;
16+
import de.php_perfect.intellij.ddev.php.composer.DdevComposerExecution;
1717
import com.jetbrains.php.remote.docker.compose.PhpDockerComposeStartCommand;
1818
import com.jetbrains.php.remote.docker.compose.PhpDockerComposeTypeData;
1919
import com.jetbrains.php.remote.interpreter.PhpRemoteSdkAdditionalData;
@@ -26,7 +26,6 @@
2626
import org.jetbrains.annotations.NotNull;
2727

2828
import java.util.List;
29-
import java.util.Objects;
3029

3130
public final class PhpInterpreterProviderImpl implements PhpInterpreterProvider {
3231
private static final String LEGACY_INTERPRETER_NAME = "DDEV";
@@ -68,7 +67,7 @@ public void registerInterpreter(final @NotNull DdevInterpreterConfig interpreter
6867
this.updateInterpreter(interpreter, interpreterConfig);
6968
this.loadPhpInfo(interpreter);
7069
this.setDefaultIfNotSet(interpreter);
71-
this.updateComposerInterpreterIfNotSet(interpreter);
70+
this.updateComposerInterpreterIfNotSet();
7271
this.updateRemoteMapping(interpreter);
7372

7473
managedConfigurationIndex.set(interpreter.getId(), DdevInterpreterConfig.class, hash);
@@ -84,11 +83,11 @@ private void updateRemoteMapping(@NotNull PhpInterpreter interpreter) {
8483
RemoteMappingsManager.getInstance(project).setForServer(mappings);
8584
}
8685

87-
private void updateComposerInterpreterIfNotSet(@NotNull final PhpInterpreter interpreter) {
86+
private void updateComposerInterpreterIfNotSet() {
8887
final ComposerDataService composerSettings = ComposerDataService.getInstance(project);
8988

90-
if (!Objects.equals(composerSettings.getComposerExecution().getInterpreterId(), interpreter.getId())) {
91-
composerSettings.setComposerExecution(new ComposerRemoteInterpreterExecution(interpreter.getName(), "composer"));
89+
if (!(composerSettings.getComposerExecution() instanceof DdevComposerExecution)) {
90+
composerSettings.setComposerExecution(new DdevComposerExecution());
9291
}
9392
}
9493

0 commit comments

Comments
 (0)