mirror of https://github.com/buggins/dlangide.git
add dependency projects to import paths when running DCD
This commit is contained in:
parent
cadd2abf84
commit
fc419405ea
|
@ -72,7 +72,7 @@
|
||||||
<debuglevel>0</debuglevel>
|
<debuglevel>0</debuglevel>
|
||||||
<debugids>DebugInfo DCD</debugids>
|
<debugids>DebugInfo DCD</debugids>
|
||||||
<versionlevel>0</versionlevel>
|
<versionlevel>0</versionlevel>
|
||||||
<versionids>Unicode USE_FREETYPE USE_LIBDPARSE USE_MAGO</versionids>
|
<versionids>Unicode USE_FREETYPE</versionids>
|
||||||
<dump_source>0</dump_source>
|
<dump_source>0</dump_source>
|
||||||
<mapverbosity>3</mapverbosity>
|
<mapverbosity>3</mapverbosity>
|
||||||
<createImplib>0</createImplib>
|
<createImplib>0</createImplib>
|
||||||
|
|
|
@ -83,7 +83,7 @@ class DSourceEdit : SourceEdit {
|
||||||
/// returns project import paths - if file from project is opened in current editor
|
/// returns project import paths - if file from project is opened in current editor
|
||||||
string[] importPaths() {
|
string[] importPaths() {
|
||||||
if (_projectSourceFile)
|
if (_projectSourceFile)
|
||||||
return _projectSourceFile.project.sourcePaths ~ _projectSourceFile.project.builderSourcePaths;
|
return _projectSourceFile.project.importPaths;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -259,6 +259,29 @@ class Project : WorkspaceItem {
|
||||||
return _builderSourcePaths;
|
return _builderSourcePaths;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void addUnique(ref string[] dst, string[] items) {
|
||||||
|
foreach(item; items) {
|
||||||
|
bool found = false;
|
||||||
|
foreach(existing; dst) {
|
||||||
|
if (item.equal(existing)) {
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
dst ~= item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@property string[] importPaths() {
|
||||||
|
string[] res;
|
||||||
|
addUnique(res, sourcePaths);
|
||||||
|
addUnique(res, builderSourcePaths);
|
||||||
|
foreach(dep; _dependencies) {
|
||||||
|
addUnique(res, dep.sourcePaths);
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
string relativeToAbsolutePath(string path) {
|
string relativeToAbsolutePath(string path) {
|
||||||
if (isAbsolute(path))
|
if (isAbsolute(path))
|
||||||
return path;
|
return path;
|
||||||
|
|
Loading…
Reference in New Issue