|
|
|
|
@ -23,7 +23,6 @@
@@ -23,7 +23,6 @@
|
|
|
|
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
|
// THE SOFTWARE.
|
|
|
|
|
|
|
|
|
|
using System; |
|
|
|
|
using System.Collections.Generic; |
|
|
|
|
using System.Linq; |
|
|
|
|
@ -416,6 +415,10 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -416,6 +415,10 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
|
|
|
|
|
var contextList = new CompletionDataWrapper (this); |
|
|
|
|
var identifierStart = GetExpressionAtCursor (); |
|
|
|
|
|
|
|
|
|
if (identifierStart != null && identifierStart.Item2 is TypeParameterDeclaration) |
|
|
|
|
return null; |
|
|
|
|
|
|
|
|
|
if (identifierStart != null && identifierStart.Item2 is VariableInitializer && location <= ((VariableInitializer)identifierStart.Item2).NameToken.EndLocation) { |
|
|
|
|
return controlSpace ? HandleAccessorContext () ?? DefaultControlSpaceItems () : null; |
|
|
|
|
} |
|
|
|
|
@ -440,6 +443,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -440,6 +443,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
return HandleKeywordCompletion (tokenIndex, token); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (identifierStart == null) |
|
|
|
|
return HandleAccessorContext () ?? DefaultControlSpaceItems (); |
|
|
|
|
|
|
|
|
|
@ -462,14 +466,14 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -462,14 +466,14 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
return DefaultControlSpaceItems (); |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (n is ArrayInitializerExpression) { |
|
|
|
|
var initalizerResult = ResolveExpression (identifierStart.Item1, n.Parent, identifierStart.Item3); |
|
|
|
|
|
|
|
|
|
var concreteNode = identifierStart.Item3.GetNodeAt<IdentifierExpression> (location); |
|
|
|
|
// check if we're on the right side of an initializer expression
|
|
|
|
|
if (concreteNode != null && concreteNode.Parent != null && concreteNode.Parent.Parent != null && concreteNode.Identifier != "a" && concreteNode.Parent.Parent is NamedExpression) |
|
|
|
|
if (concreteNode != null && concreteNode.Parent != null && concreteNode.Parent.Parent != null && concreteNode.Identifier != "a" && concreteNode.Parent.Parent is NamedExpression) { |
|
|
|
|
return DefaultControlSpaceItems (); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (initalizerResult != null) { |
|
|
|
|
|
|
|
|
|
@ -603,7 +607,6 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -603,7 +607,6 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool IsInLinqContext (int offset) |
|
|
|
|
{ |
|
|
|
|
string token; |
|
|
|
|
@ -756,8 +759,9 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -756,8 +759,9 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (currentMember != null) { |
|
|
|
|
foreach (var member in ctx.CurrentTypeDefinition.GetMembers ()) { |
|
|
|
|
if (this.currentMember != null) { |
|
|
|
|
var def = ctx.CurrentTypeDefinition ?? Compilation.MainAssembly.GetTypeDefinition (currentType); |
|
|
|
|
foreach (var member in def.GetMembers ()) { |
|
|
|
|
if (memberPred == null || memberPred (member)) |
|
|
|
|
wrapper.AddMember (member); |
|
|
|
|
} |
|
|
|
|
@ -1875,6 +1879,18 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -1875,6 +1879,18 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
baseUnit = tmpUnit; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// try parameter declaration type
|
|
|
|
|
if (expr == null) { |
|
|
|
|
baseUnit = ParseStub (">", false, "{}"); |
|
|
|
|
expr = baseUnit.GetNodeAt<TypeParameterDeclaration> (location.Line, location.Column - 1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// try parameter declaration method
|
|
|
|
|
if (expr == null) { |
|
|
|
|
baseUnit = ParseStub ("> ()", false, "{}"); |
|
|
|
|
expr = baseUnit.GetNodeAt<TypeParameterDeclaration> (location.Line, location.Column - 1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (expr == null) |
|
|
|
|
return null; |
|
|
|
|
var member = Unit.GetNodeAt<AttributedNode> (memberLocation); |
|
|
|
|
|