|
|
|
|
@ -55,7 +55,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -55,7 +55,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
public bool AutoSelect; |
|
|
|
|
public string DefaultCompletionString; |
|
|
|
|
public bool CloseOnSquareBrackets; |
|
|
|
|
#endregion
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
public CSharpCompletionEngine(IDocument document, ICompletionContextProvider completionContextProvider, ICompletionDataFactory factory, IProjectContent content, CSharpTypeResolveContext ctx) : base (content, completionContextProvider, ctx) |
|
|
|
|
{ |
|
|
|
|
@ -1425,7 +1425,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -1425,7 +1425,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
foreach (var curNs in n.Namespace.ChildNamespaces) { |
|
|
|
|
wrapper.AddNamespace(curNs); |
|
|
|
|
wrapper.AddNamespace(lookup, curNs); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -2169,12 +2169,11 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -2169,12 +2169,11 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
var result = new CompletionDataWrapper(this); |
|
|
|
|
if (resolveResult is NamespaceResolveResult) { |
|
|
|
|
var nr = (NamespaceResolveResult)resolveResult; |
|
|
|
|
if (!(resolvedNode.Parent is UsingDeclaration || resolvedNode.Parent != null && resolvedNode.Parent.Parent is UsingDeclaration)) { |
|
|
|
|
var lookup = new MemberLookup( |
|
|
|
|
ctx.CurrentTypeDefinition, |
|
|
|
|
Compilation.MainAssembly |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
if (!(resolvedNode.Parent is UsingDeclaration || resolvedNode.Parent != null && resolvedNode.Parent.Parent is UsingDeclaration)) { |
|
|
|
|
foreach (var cl in nr.Namespace.Types) { |
|
|
|
|
if (hintType != null && hintType.Kind != TypeKind.Array && cl.Kind == TypeKind.Interface) { |
|
|
|
|
continue; |
|
|
|
|
@ -2185,7 +2184,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -2185,7 +2184,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
foreach (var ns in nr.Namespace.ChildNamespaces) { |
|
|
|
|
result.AddNamespace(ns); |
|
|
|
|
result.AddNamespace(lookup, ns); |
|
|
|
|
} |
|
|
|
|
} else if (resolveResult is TypeResolveResult) { |
|
|
|
|
var type = resolveResult.Type; |
|
|
|
|
@ -2306,7 +2305,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -2306,7 +2305,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
foreach (var ns in nr.Namespace.ChildNamespaces) { |
|
|
|
|
namespaceContents.AddNamespace(ns); |
|
|
|
|
namespaceContents.AddNamespace(lookup, ns); |
|
|
|
|
} |
|
|
|
|
return namespaceContents.Result; |
|
|
|
|
} |
|
|
|
|
@ -2778,7 +2777,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -2778,7 +2777,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Helper methods
|
|
|
|
|
string GetPreviousToken(ref int i, bool allowLineChange) |
|
|
|
|
@ -2814,7 +2813,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -2814,7 +2813,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
return document.GetText(i, endOffset - i); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Preprocessor
|
|
|
|
|
|
|
|
|
|
@ -2835,7 +2834,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -2835,7 +2834,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
yield return factory.CreateLiteralCompletionData("region"); |
|
|
|
|
yield return factory.CreateLiteralCompletionData("endregion"); |
|
|
|
|
} |
|
|
|
|
#endregion
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Xml Comments
|
|
|
|
|
static readonly List<string> commentTags = new List<string>(new string[] { |
|
|
|
|
@ -3012,7 +3011,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -3012,7 +3011,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
#endregion
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Keywords
|
|
|
|
|
static string[] expressionLevelKeywords = new string [] { |
|
|
|
|
@ -3087,7 +3086,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -3087,7 +3086,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
"ref", |
|
|
|
|
"params" |
|
|
|
|
}; |
|
|
|
|
#endregion
|
|
|
|
|
#endregion
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|