|
|
|
|
@ -207,7 +207,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -207,7 +207,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); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -259,7 +259,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -259,7 +259,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; |
|
|
|
|
@ -831,7 +831,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -831,7 +831,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); |
|
|
|
|
@ -1226,7 +1226,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -1226,7 +1226,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); |
|
|
|
|
@ -1266,6 +1266,8 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -1266,6 +1266,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); |
|
|
|
|
@ -1294,6 +1296,8 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -1294,6 +1296,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; |
|
|
|
|
} |
|
|
|
|
@ -1310,7 +1314,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -1310,7 +1314,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); |
|
|
|
|
} |
|
|
|
|
@ -2092,6 +2096,8 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -2092,6 +2096,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; |
|
|
|
|
@ -2215,7 +2221,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -2215,7 +2221,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
string typeString = GetShortType(resolvedType, state); |
|
|
|
|
completionList.AddEnumMembers (resolvedType, state, typeString); |
|
|
|
|
completionList.AddEnumMembers(resolvedType, state, typeString); |
|
|
|
|
DefaultCompletionString = typeString; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -2230,6 +2236,8 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -2230,6 +2236,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); |
|
|
|
|
@ -2330,6 +2338,8 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -2330,6 +2338,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; |
|
|
|
|
} |
|
|
|
|
@ -2380,7 +2390,9 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -2380,7 +2390,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); |
|
|
|
|
@ -2811,13 +2823,13 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -2811,13 +2823,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] != '<') { |
|
|
|
|
@ -2851,7 +2863,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -2851,7 +2863,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
|
|
|
|
|
IEnumerable<ICompletionData> GetXmlDocumentationCompletionData() |
|
|
|
|
{ |
|
|
|
|
var closingTag = GetLastClosingXmlCommentTag (); |
|
|
|
|
var closingTag = GetLastClosingXmlCommentTag(); |
|
|
|
|
if (closingTag != null) { |
|
|
|
|
yield return factory.CreateLiteralCompletionData( |
|
|
|
|
"/" + closingTag + ">" |
|
|
|
|
|