mirror of https://gitlab.com/basile.b/dexed.git
fix #40 - allow detection of filename for errors messages when building dmd
This commit is contained in:
parent
d646b8c296
commit
9ee7f4daab
|
@ -1239,6 +1239,9 @@ var
|
||||||
i: integer = 0;
|
i: integer = 0;
|
||||||
ident: string = '';
|
ident: string = '';
|
||||||
absName: string;
|
absName: string;
|
||||||
|
nsr: string;
|
||||||
|
const
|
||||||
|
nonStandardRoot: array [0..3] of string = ('src', 'source', 'sources', 'import');
|
||||||
begin
|
begin
|
||||||
result := false;
|
result := false;
|
||||||
while (true) do
|
while (true) do
|
||||||
|
@ -1265,15 +1268,25 @@ begin
|
||||||
getMultiDocHandler.openDocument(ident);
|
getMultiDocHandler.openDocument(ident);
|
||||||
exit(true);
|
exit(true);
|
||||||
end;
|
end;
|
||||||
// if fname relative to project path
|
|
||||||
if fProj <> nil then
|
if fProj <> nil then
|
||||||
begin
|
begin
|
||||||
|
// if fname relative to project path
|
||||||
absName := expandFilenameEx(fProj.filename.extractFileDir + DirectorySeparator, ident);
|
absName := expandFilenameEx(fProj.filename.extractFileDir + DirectorySeparator, ident);
|
||||||
if absName.fileExists then
|
if absName.fileExists then
|
||||||
begin
|
begin
|
||||||
getMultiDocHandler.openDocument(absName);
|
getMultiDocHandler.openDocument(absName);
|
||||||
exit(true);
|
exit(true);
|
||||||
end;
|
end;
|
||||||
|
for nsr in nonStandardRoot do
|
||||||
|
begin
|
||||||
|
// if fname is relative to <project path>/<nsr>
|
||||||
|
absName := expandFilenameEx(fProj.filename.extractFileDir + DirectorySeparator + nsr + DirectorySeparator, ident);
|
||||||
|
if absName.fileExists then
|
||||||
|
begin
|
||||||
|
getMultiDocHandler.openDocument(absName);
|
||||||
|
exit(true);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
// finally try using pwd ...
|
// finally try using pwd ...
|
||||||
absName := expandFilenameEx(GetCurrentDir, ident);
|
absName := expandFilenameEx(GetCurrentDir, ident);
|
||||||
|
|
Loading…
Reference in New Issue