|
|
|
@ -262,7 +262,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -262,7 +262,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
return contextList.Result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
foreach (var m in initializerResult.Item1.Type.GetMembers (m => m.IsPublic && (m.EntityType == EntityType.Property || m.EntityType == EntityType.Field))) { |
|
|
|
|
foreach (var m in initializerResult.Item1.Type.GetMembers (m => !m.IsSynthetic && m.IsPublic && (m.EntityType == EntityType.Property || m.EntityType == EntityType.Field))) { |
|
|
|
|
contextList.AddMember(m); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -314,7 +314,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -314,7 +314,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
return null; |
|
|
|
|
case '>': |
|
|
|
|
if (!IsInsideDocComment()) { |
|
|
|
|
if (offset > 2 && document.GetCharAt (offset - 2) == '-' && !IsInsideCommentStringOrDirective()) { |
|
|
|
|
if (offset > 2 && document.GetCharAt(offset - 2) == '-' && !IsInsideCommentStringOrDirective()) { |
|
|
|
|
return HandleMemberReferenceCompletion(GetExpressionBeforeCursor()); |
|
|
|
|
} |
|
|
|
|
return null; |
|
|
|
@ -886,7 +886,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -886,7 +886,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
if (n.Parent is ICSharpCode.NRefactory.CSharp.Attribute) { |
|
|
|
|
nodes.Add(n.Parent); |
|
|
|
|
} |
|
|
|
|
var astResolver = CompletionContextProvider.GetResolver (csResolver, identifierStart.Unit); |
|
|
|
|
var astResolver = CompletionContextProvider.GetResolver(csResolver, identifierStart.Unit); |
|
|
|
|
astResolver.ApplyNavigator(new NodeListResolveVisitorNavigator(nodes)); |
|
|
|
|
try { |
|
|
|
|
csResolver = astResolver.GetResolverStateBefore(n); |
|
|
|
@ -1281,7 +1281,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -1281,7 +1281,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
var root = node; |
|
|
|
|
while (root.Parent != null) |
|
|
|
|
root = root.Parent; |
|
|
|
|
var astResolver = CompletionContextProvider.GetResolver (state, root); |
|
|
|
|
var astResolver = CompletionContextProvider.GetResolver(state, root); |
|
|
|
|
foreach (var type in CreateFieldAction.GetValidTypes(astResolver, (Expression)node)) { |
|
|
|
|
if (type.Kind == TypeKind.Enum) { |
|
|
|
|
AddEnumMembers(wrapper, type, state); |
|
|
|
@ -1321,6 +1321,8 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -1321,6 +1321,8 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
if (currentType != null) { |
|
|
|
|
for (var ct = currentType; ct != null; ct = ct.DeclaringTypeDefinition) { |
|
|
|
|
foreach (var nestedType in ct.NestedTypes) { |
|
|
|
|
if (nestedType.IsSynthetic) |
|
|
|
|
continue; |
|
|
|
|
string name = nestedType.Name; |
|
|
|
|
if (IsAttributeContext(node) && name.EndsWith("Attribute") && name.Length > "Attribute".Length) { |
|
|
|
|
name = name.Substring(0, name.Length - "Attribute".Length); |
|
|
|
@ -1349,6 +1351,8 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -1349,6 +1351,8 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
if (member is IMethod && ((IMethod)member).FullName == "System.Object.Finalize") { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
if (member.IsSynthetic) |
|
|
|
|
continue; |
|
|
|
|
if (member.EntityType == EntityType.Operator) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
@ -1365,7 +1369,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -1365,7 +1369,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
} |
|
|
|
|
var declaring = def.DeclaringTypeDefinition; |
|
|
|
|
while (declaring != null) { |
|
|
|
|
foreach (var member in declaring.GetMembers (m => m.IsStatic)) { |
|
|
|
|
foreach (var member in declaring.GetMembers (m => m.IsStatic && !m.IsSynthetic)) { |
|
|
|
|
if (memberPred == null || memberPred(member)) { |
|
|
|
|
wrapper.AddMember(member); |
|
|
|
|
} |
|
|
|
@ -2147,6 +2151,8 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -2147,6 +2151,8 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
var nr = (NamespaceResolveResult)resolveResult; |
|
|
|
|
if (!(resolvedNode.Parent is UsingDeclaration || resolvedNode.Parent != null && resolvedNode.Parent.Parent is UsingDeclaration)) { |
|
|
|
|
foreach (var cl in nr.Namespace.Types) { |
|
|
|
|
if (cl.IsSynthetic) |
|
|
|
|
continue; |
|
|
|
|
string name = cl.Name; |
|
|
|
|
if (hintType != null && hintType.Kind != TypeKind.Array && cl.Kind == TypeKind.Interface) { |
|
|
|
|
continue; |
|
|
|
@ -2270,7 +2276,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -2270,7 +2276,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
string typeString = GetShortType(resolvedType, state); |
|
|
|
|
completionList.AddEnumMembers (resolvedType, state, typeString); |
|
|
|
|
completionList.AddEnumMembers(resolvedType, state, typeString); |
|
|
|
|
DefaultCompletionString = typeString; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -2285,6 +2291,8 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -2285,6 +2291,8 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
var namespaceContents = new CompletionDataWrapper(this); |
|
|
|
|
|
|
|
|
|
foreach (var cl in nr.Namespace.Types) { |
|
|
|
|
if (cl.IsSynthetic) |
|
|
|
|
continue; |
|
|
|
|
IType addType = typePred != null ? typePred(cl) : cl; |
|
|
|
|
if (addType != null) |
|
|
|
|
namespaceContents.AddType(addType, addType.Name); |
|
|
|
@ -2385,6 +2393,8 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -2385,6 +2393,8 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
|
|
|
|
|
var filteredList = new List<IMember>(); |
|
|
|
|
foreach (var member in type.GetMembers ()) { |
|
|
|
|
if (member.IsSynthetic) |
|
|
|
|
continue; |
|
|
|
|
if (member.EntityType == EntityType.Indexer || member.EntityType == EntityType.Operator || member.EntityType == EntityType.Constructor || member.EntityType == EntityType.Destructor) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
@ -2435,7 +2445,9 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -2435,7 +2445,9 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (resolveResult is TypeResolveResult || includeStaticMembers) { |
|
|
|
|
foreach (var nested in type.GetNestedTypes ()) { |
|
|
|
|
foreach (var nested in type.GetNestedTypes (t => !t.IsSynthetic)) { |
|
|
|
|
if (!lookup.IsAccessible(nested.GetDefinition(), isProtectedAllowed)) |
|
|
|
|
continue; |
|
|
|
|
IType addType = typePred != null ? typePred(nested) : nested; |
|
|
|
|
if (addType != null) |
|
|
|
|
result.AddType(addType, addType.Name); |
|
|
|
@ -2866,13 +2878,13 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -2866,13 +2878,13 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
string GetLastClosingXmlCommentTag () |
|
|
|
|
string GetLastClosingXmlCommentTag() |
|
|
|
|
{ |
|
|
|
|
var line = document.GetLineByNumber(location.Line); |
|
|
|
|
|
|
|
|
|
restart: |
|
|
|
|
string lineText = document.GetText(line); |
|
|
|
|
if (!lineText.Trim ().StartsWith ("///")) |
|
|
|
|
if (!lineText.Trim().StartsWith("///")) |
|
|
|
|
return null; |
|
|
|
|
int startIndex = Math.Min(location.Column - 1, lineText.Length - 1) - 1; |
|
|
|
|
while (startIndex > 0 && lineText [startIndex] != '<') { |
|
|
|
@ -2906,7 +2918,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -2906,7 +2918,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
|
|
|
|
|
IEnumerable<ICompletionData> GetXmlDocumentationCompletionData() |
|
|
|
|
{ |
|
|
|
|
var closingTag = GetLastClosingXmlCommentTag (); |
|
|
|
|
var closingTag = GetLastClosingXmlCommentTag(); |
|
|
|
|
if (closingTag != null) { |
|
|
|
|
yield return factory.CreateLiteralCompletionData( |
|
|
|
|
"/" + closingTag + ">" |
|
|
|
|