mirror of https://gitlab.com/basile.b/dexed.git
solve a problem with order of initialization
This commit is contained in:
parent
a0911a95ef
commit
1d4c64da23
|
@ -61,7 +61,7 @@ type
|
||||||
//
|
//
|
||||||
procedure addImportFolders(const folders: TStrings);
|
procedure addImportFolders(const folders: TStrings);
|
||||||
procedure addImportFolder(const folder: string);
|
procedure addImportFolder(const folder: string);
|
||||||
procedure getComplAtCursor(list: TStrings);
|
procedure getComplAtCursor(list: TStringList);
|
||||||
procedure getCallTip(out tips: string);
|
procedure getCallTip(out tips: string);
|
||||||
procedure getDdocFromCursor(out comment: string);
|
procedure getDdocFromCursor(out comment: string);
|
||||||
procedure getDeclFromCursor(out fname: string; out position: Integer);
|
procedure getDeclFromCursor(out fname: string; out position: Integer);
|
||||||
|
@ -70,11 +70,13 @@ type
|
||||||
property available: boolean read fAvailable;
|
property available: boolean read fAvailable;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
function DCDWrapper: TCEDcdWrapper;
|
||||||
DcdWrapper: TCEDcdWrapper;
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
var
|
||||||
|
fDcdWrapper: TCEDcdWrapper = nil;
|
||||||
|
|
||||||
const
|
const
|
||||||
clientName = 'dcd-client' + exeExt;
|
clientName = 'dcd-client' + exeExt;
|
||||||
serverName = 'dcd-server' + exeExt;
|
serverName = 'dcd-server' + exeExt;
|
||||||
|
@ -402,7 +404,21 @@ begin
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCEDcdWrapper.getComplAtCursor(list: TStrings);
|
function compareknd(List: TStringList; Index1, Index2: Integer): Integer;
|
||||||
|
var
|
||||||
|
k1, k2: byte;
|
||||||
|
begin
|
||||||
|
k1 := Byte(PtrUint(List.Objects[Index1]));
|
||||||
|
k2 := Byte(PtrUint(List.Objects[Index2]));
|
||||||
|
if k1 > k2 then
|
||||||
|
result := 1
|
||||||
|
else if k1 < k2 then
|
||||||
|
result := -1
|
||||||
|
else
|
||||||
|
result := CompareStr(list[Index1], list[Index2]);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEDcdWrapper.getComplAtCursor(list: TStringList);
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
kind: Char;
|
kind: Char;
|
||||||
|
@ -454,12 +470,12 @@ begin
|
||||||
'l': kindObj := TObject(PtrUint(dckAlias));
|
'l': kindObj := TObject(PtrUint(dckAlias));
|
||||||
't': kindObj := TObject(PtrUint(dckTemplate));
|
't': kindObj := TObject(PtrUint(dckTemplate));
|
||||||
'T': kindObj := TObject(PtrUint(dckMixin));
|
'T': kindObj := TObject(PtrUint(dckMixin));
|
||||||
// see https://github.com/Hackerpilot/dsymbol/blob/master/src/dsymbol/symbol.d#L47
|
|
||||||
// internal DCD stuff, Should not to happen...report bug if it does.
|
// internal DCD stuff, Should not to happen...report bug if it does.
|
||||||
'*', '?': continue;
|
'*', '?': continue;
|
||||||
end;
|
end;
|
||||||
list.AddObject(item, kindObj);
|
list.AddObject(item, kindObj);
|
||||||
end;
|
end;
|
||||||
|
//list.CustomSort(@compareknd);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCEDcdWrapper.getDdocFromCursor(out comment: string);
|
procedure TCEDcdWrapper.getDdocFromCursor(out comment: string);
|
||||||
|
@ -583,8 +599,13 @@ begin
|
||||||
end;
|
end;
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
|
||||||
initialization
|
function DCDWrapper: TCEDcdWrapper;
|
||||||
DcdWrapper := TCEDcdWrapper.create(nil);
|
begin
|
||||||
|
if fDcdWrapper.isNil then
|
||||||
|
fDcdWrapper := TCEDcdWrapper.create(nil);
|
||||||
|
exit(fDcdWrapper);
|
||||||
|
end;
|
||||||
|
|
||||||
finalization
|
finalization
|
||||||
DcdWrapper.Free;
|
DcdWrapper.Free;
|
||||||
end.
|
end.
|
||||||
|
|
Loading…
Reference in New Issue