Skip to content

Commit

Permalink
Merge pull request #259 from Frement/patch-1
Browse files Browse the repository at this point in the history
Added type extension methods to code completion.
  • Loading branch information
JohnPeel committed Mar 27, 2014
2 parents 98d69b4 + f63fe02 commit 6849f65
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Units/Misc/v_ideCodeInsight.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1386,6 +1386,7 @@ procedure TCodeInsight.FillSynCompletionProposal(ItemList, InsertList: TStrings;
var
i, ii: Integer;
d: TDeclaration;
dType: String;
begin
ItemList.BeginUpdate;
InsertList.BeginUpdate;
Expand All @@ -1396,9 +1397,17 @@ procedure TCodeInsight.FillSynCompletionProposal(ItemList, InsertList: TStrings;
if (PrepareString(Prefix) <> '') then
begin
d := FindVarBase(Prefix, True, vbType);
if (d <> nil) then
dType := FindVarBase(Prefix, False, vbType).CleanText;
if (d <> nil) then begin
for i := 0 to d.Items.Count - 1 do
Proposal_AddDeclaration(d.Items[i], ItemList, InsertList);
if (d.ClassType = TciRecordType) then
for i := 0 to Items.Count - 1 do
if (Items[i].ClassType = TciProcedureDeclaration) then
for ii := 0 to Items[i].Items.Count - 1 do
if (Items[i].Items[ii].ClassType = TciProcedureClassName) and (Items[i].Items[ii].ShortText = dType) then
Proposal_AddDeclaration(Items[i], ItemList, InsertList);
end;
end
else
begin
Expand Down

0 comments on commit 6849f65

Please sign in to comment.