mirror of https://gitlab.com/basile.b/dexed.git
added call tip method to TCEDcdWrapper
This commit is contained in:
parent
cace5826fd
commit
22dc9f8954
|
|
@ -48,6 +48,7 @@ type
|
||||||
procedure restartServer;
|
procedure restartServer;
|
||||||
procedure addImportFolder(const aFolder: string);
|
procedure addImportFolder(const aFolder: string);
|
||||||
procedure getComplAtCursor(aList: TStrings);
|
procedure getComplAtCursor(aList: TStrings);
|
||||||
|
procedure getCallTip(out tips: string);
|
||||||
procedure getDdocFromCursor(out aComment: string);
|
procedure getDdocFromCursor(out aComment: string);
|
||||||
procedure getDeclFromCursor(out aFilename: string; out aPosition: Integer);
|
procedure getDeclFromCursor(out aFilename: string; out aPosition: Integer);
|
||||||
//
|
//
|
||||||
|
|
@ -211,12 +212,7 @@ begin
|
||||||
fClient.Execute;
|
fClient.Execute;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCEDcdWrapper.getComplAtCursor(aList: TStrings);
|
procedure TCEDcdWrapper.getCallTip(out tips: string);
|
||||||
var
|
|
||||||
i, j: NativeInt;
|
|
||||||
kind: Char;
|
|
||||||
item: string;
|
|
||||||
asComp, asTips: boolean;
|
|
||||||
begin
|
begin
|
||||||
if not fAvailable then exit;
|
if not fAvailable then exit;
|
||||||
if fDoc = nil then exit;
|
if fDoc = nil then exit;
|
||||||
|
|
@ -233,14 +229,38 @@ begin
|
||||||
//
|
//
|
||||||
fTempLines.LoadFromStream(fClient.Output);
|
fTempLines.LoadFromStream(fClient.Output);
|
||||||
if fTempLines.Count = 0 then exit;
|
if fTempLines.Count = 0 then exit;
|
||||||
|
if not (fTempLines.Strings[0] = 'calltips') then exit;
|
||||||
//
|
//
|
||||||
asComp := fTempLines.Strings[0] = 'identifiers';
|
fTempLines.Delete(0);
|
||||||
asTips := fTempLines.Strings[0] = 'calltips';
|
tips := fTempLines.Text;
|
||||||
if asTips then exit;
|
tips := tips[1..length(tips)-2];
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEDcdWrapper.getComplAtCursor(aList: TStrings);
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
|
kind: Char;
|
||||||
|
item: string;
|
||||||
|
begin
|
||||||
|
if not fAvailable then exit;
|
||||||
|
if fDoc = nil then exit;
|
||||||
|
//
|
||||||
|
fTempLines.Assign(fDoc.Lines);
|
||||||
|
fTempLines.SaveToFile(fDoc.tempFilename);
|
||||||
|
//
|
||||||
|
terminateClient;
|
||||||
|
fClient.Parameters.Clear;
|
||||||
|
fClient.Parameters.Add('-c');
|
||||||
|
fClient.Parameters.Add(intToStr(fDoc.SelStart - 1));
|
||||||
|
fClient.Parameters.Add(fDoc.tempFilename);
|
||||||
|
fClient.Execute;
|
||||||
|
//
|
||||||
|
fTempLines.LoadFromStream(fClient.Output);
|
||||||
|
if fTempLines.Count = 0 then exit;
|
||||||
|
if not (fTempLines.Strings[0] = 'identifiers') then exit;
|
||||||
//
|
//
|
||||||
if asComp then j := 1 else j := 0;
|
|
||||||
aList.Clear;
|
aList.Clear;
|
||||||
for i := j to fTempLines.Count-1 do
|
for i := 1 to fTempLines.Count-1 do
|
||||||
begin
|
begin
|
||||||
item := fTempLines.Strings[i];
|
item := fTempLines.Strings[i];
|
||||||
kind := item[length(item)];
|
kind := item[length(item)];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue