mirror of https://github.com/buggins/dlangide.git
add dub.sdl project format support - implement #170
This commit is contained in:
parent
d15446273c
commit
f8fcf03f23
2
dub.json
2
dub.json
|
@ -12,7 +12,7 @@
|
||||||
"stringImportPaths": ["views", "views/res", "views/res/i18n", "views/res/mdpi", "views/res/hdpi"],
|
"stringImportPaths": ["views", "views/res", "views/res/i18n", "views/res/mdpi", "views/res/hdpi"],
|
||||||
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"dlangui": "==0.9.33",
|
"dlangui": "==0.9.36",
|
||||||
"dcd": "~>0.9.0-alpha4"
|
"dcd": "~>0.9.0-alpha4"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ immutable dstring DLANGIDE_VERSION = "v0.6.19"d;
|
||||||
|
|
||||||
bool isSupportedSourceTextFileFormat(string filename) {
|
bool isSupportedSourceTextFileFormat(string filename) {
|
||||||
return (filename.endsWith(".d") || filename.endsWith(".txt") || filename.endsWith(".cpp") || filename.endsWith(".h") || filename.endsWith(".c")
|
return (filename.endsWith(".d") || filename.endsWith(".txt") || filename.endsWith(".cpp") || filename.endsWith(".h") || filename.endsWith(".c")
|
||||||
|| filename.endsWith(".json") || filename.endsWith(".dd") || filename.endsWith(".ddoc") || filename.endsWith(".xml") || filename.endsWith(".html")
|
|| filename.endsWith(".json") || filename.endsWith(".sdl") || filename.endsWith(".dd") || filename.endsWith(".ddoc") || filename.endsWith(".xml") || filename.endsWith(".html")
|
||||||
|| filename.endsWith(".html") || filename.endsWith(".css") || filename.endsWith(".log") || filename.endsWith(".hpp"));
|
|| filename.endsWith(".html") || filename.endsWith(".css") || filename.endsWith(".log") || filename.endsWith(".hpp"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -861,6 +861,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
|
||||||
FileDialog dlg = new FileDialog(caption, window, null);
|
FileDialog dlg = new FileDialog(caption, window, null);
|
||||||
dlg.filetypeIcons[".d"] = "text-d";
|
dlg.filetypeIcons[".d"] = "text-d";
|
||||||
dlg.filetypeIcons["dub.json"] = "project-d";
|
dlg.filetypeIcons["dub.json"] = "project-d";
|
||||||
|
dlg.filetypeIcons["dub.sdl"] = "project-d";
|
||||||
dlg.filetypeIcons["package.json"] = "project-d";
|
dlg.filetypeIcons["package.json"] = "project-d";
|
||||||
dlg.filetypeIcons[".dlangidews"] = "project-development";
|
dlg.filetypeIcons[".dlangidews"] = "project-development";
|
||||||
return dlg;
|
return dlg;
|
||||||
|
@ -888,7 +889,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
|
||||||
UIString caption;
|
UIString caption;
|
||||||
caption = "Open Text File"d;
|
caption = "Open Text File"d;
|
||||||
FileDialog dlg = createFileDialog(caption);
|
FileDialog dlg = createFileDialog(caption);
|
||||||
dlg.addFilter(FileFilterEntry(UIString("Source files"d), "*.d;*.dd;*.ddoc;*.di;*.dh;*.json;*.xml;*.ini"));
|
dlg.addFilter(FileFilterEntry(UIString("Source files"d), "*.d;*.dd;*.ddoc;*.di;*.dh;*.json;*.sdl;*.xml;*.ini"));
|
||||||
dlg.addFilter(FileFilterEntry(UIString("All files"d), "*.*"));
|
dlg.addFilter(FileFilterEntry(UIString("All files"d), "*.*"));
|
||||||
dlg.path = _settings.getRecentPath("FILE_OPEN_PATH");
|
dlg.path = _settings.getRecentPath("FILE_OPEN_PATH");
|
||||||
dlg.dialogResult = delegate(Dialog d, const Action result) {
|
dlg.dialogResult = delegate(Dialog d, const Action result) {
|
||||||
|
@ -966,7 +967,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
|
||||||
UIString caption;
|
UIString caption;
|
||||||
caption = "Open Workspace or Project"d;
|
caption = "Open Workspace or Project"d;
|
||||||
FileDialog dlg = createFileDialog(caption);
|
FileDialog dlg = createFileDialog(caption);
|
||||||
dlg.addFilter(FileFilterEntry(UIString("Workspace and project files"d), "*.dlangidews;dub.json;package.json"));
|
dlg.addFilter(FileFilterEntry(UIString("Workspace and project files"d), "*.dlangidews;dub.json;dub.sdl;package.json"));
|
||||||
dlg.path = _settings.getRecentPath("FILE_OPEN_WORKSPACE_PATH");
|
dlg.path = _settings.getRecentPath("FILE_OPEN_WORKSPACE_PATH");
|
||||||
dlg.dialogResult = delegate(Dialog d, const Action result) {
|
dlg.dialogResult = delegate(Dialog d, const Action result) {
|
||||||
if (result.id == ACTION_OPEN.id) {
|
if (result.id == ACTION_OPEN.id) {
|
||||||
|
|
|
@ -14,7 +14,8 @@ import std.utf;
|
||||||
|
|
||||||
/// return true if filename matches rules for workspace file names
|
/// return true if filename matches rules for workspace file names
|
||||||
bool isProjectFile(in string filename) pure nothrow {
|
bool isProjectFile(in string filename) pure nothrow {
|
||||||
return filename.baseName.equal("dub.json") || filename.baseName.equal("package.json");
|
return filename.baseName.equal("dub.json") || filename.baseName.equal("DUB.JSON") || filename.baseName.equal("package.json") ||
|
||||||
|
filename.baseName.equal("dub.sdl") || filename.baseName.equal("DUB.SDL");
|
||||||
}
|
}
|
||||||
|
|
||||||
string toForwardSlashSeparator(in string filename) pure nothrow {
|
string toForwardSlashSeparator(in string filename) pure nothrow {
|
||||||
|
@ -824,6 +825,9 @@ class DubPackageFinder {
|
||||||
/// find package file (dub.json, package.json) in specified dir; returns absoulute path to found file or null if not found
|
/// find package file (dub.json, package.json) in specified dir; returns absoulute path to found file or null if not found
|
||||||
static string findPackageFile(string pathName) {
|
static string findPackageFile(string pathName) {
|
||||||
string fn = buildNormalizedPath(pathName, "dub.json");
|
string fn = buildNormalizedPath(pathName, "dub.json");
|
||||||
|
if (fn.exists && fn.isFile)
|
||||||
|
return fn;
|
||||||
|
fn = buildNormalizedPath(pathName, "dub.sdl");
|
||||||
if (fn.exists && fn.isFile)
|
if (fn.exists && fn.isFile)
|
||||||
return fn;
|
return fn;
|
||||||
fn = buildNormalizedPath(pathName, "package.json");
|
fn = buildNormalizedPath(pathName, "package.json");
|
||||||
|
|
Loading…
Reference in New Issue