Skip to content

Commit 858b8e9

Browse files
Merge pull request #7740 from microsoft/hanli/fixes-202307
Resolve issues found in end game
2 parents 367aef2 + c0f65be commit 858b8e9

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-bicep/src/main/resources/META-INF/azure-intellij-plugin-bicep.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,30 +28,30 @@
2828
id="org.wso2.lsp4intellij.contributors.LSPCompletionContributor" language="any"/>
2929
<!-- needed for completion as well as signature help -->
3030
<typedHandler implementation="org.wso2.lsp4intellij.listeners.LSPTypedHandler"
31-
id="LSPTypedHandler"/>
31+
id="Azure.LSPTypedHandler"/>
3232

3333
<!-- needed for code diagnostics -->
34-
<externalAnnotator id="LSPAnnotator" language="TEXT"
34+
<externalAnnotator id="Azure.LSPAnnotator" language="TEXT"
3535
implementationClass="org.wso2.lsp4intellij.contributors.annotator.LSPAnnotator"/>
3636

3737
<!-- needed for Workspace Symbols -->
3838
<gotoSymbolContributor implementation="org.wso2.lsp4intellij.contributors.symbol.LSPSymbolContributor"
39-
id="LSPSymbolContributor"/>
39+
id="Azure.LSPSymbolContributor"/>
4040

4141
<!-- needed for renaming -->
42-
<renameHandler implementation="org.wso2.lsp4intellij.contributors.rename.LSPRenameHandler" id="LSPRenameHandler" order="first"/>
43-
<renamePsiElementProcessor implementation="org.wso2.lsp4intellij.contributors.rename.LSPRenameProcessor" id="LSPRenameProcessor" order="first"/>
42+
<renameHandler implementation="org.wso2.lsp4intellij.contributors.rename.LSPRenameHandler" id="Azure.LSPRenameHandler" order="first"/>
43+
<renamePsiElementProcessor implementation="org.wso2.lsp4intellij.contributors.rename.LSPRenameProcessor" id="Azure.LSPRenameProcessor" order="first"/>
4444
</extensions>
4545

4646
<actions>
4747
<!-- needed for hover -->
4848
<action id="org.intellij.sdk.action.QuickDocAction" class="org.wso2.lsp4intellij.actions.LSPQuickDocAction" text="Show Quick Doc"/>
49-
<action class="org.wso2.lsp4intellij.actions.LSPGotoDeclarationAction" id="GotoDeclaration" use-shortcut-of="GotoDeclaration"
49+
<action class="org.wso2.lsp4intellij.actions.LSPGotoDeclarationAction" id="Azure.GotoDeclaration" use-shortcut-of="GotoDeclaration"
5050
overrides="true" text="Go to Declaration or Usages"/>
51-
<action class="org.wso2.lsp4intellij.actions.LSPReformatAction" id="ReformatCode" use-shortcut-of="ReformatCode"
51+
<action class="org.wso2.lsp4intellij.actions.LSPReformatAction" id="Azure.ReformatCode" use-shortcut-of="ReformatCode"
5252
overrides="true" text="Reformat Code" />
5353
<!-- needed for find references -->
54-
<action class="org.wso2.lsp4intellij.actions.LSPReferencesAction" id="LSPFindUsages" text="Find Usages">
54+
<action class="org.wso2.lsp4intellij.actions.LSPReferencesAction" id="Azure.LSPFindUsages" text="Find Usages">
5555
<keyboard-shortcut first-keystroke="shift alt F7" keymap="$default"/>
5656
</action>
5757
</actions>

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-monitor/src/main/java/com/microsoft/azure/toolkit/intellij/monitor/view/AzureMonitorView.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
import com.microsoft.azure.toolkit.lib.auth.AzureAccount;
2727
import com.microsoft.azure.toolkit.lib.common.bundle.AzureString;
2828
import com.microsoft.azure.toolkit.lib.common.event.AzureEventBus;
29+
import com.microsoft.azure.toolkit.lib.common.messager.AzureMessage;
30+
import com.microsoft.azure.toolkit.lib.common.messager.AzureMessager;
31+
import com.microsoft.azure.toolkit.lib.common.messager.IAzureMessager;
2932
import com.microsoft.azure.toolkit.lib.common.model.Subscription;
3033
import com.microsoft.azure.toolkit.lib.common.operation.AzureOperation;
3134
import com.microsoft.azure.toolkit.lib.common.task.AzureTaskManager;
@@ -69,15 +72,20 @@ public AzureMonitorView(Project project, @Nullable LogAnalyticsWorkspace logAnal
6972
this.updateWorkspaceNameLabel();
7073
Optional.ofNullable(this.selectedWorkspace).ifPresent(w -> PropertiesComponent.getInstance().setValue(AzureMonitorManager.AZURE_MONITOR_SELECTED_WORKSPACE, w.getId()));
7174
});
75+
final IAzureMessager messager = AzureMessager.getMessager();
7276
this.subscriptionChangeListener = new AzureEventBus.EventListener(e -> {
7377
LogAnalyticsWorkspace defaultWorkspace = null;
7478
final Account account = Azure.az(AzureAccount.class).account();
7579
if (Objects.nonNull(account) && account.getSelectedSubscriptions().size() > 0) {
7680
final Subscription subscription = account.getSelectedSubscriptions().get(0);
77-
final List<LogAnalyticsWorkspace> workspaceList = Azure.az(AzureLogAnalyticsWorkspace.class)
78-
.logAnalyticsWorkspaces(subscription.getId()).list().stream().toList();
79-
if (workspaceList.size() > 0) {
80-
defaultWorkspace = workspaceList.get(0);
81+
try {
82+
final List<LogAnalyticsWorkspace> workspaceList = Azure.az(AzureLogAnalyticsWorkspace.class)
83+
.logAnalyticsWorkspaces(subscription.getId()).list().stream().toList();
84+
if (workspaceList.size() > 0) {
85+
defaultWorkspace = workspaceList.get(0);
86+
}
87+
} catch (final Throwable t) {
88+
messager.error(t);
8189
}
8290
}
8391
this.selectedWorkspace = defaultWorkspace;

0 commit comments

Comments
 (0)