fix #1464
This commit is contained in:
parent
a1e116c52b
commit
b58991a313
|
|
@ -666,7 +666,8 @@ namespace CodeCompletion
|
|||
_indexer.dereferencing_value.visit(this);
|
||||
if (returned_scope != null && returned_scope is TypeScope)
|
||||
{
|
||||
if ((returned_scope as TypeScope).GetFullName() != null && (returned_scope as TypeScope).GetFullName().IndexOf("System.Tuple") == 0)
|
||||
TypeScope ts = returned_scope as TypeScope;
|
||||
if (ts.GetFullName() != null && (ts.GetFullName().IndexOf("System.Tuple") == 0 || ts.original_type != null && ts.original_type.GetFullName() != null && ts.original_type.GetFullName().IndexOf("(T1,") == 0))
|
||||
{
|
||||
if (_indexer.indexes.expressions[0] is int32_const)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -478,6 +478,27 @@ namespace CodeCompletion
|
|||
returned_scope = new ElementScope(((returned_scope as ElementScope).sc as ProcScope).return_type.GetElementType());
|
||||
else if (returned_scope is ProcScope && (returned_scope as ProcScope).is_constructor)
|
||||
returned_scope = new ElementScope((returned_scope as ProcScope).declaringType.GetElementType());
|
||||
else if (returned_scope is ElementScope && (returned_scope as ElementScope).sc is TypeScope)
|
||||
{
|
||||
TypeScope ts = (returned_scope as ElementScope).sc as TypeScope;
|
||||
if (ts.GetFullName() != null && (ts.GetFullName().IndexOf("System.Tuple") == 0 || ts.original_type != null && ts.original_type.GetFullName() != null && ts.original_type.GetFullName().IndexOf("(T1,") == 0))
|
||||
{
|
||||
if (_indexer.indexes.expressions[0] is int32_const)
|
||||
{
|
||||
if ((_indexer.indexes.expressions[0] as int32_const).val >= 0)
|
||||
{
|
||||
dot_node dn = new dot_node(_indexer.dereferencing_value, new ident("Item" + ((_indexer.indexes.expressions[0] as int32_const).val + 1)));
|
||||
dn.visit(this);
|
||||
}
|
||||
else
|
||||
returned_scope = null;
|
||||
}
|
||||
else
|
||||
returned_scope = null;
|
||||
}
|
||||
else
|
||||
returned_scope = new ElementScope(returned_scope.GetElementType());
|
||||
}
|
||||
else
|
||||
returned_scope = new ElementScope(returned_scope.GetElementType());
|
||||
}
|
||||
|
|
|
|||
5
TestSuite/intellisense_tests/tuple7.pas
Normal file
5
TestSuite/intellisense_tests/tuple7.pas
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
begin
|
||||
var t := (1,1.2);
|
||||
var s{@var s: string;@} := t[0].ToString;
|
||||
t[1].ToString{@function real.ToString(): string; virtual;@};
|
||||
end.
|
||||
Loading…
Reference in a new issue