From 116f54a71a22a8b781c56ab40cf9225b5d608166 Mon Sep 17 00:00:00 2001 From: UNV Date: Thu, 15 Oct 2026 11:09:50 +0300 Subject: [PATCH] Fixing compilation errors after platform update. --- .../extension/CSharpConfigurationPanel.java | 9 ++++--- .../CSharpPartialGotoDeclarationHandler.java | 26 +++++++++---------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/csharp-base-impl/src/main/java/consulo/csharp/base/module/extension/CSharpConfigurationPanel.java b/csharp-base-impl/src/main/java/consulo/csharp/base/module/extension/CSharpConfigurationPanel.java index f4e4ad3ee..be0f4d4fd 100644 --- a/csharp-base-impl/src/main/java/consulo/csharp/base/module/extension/CSharpConfigurationPanel.java +++ b/csharp-base-impl/src/main/java/consulo/csharp/base/module/extension/CSharpConfigurationPanel.java @@ -90,7 +90,7 @@ public static Component create(CSharpMutableModuleExtension ext, Disposable u compileLevelBox.addValueListener(event -> ext.setCompilerTarget(StringUtil.nullize(event.getValue(), true))); ComboBox platformBox = ComboBox.create(CSharpPlatform.values()); - platformBox.setRender((presentation, item) -> { + platformBox.setRenderer((presentation, item) -> { CSharpPlatform platform = item.getValue(); if (platform == null) { return; @@ -197,7 +197,7 @@ private static ComboBox createLanguageVersionBox(CSharpMutableModuleExte } ComboBox versionBox = ComboBox.create(items); - versionBox.setRender((presentation, item) -> { + versionBox.setRenderer((presentation, item) -> { Object value = item.getValue(); if (value instanceof CSharpLanguageVersion languageVersion) { presentation.append(languageVersion.getPresentableName()); @@ -265,8 +265,9 @@ private static BundleBox createCompilerBox(CSharpMutableModuleExtension ext, compilerBox.setSelectedBundle(customCompilerSdkPointer.getName()); } - compilerBox.getComponent().addValueListener(event -> - customCompilerSdkPointer.set(compilerBox.getSelectedModuleName(), compilerBox.getSelectedBundleName())); + compilerBox.getComponent().addValueListener( + event -> customCompilerSdkPointer.set(compilerBox.getSelectedModuleName(), compilerBox.getSelectedBundleName()) + ); return compilerBox; } } diff --git a/csharp-impl/src/main/java/consulo/csharp/impl/ide/navigation/CSharpPartialGotoDeclarationHandler.java b/csharp-impl/src/main/java/consulo/csharp/impl/ide/navigation/CSharpPartialGotoDeclarationHandler.java index df8fb0026..3d531c408 100644 --- a/csharp-impl/src/main/java/consulo/csharp/impl/ide/navigation/CSharpPartialGotoDeclarationHandler.java +++ b/csharp-impl/src/main/java/consulo/csharp/impl/ide/navigation/CSharpPartialGotoDeclarationHandler.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package consulo.csharp.impl.ide.navigation; +import consulo.annotation.access.RequiredReadAction; import consulo.annotation.component.ExtensionImpl; import consulo.codeEditor.Editor; import consulo.csharp.impl.ide.lineMarkerProvider.PartialTypeCollector; @@ -31,25 +31,23 @@ /** * @author VISTALL - * @since 02.05.2015 + * @since 2015-05-02 */ @ExtensionImpl public class CSharpPartialGotoDeclarationHandler implements GotoDeclarationHandlerEx { - @Nullable @Override - public PsiElement[] getGotoDeclarationTargets(PsiElement sourceElement, int offset, Editor editor) { + @RequiredReadAction + public PsiElement @Nullable [] getGotoDeclarationTargets(PsiElement sourceElement, int offset, Editor editor) { ASTNode node = sourceElement == null ? null : sourceElement.getNode(); if (node != null && node.getElementType() == CSharpTokens.IDENTIFIER) { - PsiElement parent = sourceElement.getParent(); - if (parent instanceof CSharpReferenceExpression) { - PsiElement resolvedElement = ((CSharpReferenceExpression) parent).resolve(); - if (resolvedElement instanceof CSharpCompositeTypeDeclaration) { - return ((CSharpCompositeTypeDeclaration) resolvedElement).getTypeDeclarations(); + if (sourceElement.getParent() instanceof CSharpReferenceExpression ref) { + PsiElement resolvedElement = ref.resolve(); + if (resolvedElement instanceof CSharpCompositeTypeDeclaration compositeTypeDecl) { + return compositeTypeDecl.getTypeDeclarations(); } - else if (resolvedElement instanceof CSharpLightConstructorDeclarationBuilder) { - PsiElement nextParent = resolvedElement.getParent(); - if (nextParent instanceof CSharpCompositeTypeDeclaration) { - return ((CSharpCompositeTypeDeclaration) nextParent).getTypeDeclarations(); + else if (resolvedElement instanceof CSharpLightConstructorDeclarationBuilder lightConstructorDeclBuilder) { + if (lightConstructorDeclBuilder.getParent() instanceof CSharpCompositeTypeDeclaration compositeTypeDecl) { + return compositeTypeDecl.getTypeDeclarations(); } } } @@ -58,7 +56,7 @@ else if (resolvedElement instanceof CSharpLightConstructorDeclarationBuilder) { } @Override - public PsiElementListCellRenderer createRender(PsiElement[] elements) { + public PsiElementListCellRenderer createRenderer(PsiElement[] elements) { return new PartialTypeCollector.OurRender(); } }