This commit is contained in:
Бондарев Иван 2018-12-31 11:12:08 +01:00
parent e9173945e6
commit c1fbe7a447
4 changed files with 24 additions and 1 deletions

View file

@ -57,6 +57,17 @@ namespace CodeCompletion
{
returned_scope = null;
}
if (returned_scope is ProcScope && (expr is ident || expr is dot_node))
{
try
{
expr = new method_call(expr as addressed_value, new expression_list());
expr.visit(this);
}
catch (Exception e)
{
}
}
if (returned_scope != null && returned_scope is ElementScope && (returned_scope as ElementScope).sc is ProcScope)
{
if ((returned_scope as ElementScope).si.kind == SymbolKind.Delegate)

View file

@ -1436,6 +1436,8 @@ namespace CodeCompletion
public override List<SymScope> FindOverloadNames(string name)
{
if (string.Compare(si.name, name, true) == 0)
return new List<SymScope>() { this };
List<SymScope> names = sc.FindOverloadNames(name);
if (topScope != null)
names.AddRange(topScope.FindOverloadNames(name));
@ -2921,7 +2923,11 @@ namespace CodeCompletion
public override List<SymScope> FindOverloadNames(string name)
{
return actType.FindOverloadNames(name);
List<SymScope> names = actType.FindOverloadNames(name);
if (names.Count > 0)
return names;
if (topScope != null) return topScope.FindOverloadNames(name);
return names;
}
public override List<SymScope> FindOverloadNamesOnlyInType(string name)
@ -4221,6 +4227,8 @@ namespace CodeCompletion
public override bool IsEqual(SymScope ts)
{
bool eq = this == ts as TypeScope;
if (ts == null)
return false;
if (ts is NullTypeScope && this.kind == SymbolKind.Class)
return true;
if (eq)

View file

@ -5,4 +5,5 @@ procedure p1(self:t1<T>); extensionmethod := exit;
begin
var a := new t1<byte>;
a.p1{@(расширение) procedure t1<T>.p1();@};
a.p1{@(расширение) procedure t1<T>.p1();@}();
end.

View file

@ -1,4 +1,7 @@
begin
var ch: char;
ch.IsDigit{@(расширение) function char.IsDigit(): boolean;@};
char.IsDigit{@static function char.IsDigit(c: char): boolean;@}(ch);
var a: array of byte;
a.Reverse{@(расширение sequence of T) function Reverse<byte>(): sequence of byte;@};
end.