Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,7 @@ Version history
* miscellaneous
- Issue 18622: removed outdated information regarding link definition when generated by Visual D DLL project.

unreleased Version 0.48.0
2018-12-02 Version 0.48.0

* installation
- installer and binaries now digitally signed by the "D Language Foundation"
Expand Down Expand Up @@ -1055,3 +1055,19 @@ unreleased Version 0.48.0
- added option to not indent case statements
* fixed "Compile and Run" on selection
* fix help via F1 for dmd 2.072+

2018-12-22 Version 0.48.1
* dparser:
- fix Issue 19411: increase stack size for DParserCOMServer
- goto definition on alias: jump to base definition if caret on alias
* build system
- fix Issue 19445: Linking to lib under "c:\Program Files (x86)" does not work in Visual D
* dustmite
- fix copying project for dustmite with relative paths
- move command line options to new setup page, add dustmite command line options
* cv2pdb
- fix crash if mspdb*.dll cannot be loaded from path
- emit "elemtype[keytype]" instead of "dAssocArray"
- fix missing line numbers for new versions of mspdb (e.g. 14.16.27012/VS 15.9)
* mago: variables captured from stack of outer function not displayed in locals

1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ vdserver:

dparser:
cd vdc\abothe && $(MSBUILD15) vdserver.sln /p:Configuration=Release;Platform="Any CPU" /p:TargetFrameworkVersion=4.5 /p:DefineConstants=NET40 /t:Rebuild
editbin /STACK:0x800000 bin\Release\DParserCOMServer\DParserCOMServer.exe

dparser_test:
set PLATFORM="Any CPU" && dotnet test vdc\abothe\VDServer.sln -c Release
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define VERSION_MAJOR 0
#define VERSION_MINOR 48
#define VERSION_REVISION 0
#define VERSION_REVISION 1
#define VERSION_BETA
#define VERSION_BUILD 0
7 changes: 7 additions & 0 deletions doc/StartPage.dd
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ $(H2 News)
$(P $(LINK2 VersionHistory.html, Full version history and complete details...)
)

2018-12-22 Version 0.48.1
$(UL
$(LI goto definition on alias: jump to base definition if caret on alias)
$(LI cv2pdb: fix missing line numbers for new versions of mspdb*.dll)
$(LI mago: variables captured from stack of outer function not displayed in locals)
)

2018-12-02 Version 0.48.0
$(UL
$(LI installer and binaries now digitally signed by the "D Language Foundation")
Expand Down
29 changes: 29 additions & 0 deletions doc/VersionHistory.dd
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
Ddoc

$(H2 2018-12-22 Version 0.48.1)
$(UL
$(LI dparser:
$(UL
$(LI fix Issue 19411: increase stack size for DParserCOMServer)
$(LI goto definition on alias: jump to base definition if caret on alias)
))
$(LI build system
$(UL
$(LI fix Issue 19445: Linking to lib under "c:\Program Files (x86)" does not work in Visual D)
))
$(LI dustmite
$(UL
$(LI fix copying project for dustmite with relative paths)
$(LI move command line options to new setup page, add dustmite command line options)
))
$(LI cv2pdb
$(UL
$(LI fix crash if mspdb*.dll cannot be loaded from path)
$(LI emit "elemtype[keytype]" instead of "dAssocArray")
$(LI fix missing line numbers for new versions of mspdb*.dll (e.g. 14.16.27012/VS 15.9))
))
$(LI mago
$(UL
$(LI variables captured from stack of outer function not displayed in locals)
))
)


$(H2 2018-12-02 Version 0.48.0)
$(UL
$(LI installation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ protected override Tuple<CodeLocation, CodeLocation, string> Process(EditorData
var definitionSourceFilename = new StringBuilder();
if (rr != null)
{
var at = rr as AliasedType;
if (at != null && at.Definition.Location == sr.Location)
rr = at.Base;
DNode n = null;
foreach (var t in AmbiguousType.TryDissolve(rr))
{
Expand Down
3 changes: 2 additions & 1 deletion visuald/chiernode.d
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ class CHierNode : DisposingDispatchObject
{
static void shared_static_this()
{
gVsItemMap_sync = new Object;
if (!gVsItemMap_sync)
gVsItemMap_sync = new Object;
}

this()
Expand Down
1 change: 1 addition & 0 deletions visuald/config.d
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,7 @@ class ProjectOptions
string s;
foreach(i, file; lnkfiles)
{
file = unquoteArgument(file);
if(toLower(extension(file)) != ext)
continue;
if(s.length > 0)
Expand Down
5 changes: 5 additions & 0 deletions visuald/dpackage.d
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,8 @@ class Package : DisposingComObject,
tpp = newCom!LdcDirPropertyPage(mOptions);
else if(*rguidPage == g_DubPropertyPage)
tpp = newCom!DubPropertyPage(mOptions);
else if(*rguidPage == g_CmdLinePropertyPage)
tpp = newCom!CmdLinePropertyPage(mOptions);
else if(*rguidPage == g_ToolsProperty2Page)
tpp = newCom!ToolsProperty2Page(mOptions);
else if(*rguidPage == g_ColorizerPropertyPage)
Expand Down Expand Up @@ -1353,6 +1355,7 @@ class GlobalOptions
string compileAndRunOpts;
string compileAndDbgOpts;
int compileAndDbgEngine;
string dustmiteOpts;

string[] coverageBuildDirs;
string[] coverageExecutionDirs;
Expand Down Expand Up @@ -1837,6 +1840,7 @@ class GlobalOptions
compileAndRunOpts = getStringOpt("compileAndRunOpts", "-unittest");
compileAndDbgOpts = getStringOpt("compileAndDbgOpts", "-g");
compileAndDbgEngine = getIntOpt("compileAndDbgEngine", 0);
dustmiteOpts = getStringOpt("dustmiteOpts", "--strip-comments --split *.bat:lines");

dubPath = getStringOpt("dubPath", "dub");
dubOptions = getStringOpt("dubOptions", "");
Expand Down Expand Up @@ -1961,6 +1965,7 @@ class GlobalOptions
keyToolOpts.Set("compileAndRunOpts", toUTF16(compileAndRunOpts));
keyToolOpts.Set("compileAndDbgOpts", toUTF16(compileAndDbgOpts));
keyToolOpts.Set("compileAndDbgEngine", compileAndDbgEngine);
keyToolOpts.Set("dustmiteOpts", toUTF16(dustmiteOpts));

keyToolOpts.Set("coverageExecutionDirs", toUTF16(join(coverageExecutionDirs, ";")));
keyToolOpts.Set("coverageBuildDirs", toUTF16(join(coverageBuildDirs, ";")));
Expand Down
48 changes: 44 additions & 4 deletions visuald/dproject.d
Original file line number Diff line number Diff line change
Expand Up @@ -2798,7 +2798,7 @@ HRESULT DustMiteProject()
if (msgRet != IDYES)
return S_FALSE;

string workdir = cfg.GetProjectDir();
string workdir = normalizeDir(cfg.GetProjectDir());

auto pane = getVisualDOutputPane();
scope(exit) release(pane);
Expand All @@ -2822,7 +2822,9 @@ HRESULT DustMiteProject()
}
pane.OutputString(_toUTF16z("created clean copy of the project in " ~ dustmitepath ~ "\n"));

nworkdir = npath; // TODO
auto reldir = makeRelative(workdir, commonpath);
npath = makeDirnameCanonical(npath, null);
nworkdir = makeDirnameCanonical(reldir, npath);
string nintdir = makeFilenameAbsolute(cfg.GetIntermediateDir(), nworkdir);
string noutdir = makeFilenameAbsolute(cfg.GetOutDir(), nworkdir);
mkdirRecurse(nworkdir);
Expand All @@ -2833,7 +2835,7 @@ HRESULT DustMiteProject()
std.file.write(normalizeDir(noutdir) ~ "empty.txt", "");

if (nworkdir != npath)
cmdline ~= "cd " ~ quoteFilename(makeRelative(nworkdir, npath));
cmdline ~= "cd " ~ quoteFilename(makeRelative(nworkdir, npath)) ~ "\n";
cmdline ~= cfg.getCommandLine(true, true, false);
cmdfile = npath ~ "build.dustmite.bat";
std.file.write(cmdfile, cmdline);
Expand All @@ -2844,7 +2846,7 @@ HRESULT DustMiteProject()
string intdir = makeFilenameAbsolute(cfg.GetIntermediateDir(), workdir);
mkdirRecurse(intdir);
dustfile = intdir ~ "\\dustmite.cmd";
string opts = "--strip-comments --split *.bat:lines";
string opts = Package.GetGlobalOptions().dustmiteOpts;
cmd = Package.GetGlobalOptions().findDmdBinDir() ~ "dustmite " ~ opts ~ " " ~ quoteFilename(npath[0..$-1]) ~ " \"" ~ dustcmd ~ "\"";
std.file.write(dustfile, cmd ~ "\npause\n");
std.process.spawnShell(quoteFilename(dustfile), null, std.process.Config.none, nworkdir);
Expand Down Expand Up @@ -2876,3 +2878,41 @@ class DustMiteThread : CBuilderThread

string mBuildDir;
}

unittest
{
CHierNode.shared_static_this();
Package pkg = newCom!Package.addref();
scope(exit) pkg.release();
string tmpdir = normalizeDir(tempDir());
string projdir = tmpdir ~ "test/dustmite/project/";
string projfile = projdir ~ "project.vdproj";
string platform = "Win32", config = "Debug";
auto cfg = newCom!VCConfig(projfile, "test", platform, config);

Project prj = newCom!Project(Package.GetProjectFactory(), "test", projfile, platform, config);

mkdirRecurse(projdir);
string dfile1 = projdir ~ "dfile1.d";
std.file.write(dfile1, "// dfile1\n");
auto pFile1 = newCom!CFileNode("dfile1.d");
prj.GetRootNode().AddTail(pFile1);

mkdirRecurse(tmpdir ~ "test/dustmite/other");
string dfile2 = tmpdir ~ "test/dustmite/other/dfile2.d";
std.file.write(dfile2, "// dfile2\n");
auto pFile2 = newCom!CFileNode("../other/dfile2.d");
prj.GetRootNode().AddTail(pFile2);

string commonpath = commonProjectFolder(prj);
string dustmitepath = buildPath(dirName(commonpath), baseName(commonpath) ~ ".dustmite");
assert(dustmitepath == tmpdir ~ r"test\dustmite.dustmite");
if (std.file.exists(dustmitepath))
rmdirRecurse(dustmitepath);

string npath = copyProjectFolder(prj, dustmitepath);
assert(npath == normalizeDir(dustmitepath));

assert(std.file.exists(dustmitepath ~ r"\project\dfile1.d"));
assert(std.file.exists(dustmitepath ~ r"\other\dfile2.d"));
}
2 changes: 1 addition & 1 deletion visuald/hierutil.d
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ string commonProjectFolder(Project proj)
searchNode(proj.GetRootNode(), delegate (CHierNode n)
{
if(CFileNode file = cast(CFileNode) n)
path = commonParentDir(path, makeFilenameAbsolute(file.GetFilename(), workdir));
path = commonParentDir(path, makeFilenameCanonical(file.GetFilename(), workdir));
return false;
});
return path;
Expand Down
4 changes: 2 additions & 2 deletions visuald/pkgutil.d
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ string _browseFile(T)(HWND parentHwnd, string title, string filter, string initd
auto rc = pIVsUIShell.GetSaveFileNameViaDlg(&ofn);

if (rc == S_OK)
return to!string(fileName);
return to_string(fileName.ptr);
}
return null;
}
Expand Down Expand Up @@ -208,7 +208,7 @@ string browseDirectory(HWND parentHwnd, string title, string initdir = null)
bi.nMaxDirName = dirName.length;
bi.pwzInitialDir = toUTF16z(initdir);
if (pIVsUIShell.GetDirectoryViaBrowseDlg(&bi) == S_OK)
return to!string(dirName);
return to_string(dirName.ptr);
}
return null;
}
Expand Down
63 changes: 49 additions & 14 deletions visuald/propertypage.d
Original file line number Diff line number Diff line change
Expand Up @@ -2261,6 +2261,53 @@ class LdcDirPropertyPage : DirPropertyPage
}
}

///////////////////////////////////////////////////////////////////////////////
class CmdLinePropertyPage : GlobalPropertyPage
{
this(GlobalOptions options)
{
super(options);
}

enum ID_DUBPATH = 1011;

override string GetCategoryName() { return "D Options"; }
override string GetPageName() { return "Compile/Run/Debug/Dustmite"; }

override void CreateControls()
{
AddTitleLine("Compile and Run/Debug");
AddControl("Compile+Run options", mCompileAndRunOpts = new Text(mCanvas));
AddControl("Compile+Debug options", mCompileAndDbgOpts = new Text(mCanvas));
AddControl(" Debugger", mCompileAndDbgEngine = new ComboBox(mCanvas, [ "Visual Studio", "Mago", "Visual Studio (x86 Mixed Mode)" ], false));
AddTitleLine("Dustmite");
AddControl("Command line options", mDustmiteOpts = new Text(mCanvas));
}

override void SetControls(GlobalOptions opts)
{
mCompileAndRunOpts.setText(opts.compileAndRunOpts);
mCompileAndDbgOpts.setText(opts.compileAndDbgOpts);
mCompileAndDbgEngine.setSelection(opts.compileAndDbgEngine);
mDustmiteOpts.setText(opts.dustmiteOpts);
}

override int DoApply(GlobalOptions opts, GlobalOptions refopts)
{
int changes = 0;
changes += changeOption(mCompileAndRunOpts.getText(), opts.compileAndRunOpts, refopts.compileAndRunOpts);
changes += changeOption(mCompileAndDbgOpts.getText(), opts.compileAndDbgOpts, refopts.compileAndDbgOpts);
changes += changeOption(mCompileAndDbgEngine.getSelection(), opts.compileAndDbgEngine, refopts.compileAndDbgEngine);
changes += changeOption(mDustmiteOpts.getText(), opts.dustmiteOpts, refopts.dustmiteOpts);
return changes;
}

Text mCompileAndRunOpts;
Text mCompileAndDbgOpts;
ComboBox mCompileAndDbgEngine;
Text mDustmiteOpts;
}

///////////////////////////////////////////////////////////////////////////////
class DubPropertyPage : GlobalPropertyPage
{
Expand Down Expand Up @@ -2322,7 +2369,7 @@ class ToolsProperty2Page : GlobalPropertyPage
this(GlobalOptions options)
{
super(options);
kNeededLines = 17;
kNeededLines = 13;
}

override void CreateControls()
Expand All @@ -2344,10 +2391,6 @@ class ToolsProperty2Page : GlobalPropertyPage
// new ComboBox(mCanvas, [ "Do not delete file on disk", "Ask", "Delete file on disk" ]));
mLinesPerMultiLine = 2;
AddControl("JSON paths", mJSNPath = new MultiLineText(mCanvas), 500);
AddTitleLine("Compile and Run/Debug");
AddControl("Compile+Run options", mCompileAndRunOpts = new Text(mCanvas));
AddControl("Compile+Debug options", mCompileAndDbgOpts = new Text(mCanvas));
AddControl(" Debugger", mCompileAndDbgEngine = new ComboBox(mCanvas, [ "Visual Studio", "Mago", "Visual Studio (x86 Mixed Mode)" ], false));
}

override void SetControls(GlobalOptions opts)
Expand All @@ -2364,9 +2407,6 @@ class ToolsProperty2Page : GlobalPropertyPage
//mDeleteFiles.setSelection(opts.deleteFiles + 1);
mIncPath.setText(opts.IncSearchPath);
mJSNPath.setText(opts.JSNSearchPath);
mCompileAndRunOpts.setText(opts.compileAndRunOpts);
mCompileAndDbgOpts.setText(opts.compileAndDbgOpts);
mCompileAndDbgEngine.setSelection(opts.compileAndDbgEngine);
}

override int DoApply(GlobalOptions opts, GlobalOptions refopts)
Expand All @@ -2384,9 +2424,6 @@ class ToolsProperty2Page : GlobalPropertyPage
//changes += changeOption(cast(byte) (mDeleteFiles.getSelection() - 1), opts.deleteFiles, refopts.deleteFiles);
changes += changeOption(mIncPath.getText(), opts.IncSearchPath, refopts.IncSearchPath);
changes += changeOption(mJSNPath.getText(), opts.JSNSearchPath, refopts.JSNSearchPath);
changes += changeOption(mCompileAndRunOpts.getText(), opts.compileAndRunOpts, refopts.compileAndRunOpts);
changes += changeOption(mCompileAndDbgOpts.getText(), opts.compileAndDbgOpts, refopts.compileAndDbgOpts);
changes += changeOption(mCompileAndDbgEngine.getSelection(), opts.compileAndDbgEngine, refopts.compileAndDbgEngine);
return changes;
}

Expand All @@ -2401,9 +2438,6 @@ class ToolsProperty2Page : GlobalPropertyPage
CheckBox mShowMemUsage;
//ComboBox mDeleteFiles;
Text mIncPath;
Text mCompileAndRunOpts;
Text mCompileAndDbgOpts;
ComboBox mCompileAndDbgEngine;
MultiLineText mJSNPath;
}

Expand Down Expand Up @@ -2711,6 +2745,7 @@ const GUID g_LinkerOutputPropertyPage = uuid("002a2de9-8bb6-484d-981d-7e4ad40
const GUID g_DmdDirPropertyPage = uuid("002a2de9-8bb6-484d-9820-7e4ad4084715");
const GUID g_GdcDirPropertyPage = uuid("002a2de9-8bb6-484d-9824-7e4ad4084715");
const GUID g_LdcDirPropertyPage = uuid("002a2de9-8bb6-484d-9825-7e4ad4084715");
const GUID g_CmdLinePropertyPage = uuid("002a2de9-8bb6-484d-9828-7e4ad4084715");
const GUID g_DubPropertyPage = uuid("002a2de9-8bb6-484d-9827-7e4ad4084715");
const GUID g_ToolsProperty2Page = uuid("002a2de9-8bb6-484d-9822-7e4ad4084715");

Expand Down
7 changes: 7 additions & 0 deletions visuald/register.d
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ static const wstring regPathToolsDirsOld = "\\ToolsOptionsPages\\Projects\\Vis
static const wstring regPathToolsDirsDmd = "\\ToolsOptionsPages\\Projects\\Visual D Settings\\DMD Directories"w;
static const wstring regPathToolsDirsGdc = "\\ToolsOptionsPages\\Projects\\Visual D Settings\\GDC Directories"w;
static const wstring regPathToolsDirsLdc = "\\ToolsOptionsPages\\Projects\\Visual D Settings\\LDC Directories"w;
static const wstring regPathToolsDirsCmd = "\\ToolsOptionsPages\\Projects\\Visual D Settings\\Compile/Run/Debug/Dustmite"w;
static const wstring regPathToolsDub = "\\ToolsOptionsPages\\Projects\\Visual D Settings\\DUB Options"w;
static const wstring regPathMagoOptions = "\\ToolsOptionsPages\\Debugger\\Mago"w;
static const wstring regMiscFiles = regPathProjects ~ "\\{A2FE74E1-B743-11d0-AE1A-00A0C90FFFC3}"w;
Expand Down Expand Up @@ -687,6 +688,12 @@ version(none){
keyToolOptsLdc.Set("Page"w, GUID2wstring(g_LdcDirPropertyPage));
keyToolOptsLdc.Set("Sort"w, 20);

scope RegKey keyToolOptsCmd = new RegKey(keyRoot, registrationRoot ~ regPathToolsDirsCmd);
keyToolOptsLdc.Set(null, "Compile/Run/Debug/Dustmite");
keyToolOptsLdc.Set("Package"w, packageGuid);
keyToolOptsLdc.Set("Page"w, GUID2wstring(g_CmdLinePropertyPage));
keyToolOptsLdc.Set("Sort"w, 20);

static if(hasDubSupport)
{
scope RegKey keyToolOptsDub = new RegKey(keyRoot, registrationRoot ~ regPathToolsDub);
Expand Down