mirror of https://gitlab.com/basile.b/dexed.git
completion, partial support for subpackages used as dependencies
This commit is contained in:
parent
8c77c2caa3
commit
3052ea97fe
|
@ -5,6 +5,7 @@
|
||||||
- messages, search results: exclude backticks if the option _backTicksHighlight_ is enabled.
|
- messages, search results: exclude backticks if the option _backTicksHighlight_ is enabled.
|
||||||
- GDB commander: double click on the call stack to select a frame and refresh the different views.
|
- GDB commander: double click on the call stack to select a frame and refresh the different views.
|
||||||
This is especially useful to go back to the frame where a D Exception is thrown. (#52)
|
This is especially useful to go back to the frame where a D Exception is thrown. (#52)
|
||||||
|
- completion: partial support for dependencies of type _package:subpackage_.
|
||||||
|
|
||||||
## Bugs fixed
|
## Bugs fixed
|
||||||
|
|
||||||
|
|
|
@ -1568,6 +1568,11 @@ procedure TDubProject.updateImportPathsFromJson;
|
||||||
x: integer;
|
x: integer;
|
||||||
c: TJSONObject;
|
c: TJSONObject;
|
||||||
b: TStringList;
|
b: TStringList;
|
||||||
|
y: TStringList;
|
||||||
|
a: TJSONArray;
|
||||||
|
z: integer;
|
||||||
|
m: string;
|
||||||
|
w: string = '';
|
||||||
begin
|
begin
|
||||||
if obj.findObject('dependencies' + suffix, deps) then
|
if obj.findObject('dependencies' + suffix, deps) then
|
||||||
begin
|
begin
|
||||||
|
@ -1585,20 +1590,25 @@ procedure TDubProject.updateImportPathsFromJson;
|
||||||
begin
|
begin
|
||||||
// in case something has to be done with the subpackage...
|
// in case something has to be done with the subpackage...
|
||||||
// c := subPackage[n[x + 1 .. n.length]];
|
// c := subPackage[n[x + 1 .. n.length]];
|
||||||
continue;
|
//continue;
|
||||||
|
w := n[x + 1 .. n.length];
|
||||||
|
n := n[1 .. x-1];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// local path specified
|
// local path specified
|
||||||
if deps.findObject(n, c) and c.findAny('path', j) then
|
if (deps.findObject(n, c) or deps.findObject(n + ':' + w, c)) and
|
||||||
|
c.findAny('path', j) then
|
||||||
begin
|
begin
|
||||||
s := expandFilenameEx(fBasePath, j.AsString) + DirectorySeparator;
|
s := expandFilenameEx(fBasePath, j.AsString) + DirectorySeparator;
|
||||||
|
if length(w) <> 0 then
|
||||||
|
s += w;
|
||||||
// as auto detected by DUB
|
// as auto detected by DUB
|
||||||
if (s + 'source').dirExists then
|
if (s + 'source').dirExists then
|
||||||
fImportPaths.Add(s)
|
fImportPaths.Add(s)
|
||||||
else if (s + 'src').dirExists then
|
else if (s + 'src').dirExists then
|
||||||
fImportPaths.Add(s)
|
fImportPaths.Add(s)
|
||||||
// when standard src content is directly in the repo root
|
// when standard src content is directly in the repo root
|
||||||
else if (s + n).dirExists then
|
else if (s + n).dirExists or (w.length <> 0) then
|
||||||
fImportPaths.Add(s);
|
fImportPaths.Add(s);
|
||||||
continue;
|
continue;
|
||||||
end;
|
end;
|
||||||
|
@ -1689,6 +1699,11 @@ procedure TDubProject.updateImportPathsFromJson;
|
||||||
begin
|
begin
|
||||||
s := b[k] + n;
|
s := b[k] + n;
|
||||||
p := s + '-' + u^.asString + DirectorySeparator + n + DirectorySeparator;
|
p := s + '-' + u^.asString + DirectorySeparator + n + DirectorySeparator;
|
||||||
|
// e.g vibe-d:http -> <registrypath>/vibed-<sember>/http
|
||||||
|
if length(w) <> 0 then
|
||||||
|
p += w;
|
||||||
|
if not p.dirExists then
|
||||||
|
continue;
|
||||||
if (p + 'source').dirExists then
|
if (p + 'source').dirExists then
|
||||||
begin
|
begin
|
||||||
fImportPaths.Add(p + 'source') ;
|
fImportPaths.Add(p + 'source') ;
|
||||||
|
@ -1698,6 +1713,45 @@ procedure TDubProject.updateImportPathsFromJson;
|
||||||
begin
|
begin
|
||||||
fImportPaths.Add(p + 'src');
|
fImportPaths.Add(p + 'src');
|
||||||
break;
|
break;
|
||||||
|
end
|
||||||
|
else if p.dirExists and (w.length <> 0) then
|
||||||
|
begin
|
||||||
|
fImportPaths.Add(p);
|
||||||
|
break;
|
||||||
|
end
|
||||||
|
// non standard path, external subpackages receipts, search "sourcePaths"
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
y := TStringList.Create();
|
||||||
|
try
|
||||||
|
listFiles(y, p, true);
|
||||||
|
for s in y do
|
||||||
|
begin
|
||||||
|
if not isValidDubProject(s) then
|
||||||
|
continue;
|
||||||
|
EntitiesConnector.beginUpdate();
|
||||||
|
try
|
||||||
|
with TDubProject.create(nil) do
|
||||||
|
try
|
||||||
|
loadFromFile(s);
|
||||||
|
if json.findArray('sourcePaths', a) then
|
||||||
|
begin
|
||||||
|
for z := 0 to a.Count-1 do
|
||||||
|
begin
|
||||||
|
m := p + a.Strings[z];
|
||||||
|
fImportPaths.Add(m);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
free;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
EntitiesConnector.endUpdate;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
y.free;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
Loading…
Reference in New Issue