Skip to content

Commit aae93f0

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 584764a + 530d6c1 commit aae93f0

10 files changed

Lines changed: 66 additions & 75 deletions

File tree

csharp-impl/src/main/java/consulo/csharp/impl/ide/codeInsight/actions/CastExpressionToTypeRef.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public CastExpressionToTypeRef(@Nonnull DotNetExpression expression, @Nonnull Do
5555
public LocalizeValue getText() {
5656
DotNetExpression element = myExpressionPointer.getElement();
5757
if (element == null) {
58-
return LocalizeValue.of();
58+
return LocalizeValue.empty();
5959
}
6060
return CSharpErrorLocalize.castTo0Fix(CSharpTypeRefPresentationUtil.buildTextWithKeyword(myExpectedTypeRef));
6161
}

csharp-impl/src/main/java/consulo/csharp/impl/ide/codeInsight/actions/CastNArgumentToTypeRefFix.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public CastNArgumentToTypeRefFix(@Nonnull DotNetExpression expression, @Nonnull
4343
public LocalizeValue getText() {
4444
DotNetExpression element = myExpressionPointer.getElement();
4545
if (element == null) {
46-
return LocalizeValue.of();
46+
return LocalizeValue.empty();
4747
}
4848
return CSharpErrorLocalize.castArgument0To1(myParameterName, CSharpTypeRefPresentationUtil.buildTextWithKeyword(myExpectedTypeRef));
4949
}

csharp-impl/src/main/java/consulo/csharp/impl/ide/codeInsight/actions/ChangeReturnToTypeRefFix.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public ChangeReturnToTypeRefFix(@Nonnull DotNetLikeMethodDeclaration element, @N
5454
public LocalizeValue getText() {
5555
DotNetLikeMethodDeclaration element = myMethodPointer.getElement();
5656
if (element == null) {
57-
return LocalizeValue.of();
57+
return LocalizeValue.empty();
5858
}
5959
return CSharpErrorLocalize.changeReturnTypeTo0Fix(element.getName(), CSharpTypeRefPresentationUtil.buildTextWithKeyword(myToTypeRef));
6060
}

csharp-impl/src/main/java/consulo/csharp/impl/ide/codeInsight/actions/ChangeVariableToTypeRefFix.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public ChangeVariableToTypeRefFix(@Nonnull DotNetVariable element, @Nonnull DotN
5555
public LocalizeValue getText() {
5656
DotNetVariable element = myVariablePointer.getElement();
5757
if (element == null) {
58-
return LocalizeValue.of();
58+
return LocalizeValue.empty();
5959
}
6060

6161
return CSharpErrorLocalize.change0TypeTo1Fix(element.getName(), CSharpTypeRefPresentationUtil.buildTextWithKeyword(myToTypeRef));

csharp-impl/src/main/java/consulo/csharp/impl/ide/codeInsight/actions/CreateUnresolvedLikeMethodFix.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public CreateUnresolvedLikeMethodFix(CSharpReferenceExpression expression) {
5757
public LocalizeValue getText() {
5858
String arguments = buildArgumentTypeRefs();
5959
if (arguments == null) {
60-
return LocalizeValue.of();
60+
return LocalizeValue.empty();
6161
}
6262
return createText(myReferenceName, arguments);
6363
}

csharp-impl/src/main/java/consulo/csharp/impl/ide/codeInsight/actions/CreateUnresolvedMethodByLambdaTypeFix.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public CreateUnresolvedMethodByLambdaTypeFix(CSharpReferenceExpression expressio
5858
public LocalizeValue getText() {
5959
String arguments = buildArgumentTypeRefs();
6060
if (arguments == null) {
61-
return LocalizeValue.of();
61+
return LocalizeValue.empty();
6262
}
6363
return CSharpErrorLocalize.createMethod01(myReferenceName, arguments);
6464
}

csharp-impl/src/main/java/consulo/csharp/impl/ide/codeInsight/hits/CSharpParameterHintsProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public String getInlayPresentation(@Nonnull String inlayText) {
161161
@Nonnull
162162
@Override
163163
public LocalizeValue getPreviewFileText() {
164-
return LocalizeValue.of();
164+
return LocalizeValue.empty();
165165
}
166166

167167
@Nonnull

csharp-impl/src/main/java/consulo/csharp/impl/ide/highlight/check/CompilerCheck.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public static LocalizeValue message(@Nonnull Class<?> aClass, Object... args) {
182182

183183
LocalizeValue value = getValue(LocalizeKey.of(LOCALIZE_ID, id), args);
184184

185-
return ApplicationProperties.isInSandbox() ? value.map((localizeManager, s) -> id + ": " + s) : value;
185+
return ApplicationProperties.isInSandbox() ? value.map(s -> id + ": " + s) : value;
186186
}
187187

188188
@Nonnull

csharp-impl/src/main/java/consulo/csharp/impl/ide/highlight/check/impl/CS0120.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public LocalizeValue getText() {
6060

6161
PsiElement resolvedElement = element.resolve();
6262
if (resolvedElement == null) {
63-
return LocalizeValue.of();
63+
return LocalizeValue.empty();
6464
}
6565
return LocalizeValue.localizeTODO("Replace qualifier by '" + formatElement(resolvedElement.getParent()) + "'");
6666
}

csharp-impl/src/main/java/consulo/csharp/impl/ide/newProjectOrModule/CSharpSetupStep.java

Lines changed: 57 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
1716
package consulo.csharp.impl.ide.newProjectOrModule;
1817

1918
import consulo.content.bundle.SdkTable;
@@ -30,80 +29,72 @@
3029
import consulo.ui.util.FormBuilder;
3130

3231
import jakarta.annotation.Nonnull;
32+
3333
import java.util.ArrayList;
3434
import java.util.List;
3535
import java.util.Map;
3636

3737
/**
3838
* @author VISTALL
39-
* @since 05.06.14
39+
* @since 2014-06-05
4040
*/
41-
public class CSharpSetupStep extends UnifiedProjectOrModuleNameStep<CSharpNewModuleContext>
42-
{
43-
private DotNetTarget myForceTarget;
41+
public class CSharpSetupStep extends UnifiedProjectOrModuleNameStep<CSharpNewModuleContext> {
42+
private DotNetTarget myForceTarget;
4443

45-
private ComboBox<DotNetTarget> myTargetComboBox;
46-
private BundleBox myBundleBox;
44+
private ComboBox<DotNetTarget> myTargetComboBox;
45+
private BundleBox myBundleBox;
4746

48-
public CSharpSetupStep(CSharpNewModuleContext context)
49-
{
50-
super(context);
51-
}
47+
public CSharpSetupStep(CSharpNewModuleContext context) {
48+
super(context);
49+
}
5250

51+
@Override
5352
@RequiredUIAccess
54-
@Override
55-
protected void extend(@Nonnull FormBuilder builder, @Nonnull Disposable uiDisposable)
56-
{
57-
super.extend(builder, uiDisposable);
58-
59-
if(myForceTarget == null)
60-
{
61-
myTargetComboBox = ComboBox.create(DotNetTarget.values());
62-
myTargetComboBox.setValue(DotNetTarget.EXECUTABLE);
63-
myTargetComboBox.setTextRender(DotNetTarget::getDescription);
64-
65-
builder.addLabeled(LocalizeValue.localizeTODO("Target:"), myTargetComboBox);
66-
}
67-
68-
List<String> validSdkTypes = new ArrayList<>();
69-
for(Map.Entry<String, String[]> entry : CSharpNewModuleBuilder.ourExtensionMapping.entrySet())
70-
{
71-
// need check C# extension
72-
ModuleExtensionProvider provider = ModuleExtensionProvider.findProvider(entry.getValue()[1]);
73-
if(provider == null)
74-
{
75-
continue;
76-
}
77-
validSdkTypes.add(entry.getKey());
78-
}
79-
80-
BundleBoxBuilder boxBuilder = BundleBoxBuilder.create(uiDisposable);
81-
boxBuilder.withSdkTypeFilter(sdkTypeId -> validSdkTypes.contains(sdkTypeId.getId()));
82-
83-
myBundleBox = boxBuilder.build();
84-
ListModel<BundleBox.BundleBoxItem> listModel = myBundleBox.getComponent().getListModel();
85-
// select first
86-
if(listModel.getSize() > 0)
87-
{
88-
myBundleBox.getComponent().setValue(listModel.get(0));
89-
}
90-
builder.addLabeled(LocalizeValue.localizeTODO(".NET SDK:"), myBundleBox.getComponent());
91-
}
92-
93-
@Override
94-
public void onStepLeave(@Nonnull CSharpNewModuleContext context)
95-
{
96-
super.onStepLeave(context);
97-
98-
context.setTarget(myForceTarget != null ? myForceTarget : myTargetComboBox.getValueOrError());
99-
100-
context.setSdk(SdkTable.getInstance().findSdk(myBundleBox.getSelectedBundleName()));
101-
}
102-
103-
@Nonnull
104-
public CSharpSetupStep disableTargetComboBox(@Nonnull DotNetTarget target)
105-
{
106-
myForceTarget = target;
107-
return this;
108-
}
53+
protected void extend(@Nonnull FormBuilder builder, @Nonnull Disposable uiDisposable) {
54+
super.extend(builder, uiDisposable);
55+
56+
if (myForceTarget == null) {
57+
myTargetComboBox = ComboBox.create(DotNetTarget.values());
58+
myTargetComboBox.setValue(DotNetTarget.EXECUTABLE);
59+
myTargetComboBox.setTextRenderer(DotNetTarget::getDescription);
60+
61+
builder.addLabeled(LocalizeValue.localizeTODO("Target:"), myTargetComboBox);
62+
}
63+
64+
List<String> validSdkTypes = new ArrayList<>();
65+
for (Map.Entry<String, String[]> entry : CSharpNewModuleBuilder.ourExtensionMapping.entrySet()) {
66+
// need check C# extension
67+
ModuleExtensionProvider provider = ModuleExtensionProvider.findProvider(entry.getValue()[1]);
68+
if (provider == null) {
69+
continue;
70+
}
71+
validSdkTypes.add(entry.getKey());
72+
}
73+
74+
BundleBoxBuilder boxBuilder = BundleBoxBuilder.create(uiDisposable);
75+
boxBuilder.withSdkTypeFilter(sdkTypeId -> validSdkTypes.contains(sdkTypeId.getId()));
76+
77+
myBundleBox = boxBuilder.build();
78+
ListModel<BundleBox.BundleBoxItem> listModel = myBundleBox.getComponent().getListModel();
79+
// select first
80+
if (listModel.getSize() > 0) {
81+
myBundleBox.getComponent().setValue(listModel.get(0));
82+
}
83+
builder.addLabeled(LocalizeValue.localizeTODO(".NET SDK:"), myBundleBox.getComponent());
84+
}
85+
86+
@Override
87+
public void onStepLeave(@Nonnull CSharpNewModuleContext context) {
88+
super.onStepLeave(context);
89+
90+
context.setTarget(myForceTarget != null ? myForceTarget : myTargetComboBox.getValueOrError());
91+
92+
context.setSdk(SdkTable.getInstance().findSdk(myBundleBox.getSelectedBundleName()));
93+
}
94+
95+
@Nonnull
96+
public CSharpSetupStep disableTargetComboBox(@Nonnull DotNetTarget target) {
97+
myForceTarget = target;
98+
return this;
99+
}
109100
}

0 commit comments

Comments
 (0)