bug fix #171
This commit is contained in:
parent
c4b314821f
commit
9345e0d509
|
|
@ -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);
|
||||
|
|
|
|||
5
TestSuite/intellisense_tests/extensionmethods1.pas
Normal file
5
TestSuite/intellisense_tests/extensionmethods1.pas
Normal 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.
|
||||
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue