diff --git a/CHANGES b/CHANGES index ebdb8800..0561db52 100644 --- a/CHANGES +++ b/CHANGES @@ -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" @@ -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 + diff --git a/Makefile b/Makefile index b5fe683b..19d6e839 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/VERSION b/VERSION index a0f6003f..f688c491 100644 --- a/VERSION +++ b/VERSION @@ -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 diff --git a/doc/StartPage.dd b/doc/StartPage.dd index 614b111e..e7d0b3e5 100644 --- a/doc/StartPage.dd +++ b/doc/StartPage.dd @@ -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") diff --git a/doc/VersionHistory.dd b/doc/VersionHistory.dd index 14a36bf2..4aa5562b 100644 --- a/doc/VersionHistory.dd +++ b/doc/VersionHistory.dd @@ -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 diff --git a/vdc/abothe/comserver/CodeSemantics/SymbolDefinitionGenerator.cs b/vdc/abothe/comserver/CodeSemantics/SymbolDefinitionGenerator.cs index a2f7db78..d54fd7c0 100644 --- a/vdc/abothe/comserver/CodeSemantics/SymbolDefinitionGenerator.cs +++ b/vdc/abothe/comserver/CodeSemantics/SymbolDefinitionGenerator.cs @@ -27,6 +27,9 @@ protected override Tuple 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)) { diff --git a/visuald/chiernode.d b/visuald/chiernode.d index 85e07b2f..f4527c86 100644 --- a/visuald/chiernode.d +++ b/visuald/chiernode.d @@ -60,7 +60,8 @@ class CHierNode : DisposingDispatchObject { static void shared_static_this() { - gVsItemMap_sync = new Object; + if (!gVsItemMap_sync) + gVsItemMap_sync = new Object; } this() diff --git a/visuald/config.d b/visuald/config.d index dc531efd..c538be56 100644 --- a/visuald/config.d +++ b/visuald/config.d @@ -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) diff --git a/visuald/dpackage.d b/visuald/dpackage.d index d267efb5..321a7bc3 100644 --- a/visuald/dpackage.d +++ b/visuald/dpackage.d @@ -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) @@ -1353,6 +1355,7 @@ class GlobalOptions string compileAndRunOpts; string compileAndDbgOpts; int compileAndDbgEngine; + string dustmiteOpts; string[] coverageBuildDirs; string[] coverageExecutionDirs; @@ -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", ""); @@ -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, ";"))); diff --git a/visuald/dproject.d b/visuald/dproject.d index c226321c..c89e7af3 100644 --- a/visuald/dproject.d +++ b/visuald/dproject.d @@ -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); @@ -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); @@ -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); @@ -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); @@ -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")); +} diff --git a/visuald/hierutil.d b/visuald/hierutil.d index 4e38803f..050b2f8e 100644 --- a/visuald/hierutil.d +++ b/visuald/hierutil.d @@ -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; diff --git a/visuald/pkgutil.d b/visuald/pkgutil.d index cd1534d4..fbff7246 100644 --- a/visuald/pkgutil.d +++ b/visuald/pkgutil.d @@ -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; } @@ -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; } diff --git a/visuald/propertypage.d b/visuald/propertypage.d index 7f40f29a..88f838c6 100644 --- a/visuald/propertypage.d +++ b/visuald/propertypage.d @@ -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 { @@ -2322,7 +2369,7 @@ class ToolsProperty2Page : GlobalPropertyPage this(GlobalOptions options) { super(options); - kNeededLines = 17; + kNeededLines = 13; } override void CreateControls() @@ -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) @@ -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) @@ -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; } @@ -2401,9 +2438,6 @@ class ToolsProperty2Page : GlobalPropertyPage CheckBox mShowMemUsage; //ComboBox mDeleteFiles; Text mIncPath; - Text mCompileAndRunOpts; - Text mCompileAndDbgOpts; - ComboBox mCompileAndDbgEngine; MultiLineText mJSNPath; } @@ -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"); diff --git a/visuald/register.d b/visuald/register.d index 429b4dac..6af1c5a6 100644 --- a/visuald/register.d +++ b/visuald/register.d @@ -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; @@ -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);