dcd integration: fixed identifier completion (without dot)

This commit is contained in:
Basile Burg 2014-11-07 07:41:29 +01:00
parent aa35683cf9
commit 83b568904c
2 changed files with 7 additions and 4 deletions

View File

@ -88,10 +88,10 @@ end;
procedure getCompletion(const aFilename: string; aPosition: Integer; const list: TStrings); procedure getCompletion(const aFilename: string; aPosition: Integer; const list: TStrings);
var var
i: NativeInt; i, j: NativeInt;
kind: Char; kind: Char;
item: string; item: string;
asComp: boolean; asComp, asTips: boolean;
begin begin
if not dcdOn then exit; if not dcdOn then exit;
lazyServerStart; lazyServerStart;
@ -106,10 +106,12 @@ begin
if lines.Count = 0 then if lines.Count = 0 then
exit; exit;
asComp := lines.Strings[0] = 'identifiers'; asComp := lines.Strings[0] = 'identifiers';
if not asComp then asTips := lines.Strings[0] = 'calltips';
if asTips then
exit; exit;
if asComp then j := 1 else j := 0;
list.Clear; list.Clear;
for i := 1 to lines.Count-1 do for i := j to lines.Count-1 do
begin begin
item := lines.Strings[i]; item := lines.Strings[i];
kind := item[length(item)]; kind := item[length(item)];

View File

@ -341,6 +341,7 @@ begin
fDoc.Lines.SaveToStream(str); fDoc.Lines.SaveToStream(str);
str.SaveToFile(fname); str.SaveToFile(fname);
srcpos := fDoc.SelStart; srcpos := fDoc.SelStart;
if srcpos > 0 then srcpos -= -1;
completion.ItemList.Clear; completion.ItemList.Clear;
ce_dcd.getCompletion(fname, srcpos, completion.ItemList); ce_dcd.getCompletion(fname, srcpos, completion.ItemList);
finally finally