symbol list, CPP is working to make DUB messages clickable.
still TODO in ce_dubproject to expose fsources file names
This commit is contained in:
Basile Burg 2015-09-01 16:37:51 +02:00
parent d373a15012
commit d1c255d44b
1 changed files with 35 additions and 60 deletions

View File

@ -145,72 +145,57 @@ end;
{$REGION Symbol things ---------------------------------------------------------} {$REGION Symbol things ---------------------------------------------------------}
procedure TCESymbolExpander.updateSymbols; procedure TCESymbolExpander.updateSymbols;
var var
hasProj: boolean; hasNativeProj: boolean;
hasProjItf: boolean;
hasDoc: boolean; hasDoc: boolean;
fname: string; fname: string;
i: Integer; i: Integer;
e: TCESymbol;
str: TStringList; str: TStringList;
const const
na = '``'; na = '``';
begin begin
if not fNeedUpdate then exit; if not fNeedUpdate then exit;
fNeedUpdate := false; fNeedUpdate := false;
hasProj := fProj <> nil; //
hasNativeProj := fProj <> nil;
hasProjItf := fProjInterface <> nil;
hasDoc := fDoc <> nil; hasDoc := fDoc <> nil;
//
for e := low(TCESymbol) to high(TCESymbol) do
fSymbols[e] := na;
//
// application // application
fSymbols[CAF] := Application.ExeName; fSymbols[CAF] := Application.ExeName;
fSymbols[CAP] := ExtractFilePath(Application.ExeName); fSymbols[CAP] := ExtractFilePath(fSymbols[CAF]);
// document // document
if hasDoc then if hasDoc then
begin begin
if fileExists(fDoc.fileName) then if not fileExists(fDoc.fileName) then
begin fDoc.saveTempFile;
fSymbols[CFF] := fDoc.fileName; fSymbols[CFF] := fDoc.fileName;
fSymbols[CFP] := ExtractFilePath(fDoc.fileName); fSymbols[CFP] := ExtractFilePath(fDoc.fileName);
end
else
begin
fSymbols[CFF] := na;
fSymbols[CFP] := na;
end;
if fDoc.Identifier <> '' then if fDoc.Identifier <> '' then
fSymbols[CI] := fDoc.Identifier fSymbols[CI] := fDoc.Identifier;
else
fSymbols[CI] := na;
end
else
begin
fSymbols[CFF] := na;
fSymbols[CFP] := na;
fSymbols[CI] := na;
end; end;
// project // project interface
if hasProj then if hasProjItf then
begin
fSymbols[CPF] := fProjInterface.getFilename;
fSymbols[CPP] := ExtractFilePath(fSymbols[CPF]);
fSymbols[CPN] := stripFileExt(extractFileName(fSymbols[CPF]));
end;
// TODO-cDUB: move to upper block expansion of CPO, CPFS & CPCD when implemented in ICECOmmonProject
if hasNativeProj then
begin begin
if fileExists(fProj.fileName) then if fileExists(fProj.fileName) then
begin begin
fSymbols[CPF] := fProjInterface.getFilename;
fSymbols[CPP] := ExtractFilePath(fProjInterface.getFilename);
fSymbols[CPR] := fProj.getAbsoluteFilename(fProj.RootFolder); fSymbols[CPR] := fProj.getAbsoluteFilename(fProj.RootFolder);
fSymbols[CPN] := stripFileExt(extractFileName(fProj.fileName));
fSymbols[CPO] := fProj.getOutputFilename; fSymbols[CPO] := fProj.getOutputFilename;
if fSymbols[CPR] = '' then if fSymbols[CPR] = '' then
fSymbols[CPR] := fSymbols[CPP]; fSymbols[CPR] := fSymbols[CPP];
end
else
begin
fSymbols[CPF] := na;
fSymbols[CPP] := na;
fSymbols[CPR] := na;
fSymbols[CPN] := na;
fSymbols[CPO] := na;
end; end;
if fProj.Sources.Count = 0 then if fProj.Sources.Count <> 0 then
begin
fSymbols[CPFS] := na;
fSymbols[CPCD] := na;
end
else
begin begin
str := TStringList.Create; str := TStringList.Create;
try try
@ -230,16 +215,6 @@ begin
str.Free; str.Free;
end; end;
end; end;
end
else
begin
fSymbols[CPF] := na;
fSymbols[CPP] := na;
fSymbols[CPR] := na;
fSymbols[CPN] := na;
fSymbols[CPO] := na;
fSymbols[CPFS] := na;
fSymbols[CPCD] := na;
end; end;
end; end;