Skip to content

Commit 2503bc8

Browse files
connector dialog doesn't open after inserting properties in application.properties.
1 parent fed74ac commit 2503bc8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-resource-connector-lib-java/src/main/java/com/microsoft/azure/toolkit/intellij/connector/spring/SpringPropertiesCompletionContributor.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@ protected static class MyInsertHandler implements InsertHandler<LookupElement> {
7474
public void handleInsert(@Nonnull InsertionContext context, @Nonnull LookupElement lookupElement) {
7575
final Project project = context.getProject();
7676
final Module module = ModuleUtil.findModuleForFile(context.getFile().getVirtualFile(), project);
77-
Optional.ofNullable(module).map(AzureModule::from)
78-
.map(AzureModule::getDefaultProfile).map(Profile::getConnectionManager)
79-
.ifPresent(connectionManager -> connectionManager
80-
.getConnectionsByConsumerId(module.getName()).stream()
81-
.filter(c -> Objects.equals(definition, c.getResource().getDefinition())).findAny()
82-
.ifPresentOrElse(c -> this.insert(c, context), () -> this.createAndInsert(module, context)));
77+
AzureTaskManager.getInstance().write(() -> Optional.ofNullable(module).map(AzureModule::from)
78+
.map(AzureModule::initializeWithDefaultProfileIfNot).map(Profile::getConnectionManager)
79+
.ifPresent(connectionManager -> connectionManager
80+
.getConnectionsByConsumerId(module.getName()).stream()
81+
.filter(c -> Objects.equals(definition, c.getResource().getDefinition())).findAny()
82+
.ifPresentOrElse(c -> this.insert(c, context), () -> this.createAndInsert(module, context))));
8383
}
8484

8585
private void createAndInsert(Module module, @Nonnull InsertionContext context) {

0 commit comments

Comments
 (0)