Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public static Component create(CSharpMutableModuleExtension<?> ext, Disposable u
compileLevelBox.addValueListener(event -> ext.setCompilerTarget(StringUtil.nullize(event.getValue(), true)));

ComboBox<CSharpPlatform> platformBox = ComboBox.create(CSharpPlatform.values());
platformBox.setRender((presentation, item) -> {
platformBox.setRenderer((presentation, item) -> {
CSharpPlatform platform = item.getValue();
if (platform == null) {
return;
Expand Down Expand Up @@ -197,7 +197,7 @@ private static ComboBox<Object> createLanguageVersionBox(CSharpMutableModuleExte
}

ComboBox<Object> 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());
Expand Down Expand Up @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
}
}
}
Expand All @@ -58,7 +56,7 @@ else if (resolvedElement instanceof CSharpLightConstructorDeclarationBuilder) {
}

@Override
public PsiElementListCellRenderer<PsiElement> createRender(PsiElement[] elements) {
public PsiElementListCellRenderer<PsiElement> createRenderer(PsiElement[] elements) {
return new PartialTypeCollector.OurRender();
}
}
Loading