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 @@ -106,6 +106,7 @@ else if (matcher.group(4).equals("warning")) {
}

@Override
@SuppressWarnings("SpellCheckingInspection")
public GeneralCommandLine createCommandLine(Module module, Collection<Path> results, DotNetModuleExtension<?> extension) throws Exception {
if (myExecutable == null) {
throw new DotNetCompileFailedException("C# compiler is not found");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
* @since 2014-07-31
*/
public final class CSharpConfigurationPanel {
@SuppressWarnings("SpellCheckingInspection")
private static final List<String> COMPILE_LEVELS = List.of(
"ISO-1",
"ISO-2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public boolean isStrictTagMatching(final FileType fileType, final int braceGroup
switch(braceGroupId)
{
case XML_TAG_TOKEN_GROUP:
// Other xml languages may have nonbalanced tag names
// Other xml languages may have non-balanced tag names
return isStrictTagMatchingForFileType(fileType);

default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public static CSharpDocTagManager getInstance()

private Map<String, CSharpDocTagInfo> myTags = new HashMap<String, CSharpDocTagInfo>();

@SuppressWarnings("SpellCheckingInspection")
public CSharpDocTagManager()
{
addTag(new CSharpDocTagInfo("c"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class CSharpLineMarkerProvider implements LineMarkerProvider, DumbAware {
OverrideTypeCollector.INSTANCE,
new PartialTypeCollector(),
HidingOrOverridingElementCollector.INSTANCE,
HidedOrOverridedElementCollector.INSTANCE,
HidedOrOverriddenElementCollector.INSTANCE,
new RecursiveCallCollector()
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ public boolean isAvailable(Project project, Editor editor, PsiElement element) {
return false;
}
if (node.getElementType() == CSharpTokens.DELEGATE_KEYWORD) {
CSharpDelegateExpressionImpl anonymMethodExpression = PsiTreeUtil.getParentOfType(element, CSharpDelegateExpressionImpl.class);
return anonymMethodExpression != null && anonymMethodExpression.toTypeRef(true) != DotNetTypeRef.ERROR_TYPE;
CSharpDelegateExpressionImpl anonymousMethodExpression = PsiTreeUtil.getParentOfType(element, CSharpDelegateExpressionImpl.class);
return anonymousMethodExpression != null && anonymousMethodExpression.toTypeRef(true) != DotNetTypeRef.ERROR_TYPE;
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@
import consulo.application.util.CachedValuesManager;
import consulo.codeEditor.Editor;
import consulo.csharp.api.localize.CSharpLocalize;
import consulo.csharp.impl.ide.lineMarkerProvider.HidedOrOverridedElementCollector;
import consulo.csharp.impl.ide.lineMarkerProvider.HidedOrOverriddenElementCollector;
import consulo.csharp.impl.ide.lineMarkerProvider.LineMarkerCollector;
import consulo.csharp.impl.ide.lineMarkerProvider.OverrideTypeCollector;
import consulo.csharp.lang.CSharpLanguage;
import consulo.csharp.lang.psi.CSharpConstructorDeclaration;
import consulo.csharp.lang.psi.CSharpSimpleLikeMethodAsElement;
import consulo.csharp.lang.psi.CSharpTypeDeclaration;
import consulo.dotnet.psi.DotNetModifier;
import consulo.dotnet.psi.DotNetModifierListOwner;
import consulo.dotnet.psi.DotNetVirtualImplementOwner;
import consulo.language.editor.codeVision.CodeVisionRelativeOrdering;
import consulo.language.editor.impl.codeVision.CodeVisionProviderBase;
Expand Down Expand Up @@ -126,7 +124,7 @@ public void handleClick(Editor editor, PsiElement element, ComponentEvent<?> eve
collector = OverrideTypeCollector.INSTANCE;
}
else {
collector = HidedOrOverridedElementCollector.INSTANCE;
collector = HidedOrOverriddenElementCollector.INSTANCE;
}

collector.navigate(event, element);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,6 @@ static int collectInheritingClasses(CSharpTypeDeclaration aClass) {
}

static int collectOverridingMethods(CSharpSimpleLikeMethodAsElement method) {
return OverrideUtil.collectOverridenMembers((DotNetVirtualImplementOwner) method).size();
return OverrideUtil.collectOverriddenMembers((DotNetVirtualImplementOwner) method).size();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static boolean isValidLocation(Project project, @Nullable VirtualFile vir
{
if(virtualFile == null || virtualFile.getFileType() != CSharpFileType.INSTANCE)
{
// if not virtual file - we dont need break highlight
// if not virtual file - we don't need to break highlight
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ protected CodeStyleAbstractPanel createPanel(CodeStyleSettings settings)
}

@Override
@SuppressWarnings("SpellCheckingInspection")
public String getHelpTopic()
{
return "reference.settingsdialog.codestyle.csharp";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void customizeSettings(CodeStyleSettingsCustomizable consumer, SettingsTy
consumer.showCustomOption(CSharpCodeStyleSettings.class, "SPACE_BEFORE_PROPERTY_LBRACE", "Property left brace", CodeStyleSettingsCustomizable.SPACES_BEFORE_LEFT_BRACE,
CodeStyleSettingsCustomizable.OptionAnchor.AFTER, "SPACE_BEFORE_METHOD_LBRACE");

consumer.showCustomOption(CSharpCodeStyleSettings.class, "SPACE_BEFORE_INDEX_METHOD_LBRACE", "Index methd left brace", CodeStyleSettingsCustomizable.SPACES_BEFORE_LEFT_BRACE,
consumer.showCustomOption(CSharpCodeStyleSettings.class, "SPACE_BEFORE_INDEX_METHOD_LBRACE", "Index method left brace", CodeStyleSettingsCustomizable.SPACES_BEFORE_LEFT_BRACE,
CodeStyleSettingsCustomizable.OptionAnchor.AFTER, "SPACE_BEFORE_METHOD_LBRACE");

consumer.showCustomOption(CSharpCodeStyleSettings.class, "SPACE_BEFORE_FOREACH_LBRACE", "'foreach' left brace", CodeStyleSettingsCustomizable.SPACES_BEFORE_LEFT_BRACE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package consulo.csharp.impl.ide.completion;

import consulo.annotation.access.RequiredReadAction;
Expand All @@ -28,7 +27,7 @@
import consulo.csharp.impl.ide.completion.item.CSharpTypeLikeLookupElement;
import consulo.csharp.impl.ide.completion.patterns.CSharpPatterns;
import consulo.csharp.impl.ide.completion.util.SpaceInsertHandler;
import consulo.csharp.impl.ide.completion.weigher.CSharpInheritCompletionWeighter;
import consulo.csharp.impl.ide.completion.weigher.CSharpInheritCompletionWeigher;
import consulo.csharp.lang.impl.ide.codeStyle.CSharpCodeGenerationSettings;
import consulo.csharp.lang.impl.psi.CSharpContextUtil;
import consulo.csharp.lang.impl.psi.CSharpTokenSets;
Expand Down Expand Up @@ -75,7 +74,7 @@

/**
* @author VISTALL
* @since 23.11.14
* @since 2014-11-23
*/
class CSharpExpressionCompletionContributor
{
Expand Down Expand Up @@ -180,7 +179,7 @@ public boolean test(IElementType elementType)
@RequiredReadAction
public void addCompletions(CompletionParameters parameters, ProcessingContext context, CompletionResultSet result)
{
List<ExpectedTypeInfo> expectedTypeInfos = CSharpInheritCompletionWeighter.getExpectedTypeInfosForExpression(parameters, context);
List<ExpectedTypeInfo> expectedTypeInfos = CSharpInheritCompletionWeigher.getExpectedTypeInfosForExpression(parameters, context);

for(ExpectedTypeInfo expectedTypeInfo : expectedTypeInfos)
{
Expand Down Expand Up @@ -319,7 +318,7 @@ public void addCompletions(final CompletionParameters parameters, ProcessingCont

final CSharpTypeDeclaration contextType = getContextType(expression);

final List<ExpectedTypeInfo> expectedTypeRefs = CSharpInheritCompletionWeighter.getExpectedTypeInfosForExpression(parameters, context);
final List<ExpectedTypeInfo> expectedTypeRefs = CSharpInheritCompletionWeigher.getExpectedTypeInfosForExpression(parameters, context);
for(ExpectedTypeInfo expectedTypeRef : expectedTypeRefs)
{
PsiElement element = expectedTypeRef.getTypeRef().resolve().getElement();
Expand Down Expand Up @@ -608,7 +607,7 @@ public void addCompletions(final CompletionParameters completionParameters, Proc
DotNetType type = PsiTreeUtil.getParentOfType(parent, DotNetType.class);
if(type != null)
{
// disable native type completion, due they dont extends System.Exception
// disable native type completion, because they don't extend System.Exception
if(type.getParent() instanceof CSharpLocalVariable && type.getParent().getParent() instanceof CSharpCatchStatementImpl)
{
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import consulo.language.editor.completion.CompletionProvider;
import consulo.csharp.impl.ide.completion.patterns.CSharpPatterns;
import consulo.csharp.impl.ide.completion.util.SpaceInsertHandler;
import consulo.csharp.lang.impl.psi.CSharpPreprocesorTokens;
import consulo.csharp.lang.impl.psi.CSharpPreprocessorTokens;
import consulo.csharp.lang.impl.psi.CSharpPreprocessorElements;
import consulo.csharp.lang.impl.psi.CSharpTokenSets;
import consulo.csharp.lang.psi.*;
Expand Down Expand Up @@ -86,7 +86,7 @@ static void extend(CompletionContributor contributor)
CSharpCompletionUtil.tokenSetToLookup(result, THIS_OR_BASE, (b, elementType) -> b.withInsertHandler(ParenthesesInsertHandler.getInstance(true)), null);
});

contributor.extend(CompletionType.BASIC, psiElement(CSharpPreprocesorTokens.ILLEGAL_KEYWORD), new CompletionProvider()
contributor.extend(CompletionType.BASIC, psiElement(CSharpPreprocessorTokens.ILLEGAL_KEYWORD), new CompletionProvider()
{
@RequiredReadAction
@Override
Expand Down Expand Up @@ -238,7 +238,7 @@ public void addCompletions(final CompletionParameters parameters, ProcessingCont

PsiElement parent1 = position.getParent().getParent();

// dont allow inside statements
// Don't allow inside statements
DotNetStatement statementParent = PsiTreeUtil.getParentOfType(parent1, DotNetStatement.class);
if(statementParent != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import consulo.csharp.impl.ide.completion.insertHandler.CSharpParenthesesWithSemicolonInsertHandler;
import consulo.csharp.impl.ide.completion.patterns.CSharpPatterns;
import consulo.csharp.impl.ide.completion.util.SpaceInsertHandler;
import consulo.csharp.impl.ide.completion.weigher.CSharpInheritCompletionWeighter;
import consulo.csharp.impl.ide.completion.weigher.CSharpInheritCompletionWeigher;
import consulo.csharp.impl.ide.refactoring.util.CSharpNameSuggesterUtil;
import consulo.csharp.lang.CSharpLanguage;
import consulo.csharp.lang.impl.ide.codeStyle.CSharpCodeGenerationSettings;
Expand Down Expand Up @@ -97,7 +97,7 @@ public void addCompletions(CompletionParameters parameters, ProcessingContext co
}

boolean allowAsync = CSharpModuleUtil.findLanguageVersion(parent).isAtLeast(CSharpLanguageVersion._4_0);
List<ExpectedTypeInfo> expectedTypeRefs = CSharpInheritCompletionWeighter.getExpectedTypeInfosForExpression(parameters, context);
List<ExpectedTypeInfo> expectedTypeRefs = CSharpInheritCompletionWeigher.getExpectedTypeInfosForExpression(parameters, context);
for(ExpectedTypeInfo expectedTypeRef : expectedTypeRefs)
{
DotNetTypeRef typeRef = expectedTypeRef.getTypeRef();
Expand All @@ -120,12 +120,17 @@ public void addCompletions(CompletionParameters parameters, ProcessingContext co
addDelegateExpressionLookup((CSharpLambdaResolveResult) typeResolveResult, result, parent, true);
}

addPrivatMethodImpl((CSharpLambdaResolveResult) typeResolveResult, parameters, result, parent);
addPrivateMethodImpl((CSharpLambdaResolveResult) typeResolveResult, parameters, result, parent);
}
}
}

private void addPrivatMethodImpl(CSharpLambdaResolveResult typeResolveResult, CompletionParameters parameters, CompletionResultSet result, CSharpReferenceExpressionEx parent)
private void addPrivateMethodImpl(
CSharpLambdaResolveResult typeResolveResult,
CompletionParameters parameters,
CompletionResultSet result,
CSharpReferenceExpressionEx parent
)
{
PsiElement maybeAssign = parent.getParent();
if(!(maybeAssign instanceof CSharpAssignmentExpressionImpl))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,18 @@ public void handleInsert(final InsertionContext context, final LookupElement ite

if(isToken(element, "("))
{
int lparenthOffset = element.getTextRange().getStartOffset();
int lParenthOffset = element.getTextRange().getStartOffset();

if(completionChar == '(' || completionChar == '\t')
{
editor.getCaretModel().moveToOffset(lparenthOffset + 1);
editor.getCaretModel().moveToOffset(lParenthOffset + 1);
}
else
{
editor.getCaretModel().moveToOffset(context.getTailOffset());
}

context.setTailOffset(lparenthOffset + 1);
context.setTailOffset(lParenthOffset + 1);

PsiElement list = element.getParent();
PsiElement last = list.getLastChild();
Expand All @@ -97,7 +97,7 @@ public void handleInsert(final InsertionContext context, final LookupElement ite
context.setTailOffset(rparenthOffset + 1);
if(!putCaretInside)
{
for(int i = lparenthOffset + 1; i < rparenthOffset; i++)
for(int i = lParenthOffset + 1; i < rparenthOffset; i++)
{
if(!Character.isWhitespace(document.getCharsSequence().charAt(i)))
{
Expand All @@ -110,7 +110,7 @@ public void handleInsert(final InsertionContext context, final LookupElement ite
{
AutoPopupController.getInstance(context.getProject()).autoPopupParameterInfo(editor, CSharpParameterInfoHandler.item(myLikeMethodDeclaration));

editor.getCaretModel().moveToOffset(lparenthOffset + 1);
editor.getCaretModel().moveToOffset(lParenthOffset + 1);
}
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@

/**
* @author VISTALL
* @since 27.07.2015
* @since 2015-07-27
*/
@ExtensionImpl(order = "before stats, before csharpKindSorter")
public class CSharpInheritCompletionWeighter extends CompletionWeigher
public class CSharpInheritCompletionWeigher extends CompletionWeigher
{
public enum Position
{
Expand All @@ -65,8 +65,10 @@ public enum Position
HIGH
}

private static final NotNullLazyKey<List<ExpectedTypeInfo>, CompletionLocation> ourExpectedInfoTypes = NotNullLazyKey.create("ourExpectedInfoTypes", it -> getExpectedTypeInfosForExpression(it
.getCompletionParameters().getPosition(), null));
private static final NotNullLazyKey<List<ExpectedTypeInfo>, CompletionLocation> ourExpectedInfoTypes = NotNullLazyKey.create(
"ourExpectedInfoTypes",
it -> getExpectedTypeInfosForExpression(it.getCompletionParameters().getPosition(), null)
);


@RequiredReadAction
Expand Down Expand Up @@ -165,7 +167,7 @@ public Comparable weighElement(PsiElement psiElement,
List<ExpectedTypeInfo> expectedTypeRefs,
Position upPosition)
{
// if we have not type declaration, make types lower, dont allow int i = Int32 completion more high
// If we have no type declaration, make types lower, don't allow int i = Int32 completion more high
if(referenceExpressionEx.kind() != CSharpReferenceExpression.ResolveToKind.TYPE_LIKE && CSharpCompletionUtil.isTypeLikeElementWithNamespace(psiElement) && upPosition == Position.UP_REF)
{
return Position.DOWN;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public Set<PsiElement> getAllExecutableChildren(PsiElement root)
root.accept(new CSharpRecursiveElementVisitor()
{
@Override
public void visitAnonymMethodExpression(CSharpDelegateExpressionImpl method)
public void visitAnonymousMethodExpression(CSharpDelegateExpressionImpl method)
{
lambdas.add(method);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void evaluate(CSharpEvaluateContext context)
}
else
{
throw new IllegalArgumentException("dont supported '!' with not bool value");
throw new IllegalArgumentException("'!' with no bool value is not supported");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this reads slightly better:

Suggested change
throw new IllegalArgumentException("'!' with no bool value is not supported");
throw new IllegalArgumentException("'!' is not supported for non-bool values");

}
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void processQuery(ReferencesSearch.SearchParameters queryParameters, Pred
if (elementToSearch instanceof CSharpMethodDeclaration) {
Collection<DotNetVirtualImplementOwner> targets = ApplicationManager.getApplication().runReadAction((Supplier<Collection<DotNetVirtualImplementOwner>>) () -> {
if (((CSharpMethodDeclaration) elementToSearch).hasModifier(DotNetModifier.ABSTRACT)) {
return OverrideUtil.collectOverridenMembers((DotNetVirtualImplementOwner) elementToSearch);
return OverrideUtil.collectOverriddenMembers((DotNetVirtualImplementOwner) elementToSearch);
}
return Collections.emptyList();
});
Expand Down
Loading
Loading