This commit is contained in:
Бондарев Иван 2016-05-29 12:16:22 +02:00
parent c4b314821f
commit 9345e0d509
3 changed files with 12 additions and 2 deletions

View file

@ -305,6 +305,10 @@ namespace CodeCompletion
if (extension_methods == null)
extension_methods = new Dictionary<TypeScope, List<ProcScope>>();
List<ProcScope> meth_list = null;
if (ts is CompiledScope && (ts as CompiledScope).CompiledType.IsGenericType && !(ts as CompiledScope).CompiledType.IsGenericTypeDefinition)
ts = TypeTable.get_compiled_type((ts as CompiledScope).CompiledType.GetGenericTypeDefinition());
if (ts.original_type != null)
ts = ts.original_type;
if (!extension_methods.TryGetValue(ts, out meth_list))
{
meth_list = new List<ProcScope>();
@ -347,7 +351,7 @@ namespace CodeCompletion
{
TypeScope tmp_ts2 = tmp_ts;
if (tmp_ts is CompiledScope && (tmp_ts as CompiledScope).CompiledType.IsGenericType && !(tmp_ts as CompiledScope).CompiledType.IsGenericTypeDefinition)
tmp_ts2 = TypeTable.get_compiled_type(new SymInfo("", SymbolKind.Class, ""), (tmp_ts as CompiledScope).CompiledType.GetGenericTypeDefinition());
tmp_ts2 = TypeTable.get_compiled_type((tmp_ts as CompiledScope).CompiledType.GetGenericTypeDefinition());
if (extension_methods.TryGetValue(tmp_ts2, out meths))
{
lst.AddRange(meths);
@ -369,7 +373,7 @@ namespace CodeCompletion
{
TypeScope int_ts2 = int_ts;
if (int_ts is CompiledScope && (int_ts as CompiledScope).CompiledType.IsGenericType && !(int_ts as CompiledScope).CompiledType.IsGenericTypeDefinition)
int_ts2 = TypeTable.get_compiled_type(new SymInfo("", SymbolKind.Class, ""), (int_ts as CompiledScope).CompiledType.GetGenericTypeDefinition());
int_ts2 = TypeTable.get_compiled_type((int_ts as CompiledScope).CompiledType.GetGenericTypeDefinition());
if (extension_methods.TryGetValue(int_ts2, out meths))
{
lst.AddRange(meths);

View file

@ -0,0 +1,5 @@
//ä
begin
var l := Seq(2,1,4);
l.OfType&<integer>().ForEach{@(расширение) procedure ForEach<T>(Self: sequence of T; action: T->());@}(x->Print(x));
end.

View file

@ -232,6 +232,7 @@ namespace VisualPascalABCPlugins
void Button2Click(object sender, EventArgs e)
{
CodeCompletion.CodeCompletionTester.Test();
CodeCompletion.CodeCompletionTester.TestIntellisense(Path.Combine(@"c:\Work\Miks\_PABCNETGitHub\TestSuite", "intellisense_tests"));
MessageBox.Show("Done");
}