diff --git a/CodeCompletion/SymTable.cs b/CodeCompletion/SymTable.cs index 41d725d80..e473a0873 100644 --- a/CodeCompletion/SymTable.cs +++ b/CodeCompletion/SymTable.cs @@ -5445,6 +5445,10 @@ namespace CodeCompletion this.ctn = ctn; this.si = si; this.instances = new List(); + if (ctn == null) + { + + } if (ctn.BaseType != null) baseScope = TypeTable.get_compiled_type(ctn.BaseType); Type t = ctn.GetElementType(); @@ -5681,7 +5685,13 @@ namespace CodeCompletion if (!ctn.IsGenericType) return this; if (!ctn.IsGenericTypeDefinition) + { t = PascalABCCompiler.NetHelper.NetHelper.FindType(this.ctn.Namespace + "." + this.ctn.Name); + if (t == null && this.instances != null && this.instances.Count > 0 && ctn.DeclaringType != null && this.ctn.DeclaringType.IsGenericTypeDefinition) + { + t = PascalABCCompiler.NetHelper.NetHelper.FindType(this.ctn.Namespace + "." + this.ctn.DeclaringType.Name.Substring(0, this.ctn.DeclaringType.Name.IndexOf('`')) + "`" + this.instances.Count + "+" + ctn.Name); + } + } else if (this.instances != null && this.instances.Count > 0) { if (this.instances.Count != ctn.GetGenericArguments().Length) @@ -5690,6 +5700,7 @@ namespace CodeCompletion if (t2 != null) t = t2; } + } else if (gen_args.Count != ctn.GetGenericArguments().Length) { diff --git a/TestSuite/intellisense_tests/nestedclass1.pas b/TestSuite/intellisense_tests/nestedclass1.pas new file mode 100644 index 000000000..51dc652bc --- /dev/null +++ b/TestSuite/intellisense_tests/nestedclass1.pas @@ -0,0 +1,20 @@ +type + // Обязательно шаблонный класс + t1 = class + + key_lookup: Dictionary; + // Обязательно возвращать вложенный тип (тут "Dictionary.KeyCollection") + // Если возвращать "sequence of T" - не воспроизводится + function GetAllKeys := key_lookup.Keys; + + end; + + // Обязательно наследовать от t1 + t2 = class(t1) + function f1{@function t2.f1(): integer;@} := 5; + end; + +begin + var o: t2; + +end. \ No newline at end of file