From f622232fa5d777746e93730846a1da89294d68e3 Mon Sep 17 00:00:00 2001 From: Rainer Schuetze Date: Fri, 29 Nov 2013 10:42:58 +0100 Subject: [PATCH] dparser: UFCS and mixin analysis are now opt-in support string import dependencies fixed passing quoted library paths to linker fixed default library path for x64 (contained spaces, but were not quoted, added default for 8.1 SDK) --- CHANGES | 15 ++++ Makefile | 16 ++-- VERSION | 4 +- doc/StartPage.dd | 33 ++++---- doc/VersionHistory.dd | 69 +++++++++++++++++ nsis/visuald.nsi | 11 ++- sdk/vsi.visualdproj | 146 ++++++++++++++++++------------------ stdext/stdext.visualdproj | 2 +- vdc/abothe/VDServer.cs | 15 ++-- vdc/abothe/VDServer.sln | 6 ++ vdc/ivdserver.d | 7 +- vdc/lexer.d | 23 +++++- vdc/parser/expr.d | 7 +- vdc/semantic.d | 2 + vdc/vdserver.d | 25 +++--- vdc/vdserver.rc | 8 +- visuald/Makefile | 3 +- visuald/build.d | 28 +++++-- visuald/completion.d | 2 +- visuald/config.d | 2 +- visuald/dlangsvc.d | 3 +- visuald/dpackage.d | 23 ++++-- visuald/propertypage.d | 22 ++++++ visuald/register.d | 39 +++++----- visuald/visuald.rc | 8 +- visuald/visuald.visualdproj | 6 +- 26 files changed, 357 insertions(+), 168 deletions(-) diff --git a/CHANGES b/CHANGES index 8ec4c4d7..59dfffe1 100644 --- a/CHANGES +++ b/CHANGES @@ -588,3 +588,18 @@ Version history - added commands "Collapse unittests" and "Collapse disabled" to the outlining menu - dviewhelper.dll from cv2pdb now avoids being unloaded after debugger expression evaluation using visualizers * changed license to Boost + +unreleased Version 0.3.38 + + * updated to cv2pdb 0.28 + - support mspdb120.dll from VS 2013 + - bugzilla 11537: improved search for appropriate mspdb*.dll if multiple version of VS installed + * updated to mago 0.9 + - bugzilla 11547: remove error message when stopping debugging + - bugzilla 11437: debug info rejected if records don't have "recommended" order + * updated dparser to 08f760b6181d1e40a29f3e03a7eafcd40bf4dc34 + - added options to enable/disable mixin analysis and UFCS expansions + * added support for string import dependencies (needs dmd 2.065) + * fixed default library path for x64 (contained spaces, but were not quoted, + added default for 8.1 SDK) + * fixed passing quoted library paths to linker diff --git a/Makefile b/Makefile index 5856bae4..13a8560e 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,7 @@ DMD2 = dmd # DMD2 = m:\s\d\rainers\windows\bin\dmd.exe # DMD2 = c:\l\dmd2beta\windows\bin\dmd.exe +DMD2_ = $(DMD2:/=\) COFFIMPLIB = c:\l\dmc\bin\coffimplib.exe # avoid trailing '\', it ruins the command line @@ -52,7 +53,7 @@ VSI_LIB = $(BINDIR)\vsi.lib VISUALD = $(BINDIR)\visuald.dll FMT = OMF -PASS_ENV = "DMD2=$(DMD2)" "WINSDK=$(WINSDK)" "COFFIMPLIB=$(COFFIMPLIB)" FMT=$(FMT) +PASS_ENV = "DMD2=$(DMD2_)" "WINSDK=$(WINSDK)" "COFFIMPLIB=$(COFFIMPLIB)" FMT=$(FMT) all: dte_idl vsi2d package vdserver_exe $(PIPEDMD_EXE) $(FILEMON_DLL) @@ -79,16 +80,16 @@ sdk\vsi\idl\dte90.idl : $(TLB2IDL_EXE) "$(MSENV)\dte90.olb" $(TLB2IDL_EXE) "$(MSENV)\dte90.olb" $@ "$(IVIEWER)" $(TLB2IDL_EXE) : tools\tlb2idl.d - $(DMD2) -map $@.map -of$@ tools\tlb2idl.d oleaut32.lib uuid.lib snn.lib kernel32.lib + $(DMD2_) -map $@.map -of$@ tools\tlb2idl.d oleaut32.lib uuid.lib snn.lib kernel32.lib $(PIPEDMD_EXE) : tools\pipedmd.d - $(DMD2) -map $@.map -of$@ tools\pipedmd.d + $(DMD2_) -map $@.map -of$@ tools\pipedmd.d $(FILEMON_DLL) : tools\filemonitor.d - $(DMD2) -map $@.map -of$@ -defaultlib=user32.lib -L/ENTRY:_DllMain@12 tools\filemonitor.d + $(DMD2_) -map $@.map -of$@ -defaultlib=user32.lib -L/ENTRY:_DllMain@12 tools\filemonitor.d $(LARGEADR_EXE) : tools\largeadr.d - $(DMD2) -of$@ tools\largeadr.d + $(DMD2_) -of$@ tools\largeadr.d ################################## # generate VSI d files from h and idl @@ -104,7 +105,7 @@ vsi_dirs: if not exist sdk\win32\nul md sdk\win32 $(VSI2D_EXE) : $(VSI2D_SRC) - $(DMD2) -d -map $@.map -of$@ -version=vsi $(VSI2D_SRC) + $(DMD2_) -d -map $@.map -of$@ -version=vsi $(VSI2D_SRC) sdk\vsi_sources: $(VSI2D_EXE) $(VSI2D_EXE) -vsi="$(VSISDK)" -win="$(WINSDK)\Include" -dte="$(DTE_IDL_PATH)" -sdk=sdk @@ -138,6 +139,9 @@ dparser: mago: cd ..\..\mago && devenv /Build "Release|Win32" magodbg.sln +cv2pdb: + cd ..\..\cv2pdb\trunk && devenv /Build "Release|Win32" src\cv2pdb.sln + ################################## # create installer diff --git a/VERSION b/VERSION index 77fdf943..961b066a 100644 --- a/VERSION +++ b/VERSION @@ -1,3 +1,5 @@ #define VERSION_MAJOR 0 #define VERSION_MINOR 3 -#define VERSION_REVISION 37 +#define VERSION_REVISION 38 +#define VERSION_BETA -beta +#define VERSION_BUILD 1 diff --git a/doc/StartPage.dd b/doc/StartPage.dd index 4b1c1991..11711005 100644 --- a/doc/StartPage.dd +++ b/doc/StartPage.dd @@ -52,6 +52,19 @@ $(H2 News) $(LINK2 VersionHistory.html, Full version history and complete details...) $(BR) +2013-11-02 Version 0.3.37 +$(UL + $(LI Installer now supports VS 2013, updated to cv2pdb 0.27, mago 0.8, fixes x64 deubgger in VS 2012 Shell) + $(LI improvements to "Compile and Run") + $(LI improvements to syntax/coverage highlighting) + $(LI DParser engine now used by default, updated to recent version) + $(LI single file options now available per project configuration) + $(LI added global option to display the reason for building a target) + $(LI added different options for executable and library search paths to be used for Win32/x64) + $(LI link dependencies can now also be monitored for the 32-bit MS linker) + $(LI added commands "Collapse unittests" and "Collapse disabled" to the outlining menu) +) + 2013-05-10 $(LINK2 News36.html, Version 0.3.36) $(UL $(LI updated to new features of the language and tooling as of dmd 2.062) @@ -63,28 +76,12 @@ $(UL $(LI added option "Colorize coverage from .LST file" to highlight lines from code coverage output) ) -2012-12-03 Version 0.3.35 -$(UL - $(LI a number of bugfixes and improvements to the build system, e.g. - $(UL - $(LI new linker option to disable using global and standard library search paths) - $(LI added preliminary support for upcoming dmd win64 compiler) - $(LI added console application project template with configurations for DMD and GDC for Win32 and x86) - ) - ) - $(LI added build project to build Visual D from VS itself without the need to modify makefiles) - $(LI goto definition now uses semantic analysis to find declaration) - $(LI semantic analysis now enabled by default (removed experimental status)) - $(LI now installed as an "extension" to VS 2010 and VS 2012) - $(LI fixed spurious crashes due to bug in precise garbage collection) -) - $(LINK2 VersionHistory.html, more...) $(H2 Download) -$(P The latest installer can be downloaded -$(LINK2 http:/www.dsource.org/projects/visuald/browser/downloads/VisualD-v0.3.36.exe?format=raw&FixForIE=.exe, here). +$(P The latest installer can also be downloaded +$(LINK2 http:/www.dsource.org/projects/visuald/browser/downloads/VisualD-v0.3.37.exe?format=raw&FixForIE=.exe, here). You can find older versions and some additional files in the $(LINK2 http:/www.dsource.org/projects/visuald/browser/downloads/, download directory).) diff --git a/doc/VersionHistory.dd b/doc/VersionHistory.dd index d088e6a3..2bbadae1 100644 --- a/doc/VersionHistory.dd +++ b/doc/VersionHistory.dd @@ -1,5 +1,74 @@ Ddoc +2013-11-02 Version 0.3.37 + $(UL + $(LI installer: + $(UL + $(LI fixed regression: VS 2010/2012 extension pkgdef files almost empty) + $(LI now has workaround for x64 debugger of Visual Studio 2012 Shell ) + $(LI installs cv2pdb 0.27 which fixes a crash when converting DWARF from GDC 4.8) + $(LI installs mago 0.8 with pdb and embedded breakpoints support ) + $(LI installer now picks up dmd2 folder from DMD installation) + $(LI added support for VS 2013 to installer, removed VS.NET 2003) + )) + $(LI "Compile and Run": + $(UL + $(LI no longer adds "--main" automatically) + $(LI removed some other implicite command line options that confused rdmd) + $(LI fixed quotes in --eval arguments) + $(LI didn't save file if it is not part of a project in the solution) + )) + $(LI syntax/coverage highlighting + $(UL + $(LI editor always started with coverage highlighting enabled) + $(LI Colorize coverage: + $(UL + $(LI disabled if lst file older than source file or deleted) + $(LI tweaked line number translation) + $(LI now searches for coverage generated files in last execution folders) + $(LI added new command "Delete Coverage Files") + )) + $(LI after changing the "Colored types" the current editor did not update immediately) + $(LI user type colorizer settings were forgotten after editing options) + $(LI keywords can now also be colored by adding them to the "Colored types") + )) + $(LI DParser + $(UL + $(LI updated to $(LINK2 https://github.com/aBothe/D_Parser/commit/72f1bc54f2426954f463f03b215e044174fc1468, recent version)) + $(LI enabled mixin analysis) + $(LI pass deprecation flag to engine) + $(LI DParser engine now used by default if installed) + )) + $(LI vdserver + $(UL + $(LI add __FUNCTION__, __PRETTY_FUNCTION__ and __MODULE__ as keywords and primary expression) + $(LI add __parameters as specification in is-expression) + )) + $(LI build system + $(UL + $(LI fixed building with -op and source files on different drive than project) + $(LI added file options per configuration) + $(LI fixed invoking bad command when no files to compile, but additional arguments set) + $(LI added global option to display the reason for building a target) + $(LI fixed custom build rules executed twice sometimes) + $(LI fixed sc.ini evaluation, added support for sections [Environment32] and [Environment64] ) + $(LI link dependencies can now also be monitored for the 32-bit MS linker) + $(LI added VCINSTALLDIR to the list of available macros) + $(LI added different options for executable and library search paths to be used for Win32/x64) + $(LI x64: linker settings from sc.ini can be overwritten ) + $(LI x64: linker no longer invoked through dmd) + )) + $(LI miscellaneous + $(UL + $(LI added command "Open Folder in Windows Explorer" to project and folder context menu) + $(LI goto definition now falls back to JSON information if semantic analysis yields no result) + $(LI improved indentation after opening parenthesis to follow next token) + $(LI added commands "Collapse unittests" and "Collapse disabled" to the outlining menu) + $(LI dviewhelper.dll from cv2pdb now avoids being unloaded after debugger expression evaluation using visualizers) + )) + $(LI changed license to Boost) + ) + 2013-05-10 $(DDLINK News36,Version 0.3.36) $(UL $(LI added debug settings to new DMD/GDC project template ) diff --git a/nsis/visuald.nsi b/nsis/visuald.nsi index c87fdc49..426d12ad 100644 --- a/nsis/visuald.nsi +++ b/nsis/visuald.nsi @@ -28,12 +28,21 @@ !searchparse /file ../version "#define VERSION_MAJOR " VERSION_MAJOR !searchparse /file ../version "#define VERSION_MINOR " VERSION_MINOR !searchparse /file ../version "#define VERSION_REVISION " VERSION_REVISION + !searchparse /file ../version "#define VERSION_BETA " VERSION_BETA + !searchparse /file ../version "#define VERSION_BUILD " VERSION_BUILD !searchreplace VERSION_MAJOR ${VERSION_MAJOR} " " "" !searchreplace VERSION_MINOR ${VERSION_MINOR} " " "" !searchreplace VERSION_REVISION ${VERSION_REVISION} " " "" + !searchreplace VERSION_BETA ${VERSION_BETA} " " "" + !searchreplace VERSION_BUILD ${VERSION_BUILD} " " "" + + !if "${VERSION_BUILD}" == "0" + !define VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}" + !else + !define VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}${VERSION_BETA}${VERSION_BUILD}" + !endif - !define VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}" !echo "VERSION = ${VERSION}" !define AUTHOR "Rainer Schuetze" !define APPNAME "VisualD" diff --git a/sdk/vsi.visualdproj b/sdk/vsi.visualdproj index cd12cd16..72844c79 100644 --- a/sdk/vsi.visualdproj +++ b/sdk/vsi.visualdproj @@ -12,7 +12,7 @@ 0 0 0 - 0 + 1 0 0 0 @@ -1175,57 +1175,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -1233,18 +1185,23 @@ + + + + + @@ -1271,6 +1228,7 @@ + @@ -1280,19 +1238,30 @@ + + + + + + + + + + + @@ -1302,37 +1271,68 @@ + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/stdext/stdext.visualdproj b/stdext/stdext.visualdproj index fb0ef98e..0f44af4e 100644 --- a/stdext/stdext.visualdproj +++ b/stdext/stdext.visualdproj @@ -12,7 +12,7 @@ 0 0 0 - 1 + 0 0 0 0 diff --git a/vdc/abothe/VDServer.cs b/vdc/abothe/VDServer.cs index e13a1011..08fc7181 100644 --- a/vdc/abothe/VDServer.cs +++ b/vdc/abothe/VDServer.cs @@ -215,8 +215,8 @@ public void GetTip(string filename, int startLine, int startIndex, int endLine, _editorData.ModuleCode = _sources[filename]; // codeOffset+1 because otherwise it does not work on the first character _editorData.CaretOffset = getCodeOffset(_editorData.ModuleCode, _tipStart) + 1; - AbstractTooltipContent[] content = AbstractTooltipProvider.BuildToolTip(_editorData); - if(content == null || content.Length == 0) + List content = AbstractTooltipProvider.BuildToolTip(_editorData); + if(content == null || content.Count == 0) _tipText = ""; else foreach (var c in content) @@ -257,9 +257,10 @@ public void GetSemanticExpansions(string filename, string tok, uint line, uint i idx--; } _editorData.CaretLocation = new CodeLocation((int)idx + 1, (int) line); - + + char triggerChar = string.IsNullOrEmpty(tok) ? '\0' : tok[0]; VDServerCompletionDataGenerator cdgen = new VDServerCompletionDataGenerator(tok); - AbstractCompletionProvider provider = AbstractCompletionProvider.BuildCompletionData(cdgen, _editorData, null); //tok + CodeCompletion.GenerateCompletionData(_editorData, cdgen, triggerChar); _expansions = cdgen.expansions; } @@ -327,7 +328,7 @@ public void GetDefinition(string filename, int startLine, int startIndex, int en _editorData.CaretOffset = getCodeOffset(_editorData.ModuleCode, _tipStart) + 2; var ctxt=ResolutionContext.Create(_editorData); - var rr = DResolver.ResolveType(_editorData, ctxt, DResolver.AstReparseOptions.AlsoParseBeyondCaret); + var rr = DResolver.ResolveType(_editorData, DResolver.AstReparseOptions.AlsoParseBeyondCaret, ctxt); _tipText = ""; if (rr != null && rr.Length > 0) @@ -382,8 +383,8 @@ void _setupEditorData() _editorData.VersionNumber = (int)(_flags >> 8) & 0xff; _editorData.GlobalVersionIds = versions.Split('\n'); _editorData.GlobalDebugIds = _debugIds.Split('\n'); - CompletionOptions.Instance.ShowUFCSItems = true; - CompletionOptions.Instance.DisableMixinAnalysis = false; + CompletionOptions.Instance.ShowUFCSItems = (_flags & 0x2000000) != 0; + CompletionOptions.Instance.DisableMixinAnalysis = (_flags & 0x1000000) == 0; CompletionOptions.Instance.HideDeprecatedNodes = (_flags & 128) != 0; } diff --git a/vdc/abothe/VDServer.sln b/vdc/abothe/VDServer.sln index 6073721d..cf300109 100644 --- a/vdc/abothe/VDServer.sln +++ b/vdc/abothe/VDServer.sln @@ -10,6 +10,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DParser2", "..\..\..\..\abo EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DParserCOMServer", "comserver\DParserCOMServer.csproj", "{7B4FB722-905A-4851-8399-1E0F3361CCD8}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "vdextensions", "..\..\vdextensions\vdextensions.csproj", "{3A338E86-A08A-4F9A-8DB1-A5C280773BA3}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -20,6 +22,10 @@ Global {0290A229-9AA1-41C3-B525-CAFB86D8BC42}.Debug|Any CPU.Build.0 = Debug|Any CPU {0290A229-9AA1-41C3-B525-CAFB86D8BC42}.Release|Any CPU.ActiveCfg = Release|Any CPU {0290A229-9AA1-41C3-B525-CAFB86D8BC42}.Release|Any CPU.Build.0 = Release|Any CPU + {3A338E86-A08A-4F9A-8DB1-A5C280773BA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3A338E86-A08A-4F9A-8DB1-A5C280773BA3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3A338E86-A08A-4F9A-8DB1-A5C280773BA3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3A338E86-A08A-4F9A-8DB1-A5C280773BA3}.Release|Any CPU.Build.0 = Release|Any CPU {7B4FB722-905A-4851-8399-1E0F3361CCD8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7B4FB722-905A-4851-8399-1E0F3361CCD8}.Debug|Any CPU.Build.0 = Debug|Any CPU {7B4FB722-905A-4851-8399-1E0F3361CCD8}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/vdc/ivdserver.d b/vdc/ivdserver.d index bf7a5c3c..c442bb2c 100644 --- a/vdc/ivdserver.d +++ b/vdc/ivdserver.d @@ -168,7 +168,8 @@ public: /////////////////////////////////////////////////////////////////////// uint ConfigureFlags()(bool unittestOn, bool debugOn, bool x64, bool cov, bool doc, bool nobounds, bool gdc, - int versionLevel, int debugLevel, bool noDeprecated) + int versionLevel, int debugLevel, bool noDeprecated, + bool mixinAnalysis, bool ufcsExpansions) { return (unittestOn ? 1 : 0) | (debugOn ? 2 : 0) @@ -179,6 +180,8 @@ uint ConfigureFlags()(bool unittestOn, bool debugOn, bool x64, bool cov, bool do | (gdc ? 64 : 0) | (noDeprecated ? 128 : 0) | ((versionLevel & 0xff) << 8) - | ((debugLevel & 0xff) << 16); + | ((debugLevel & 0xff) << 16) + | (mixinAnalysis ? 0x1_00_00_00 : 0) + | (ufcsExpansions ? 0x2_00_00_00 : 0); } diff --git a/vdc/lexer.d b/vdc/lexer.d index 698e23d2..b7717620 100644 --- a/vdc/lexer.d +++ b/vdc/lexer.d @@ -205,9 +205,16 @@ struct Lexer if((base == 10 && toLower(ch) == 'e') || (base == 16 && toLower(ch) == 'p')) goto L_exponent; - size_t trypos = nextpos; - if(base >= 8 && ch == '.' && trydecode(text, trypos) != '.') // ".." is the slice token + if(base >= 8 && ch == '.') // ".." is the slice token { + { // mute errors about goto skipping declaration + size_t trypos = nextpos; + dchar trych = trydecode(text, trypos); + if (trych == '.') + goto L_integer; + //if (isAlpha(trych) || trych == '_' || (p[1] & 0x80)) + // goto done; + } // float if(base < 10) base = 10; @@ -266,11 +273,23 @@ L_complexLiteral: if(toUpper(ch) == 'U') pos = nextpos; } +L_integer: pid = TOK_IntegerLiteral; } return TokenCat.Literal; } + unittest + { + int pid; + size_t pos = 1; + auto cat = scanNumber("0.0i", '0', pos, pid); + assert(pid == TOK_FloatLiteral); + pos = 1; + cat = scanNumber("0.i", '0', pos, pid); + assert(pid == TOK_IntegerLiteral); + } + static State scanBlockComment(S)(S text, ref size_t pos) { while(pos < text.length) diff --git a/vdc/parser/expr.d b/vdc/parser/expr.d index 03b5ad72..afe74852 100644 --- a/vdc/parser/expr.d +++ b/vdc/parser/expr.d @@ -552,17 +552,18 @@ class CastExpression : UnaryExpression static Action shiftModifier(Parser p) { + Token tok; switch(p.tok.id) { case TOK_rparen: - auto tok = p.popToken(); + tok = p.popToken(); p.topNode!(ast.CastExpression)().attr = tokenToAttribute(tok.id); p.pushState(&stateExpression.shift); return Accept; case TOK_const: case TOK_inout: - auto tok = p.topToken(); + tok = p.topToken(); if(tok.id != TOK_shared) goto default; L_combineAttr: @@ -574,7 +575,7 @@ class CastExpression : UnaryExpression return Accept; case TOK_shared: - auto tok = p.topToken(); + tok = p.topToken(); if(tok.id != TOK_inout && tok.id != TOK_const) goto default; goto L_combineAttr; diff --git a/vdc/semantic.d b/vdc/semantic.d index b10f7594..138611e6 100644 --- a/vdc/semantic.d +++ b/vdc/semantic.d @@ -921,6 +921,8 @@ class Options bool noBoundsCheck; bool gdcCompiler; bool noDeprecated; + bool mixinAnalysis; + bool UFCSExpansions; VersionDebug debugIds; VersionDebug versionIds; diff --git a/vdc/vdserver.d b/vdc/vdserver.d index 71dd75de..b91b88a4 100644 --- a/vdc/vdserver.d +++ b/vdc/vdserver.d @@ -183,16 +183,19 @@ class VDServer : ComObject, IVDServer uint oldflags = ConfigureFlags!()(opts.unittestOn, opts.debugOn, opts.x64, opts.coverage, opts.doDoc, opts.noBoundsCheck, opts.gdcCompiler, - 0, 0, opts.noDeprecated); // no need to compare version levels, done in setVersionIds - - opts.unittestOn = (flags & 1) != 0; - opts.debugOn = (flags & 2) != 0; - opts.x64 = (flags & 4) != 0; - opts.coverage = (flags & 8) != 0; - opts.doDoc = (flags & 16) != 0; - opts.noBoundsCheck = (flags & 32) != 0; - opts.gdcCompiler = (flags & 64) != 0; - opts.noDeprecated = (flags & 128) != 0; + 0, 0, // no need to compare version levels, done in setVersionIds + opts.noDeprecated, opts.mixinAnalysis, opts.UFCSExpansions); + + opts.unittestOn = (flags & 1) != 0; + opts.debugOn = (flags & 2) != 0; + opts.x64 = (flags & 4) != 0; + opts.coverage = (flags & 8) != 0; + opts.doDoc = (flags & 16) != 0; + opts.noBoundsCheck = (flags & 32) != 0; + opts.gdcCompiler = (flags & 64) != 0; + opts.noDeprecated = (flags & 128) != 0; + opts.mixinAnalysis = (flags & 0x1_00_00_00) != 0; + opts.UFCSExpansions = (flags & 0x2_00_00_00) != 0; int versionlevel = (flags >> 8) & 0xff; int debuglevel = (flags >> 16) & 0xff; @@ -200,7 +203,7 @@ class VDServer : ComObject, IVDServer string verids = to_string(versionids); string dbgids = to_string(debugids); - int changed = (oldflags != (flags & 0xff)); + int changed = (oldflags != (flags & 0xff0000ff)); changed += opts.setImportDirs(splitLines(imports)); changed += opts.setImportDirs(splitLines(imports)); changed += opts.setVersionIds(versionlevel, splitLines(verids)); diff --git a/vdc/vdserver.rc b/vdc/vdserver.rc index 6ad5c56d..cc4614bc 100644 --- a/vdc/vdserver.rc +++ b/vdc/vdserver.rc @@ -20,9 +20,15 @@ #include "../version" +#if VERSION_BUILD > 0 +#define VERSION_POSTFIX _str(VERSION_BETA) _str(VERSION_BUILD) +#else +#define VERSION_POSTFIX +#endif + #define VER_COMPANYNAME_STR "Rainer Schuetze" #define VER_FILEVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_REVISION -#define VER_FILEVERSION_STR _str(VERSION_MAJOR.VERSION_MINOR.VERSION_REVISION) +#define VER_FILEVERSION_STR _str(VERSION_MAJOR.VERSION_MINOR.VERSION_REVISION) VERSION_POSTFIX #define VER_PRODUCTVERSION VER_FILEVERSION #define VER_PRODUCTVERSION_STR VER_FILEVERSION_STR #define VER_LEGALCOPYRIGHT_STR "(c) 2012 Rainer Schuetze" diff --git a/visuald/Makefile b/visuald/Makefile index 342410d7..059f9768 100644 --- a/visuald/Makefile +++ b/visuald/Makefile @@ -125,7 +125,8 @@ RELDBG = !ENDIF # -version=LOGSEMANTIC -L/IMPLIB -L/LINENUMBERS -I../../xmlp -RELFLAGS = -release -O -inline -noboundscheck +RELFLAGS = -release -O -inline +# -noboundscheck # -gs -defaultlib=druntime_d,phobos_d LIBS = phobos.lib "$(LIB)\comctl32.lib" uuid.lib advapi32.lib comdlg32.lib \ diff --git a/visuald/build.d b/visuald/build.d index e2b831d2..6fcdeb8d 100644 --- a/visuald/build.d +++ b/visuald/build.d @@ -835,10 +835,12 @@ HRESULT RunCustomBuildBatchFile(string target, assert(pBuilder.m_srpIVsLaunchPadFactory); ComPtr!(IVsLaunchPad) srpIVsLaunchPad; hr = pBuilder.m_srpIVsLaunchPadFactory.CreateLaunchPad(&srpIVsLaunchPad.ptr); + scope(exit) pBuilder.addCommandLog(target, cmdline, output); + if(FAILED(hr)) { output = format("internal error: IVsLaunchPadFactory.CreateLaunchPad failed with rc=%x", hr); - goto failure; + return hr; } assert(srpIVsLaunchPad.ptr); @@ -861,7 +863,7 @@ version(none) if(FAILED(hr)) { output = format("internal error: IVsLaunchPad.ptr.ExecBatchScript failed with rc=%x", hr); - goto failure; + return hr; } } else { try @@ -915,9 +917,9 @@ version(none) if(FAILED(hr)) { output = format("internal error: IVsLaunchPad.ptr.ExecCommand failed with rc=%x", hr); - goto failure; + return hr; } - else if(result != 0) + if(result != 0) hr = S_FALSE; } // don't know how to get at the exit code, so check output string @@ -939,8 +941,6 @@ version(none) hr = S_FALSE; } } -failure: - pBuilder.addCommandLog(target, cmdline, output); return hr; } @@ -1149,6 +1149,7 @@ else uint pos = 0; uint openpos = 0; bool skipNext = false; + bool stringImport = false; while(pos < txt.length) { dchar ch = decode(txt, pos); @@ -1166,20 +1167,31 @@ else // only check lines that import "object", these are written once per file const string kCheck1 = " : public : object "; const string kCheck2 = " : private : object "; // added after 2.060 + const string kCheck3 = " : string : "; // string imports added after 2.064 if((pos + kCheck1.length <= txt.length && txt[pos .. pos + kCheck1.length] == kCheck1) || - (pos + kCheck2.length <= txt.length && txt[pos .. pos + kCheck2.length] == kCheck2)) + (pos + kCheck2.length <= txt.length && txt[pos .. pos + kCheck2.length] == kCheck2) || + stringImport) { string file = txt[openpos .. pos-1]; file = unEscapeFilename(file); aafiles[file] = 1; openpos = 0; + stringImport = false; cntValid++; } + else if(pos + kCheck3.length <= txt.length && txt[pos .. pos + kCheck3.length] == kCheck3) + { + // wait for the next file name in () on the same line + openpos = 0; + stringImport = true; + } } else if(ch == '\n') + { openpos = 0; + stringImport = false; + } } - } } catch(Exception e) diff --git a/visuald/completion.d b/visuald/completion.d index 33d06000..cc5c2154 100644 --- a/visuald/completion.d +++ b/visuald/completion.d @@ -542,11 +542,11 @@ class CompletionSet : DisposingComObject, IVsCompletionSet, IVsCompletionSetEx { mixin(LogCallMix); + int idx; int hr = S_OK; if (mDecls.GetInitialExtent(mTextView, line, startIdx, endIdx)) goto done; - int idx; hr = mTextView.GetCaretPos(line, &idx); assert(hr == S_OK); hr = GetTokenExtent(*line, idx, *startIdx, *endIdx); diff --git a/visuald/config.d b/visuald/config.d index 08cef9e2..cb99ffa6 100644 --- a/visuald/config.d +++ b/visuald/config.d @@ -784,7 +784,7 @@ class ProjectOptions if(useStdLibPath) lpaths ~= tokenizeArgs(isX86_64 ? compilerDirectories.LibSearchPath64 : compilerDirectories.LibSearchPath); foreach(lp; lpaths) - cmd ~= (mslink ? " /LIBPATH:" : "+") ~ quoteFilename(normalizeDir(lp)); + cmd ~= (mslink ? " /LIBPATH:" : "+") ~ quoteFilename(normalizeDir(unquoteArgument(lp))); string def = deffile.length ? quoteNormalizeFilename(deffile) : plusList(lnkfiles, ".def", mslink ? " /DEF:" : plus); string res = resfile.length ? quoteNormalizeFilename(resfile) : plusList(lnkfiles, ".res", plus); diff --git a/visuald/dlangsvc.d b/visuald/dlangsvc.d index 9f8b8e63..ea6c9602 100644 --- a/visuald/dlangsvc.d +++ b/visuald/dlangsvc.d @@ -749,11 +749,12 @@ class LanguageService : DisposingComObject, { scope(exit) release(cfg); auto cfgopts = cfg.GetProjectOptions(); + auto globopts = Package.GetGlobalOptions(); flags = ConfigureFlags!()(cfgopts.useUnitTests, !cfgopts.release, cfgopts.isX86_64, cfgopts.cov, cfgopts.doDocComments, cfgopts.noboundscheck, cfgopts.compiler == Compiler.GDC, cfgopts.versionlevel, cfgopts.debuglevel, - cfgopts.errDeprecated); + cfgopts.errDeprecated, globopts.mixinAnalysis, globopts.UFCSExpansions); string strimp = cfgopts.replaceEnvironment(cfgopts.fileImppath, cfg); stringImp = tokenizeArgs(strimp); diff --git a/visuald/dpackage.d b/visuald/dpackage.d index 80ae8099..ad8ad14b 100644 --- a/visuald/dpackage.d +++ b/visuald/dpackage.d @@ -67,10 +67,13 @@ struct LanguageProperty DWORD value; } -const string plk_version = extractDefine(import("version"), "VERSION_MAJOR") ~ "." ~ - extractDefine(import("version"), "VERSION_MINOR"); +const string plk_version = extractDefine(import("version"), "VERSION_MAJOR") ~ "." ~ + extractDefine(import("version"), "VERSION_MINOR"); +const string bld_version = extractDefine(import("version"), "VERSION_BUILD"); +const string beta_version = extractDefine(import("version"), "VERSION_BETA"); const string full_version = plk_version ~ "." ~ - extractDefine(import("version"), "VERSION_REVISION"); + extractDefine(import("version"), "VERSION_REVISION") ~ + (bld_version != "0" ? beta_version ~ bld_version : ""); /*--------------------------------------------------------- * Globals @@ -1114,6 +1117,8 @@ class GlobalOptions bool showTypeInTooltip; bool semanticGotoDef; bool useDParser; + bool mixinAnalysis; + bool UFCSExpansions; string VDServerIID; string compileAndRunOpts; @@ -1261,6 +1266,8 @@ class GlobalOptions scope RegKey keyDParser = new RegKey(HKEY_CLASSES_ROOT, "CLSID\\{002a2de9-8bb6-484d-AA05-7e4ad4084715}", false); useDParser = getBoolOpt("useDParser2", keyDParser.key !is null); + mixinAnalysis = getBoolOpt("mixinAnalysis", false); + UFCSExpansions = getBoolOpt("UFCSExpansions", true); wstring getDefaultDMDLibPath64() { @@ -1268,9 +1275,11 @@ class GlobalOptions if(WindowsSdkDir.length) { if(std.file.exists(WindowsSdkDir ~ r"lib\x64")) - libpath ~= to!wstring("\n" ~ WindowsSdkDir ~ r"lib\x64"); - else if(std.file.exists(WindowsSdkDir ~ r"Lib\win8\um\x64")) - libpath ~= to!wstring("\n" ~ WindowsSdkDir ~ r"Lib\win8\um\x64"); + libpath ~= to!wstring(r"\n$(WindowsSdkDir)lib\x64"); + else if(std.file.exists(WindowsSdkDir ~ r"Lib\win8\um\x64")) // SDK 8.0 + libpath ~= to!wstring(r"\n$(WindowsSdkDir)Lib\win8\um\x64"); + else if(std.file.exists(WindowsSdkDir ~ r"Lib\winv6.3\um\x64")) // SDK 8.1 + libpath ~= to!wstring(r"\n$(WindowsSdkDir)Lib\winv6.3\um\x64"); } return libpath; } @@ -1387,6 +1396,8 @@ class GlobalOptions keyToolOpts.Set("showTypeInTooltip", showTypeInTooltip); keyToolOpts.Set("semanticGotoDef", semanticGotoDef); keyToolOpts.Set("useDParser2", useDParser); + keyToolOpts.Set("mixinAnalysis", mixinAnalysis); + keyToolOpts.Set("UFCSExpansions", UFCSExpansions); keyToolOpts.Set("pasteIndent", pasteIndent); keyToolOpts.Set("compileAndRunOpts", toUTF16(compileAndRunOpts)); diff --git a/visuald/propertypage.d b/visuald/propertypage.d index be32b6f3..69614e6a 100644 --- a/visuald/propertypage.d +++ b/visuald/propertypage.d @@ -1784,6 +1784,22 @@ class IntellisensePropertyPage : GlobalPropertyPage AddControl("", mShowTypeInTooltip = new CheckBox(mCanvas, "Show type of expressions in tool tip")); AddControl("", mSemanticGotoDef = new CheckBox(mCanvas, "Use semantic analysis for \"Goto Definition\" (before trying JSON info)")); version(DParser) AddControl("", mUseDParser = new CheckBox(mCanvas, "Use Alexander Bothe's D parsing engine for semantic analysis")); + AddControl("", mMixinAnalysis = new CheckBox(mCanvas, "Enable mixin analysis")); + AddControl("", mUFCSExpansions = new CheckBox(mCanvas, "Enable UFCS expansions")); + } + + override void UpdateDirty(bool bDirty) + { + super.UpdateDirty(bDirty); + EnableControls(); + } + + void EnableControls() + { + version(DParser) bool useDParser = mUseDParser.isChecked(); + else bool useDParser = false; + mMixinAnalysis.setEnabled(useDParser); + mUFCSExpansions.setEnabled(useDParser); } override void SetControls(GlobalOptions opts) @@ -1795,6 +1811,8 @@ class IntellisensePropertyPage : GlobalPropertyPage mShowTypeInTooltip.setChecked(opts.showTypeInTooltip); mSemanticGotoDef.setChecked(opts.semanticGotoDef); version(DParser) mUseDParser.setChecked(opts.useDParser); + mMixinAnalysis.setChecked(opts.mixinAnalysis); + mUFCSExpansions.setChecked(opts.UFCSExpansions); //mExpandSemantics.setEnabled(false); } @@ -1809,6 +1827,8 @@ class IntellisensePropertyPage : GlobalPropertyPage changes += changeOption(mShowTypeInTooltip.isChecked(), opts.showTypeInTooltip, refopts.showTypeInTooltip); changes += changeOption(mSemanticGotoDef.isChecked(), opts.semanticGotoDef, refopts.semanticGotoDef); version(DParser) changes += changeOption(mUseDParser.isChecked(), opts.useDParser, refopts.useDParser); + changes += changeOption(mMixinAnalysis.isChecked(), opts.mixinAnalysis, refopts.mixinAnalysis); + changes += changeOption(mUFCSExpansions.isChecked(), opts.UFCSExpansions, refopts.UFCSExpansions); return changes; } @@ -1819,6 +1839,8 @@ class IntellisensePropertyPage : GlobalPropertyPage CheckBox mShowTypeInTooltip; CheckBox mSemanticGotoDef; version(DParser) CheckBox mUseDParser; + CheckBox mUFCSExpansions; + CheckBox mMixinAnalysis; } /////////////////////////////////////////////////////////////////////////////// diff --git a/visuald/register.d b/visuald/register.d index fc313ac0..076456af 100644 --- a/visuald/register.d +++ b/visuald/register.d @@ -668,32 +668,31 @@ HRESULT RegDeleteRecursive(HKEY keyRoot, wstring path) wstring[] keyNames; hr = hrRegOpenKeyEx(keyRoot, path, 0, (KEY_READ & SECURE_ACCESS), &key); - if (FAILED(hr)) goto fail; - - LONG lRetCode = RegQueryInfoKeyW(key, null, null, null, &subKeys, &maxKeyLen, - null, null, null, null, null, null); - if (ERROR_SUCCESS != lRetCode) - { - hr = HRESULT_FROM_WIN32(lRetCode); - goto fail; - } - if (subKeys > 0) + if (!FAILED(hr)) { - wchar[] keyName = new wchar[maxKeyLen+1]; - for (currentKey = 0; currentKey < subKeys; currentKey++) + LONG lRetCode = RegQueryInfoKeyW(key, null, null, null, &subKeys, &maxKeyLen, + null, null, null, null, null, null); + if (ERROR_SUCCESS != lRetCode) { - ULONG keyLen = maxKeyLen+1; - lRetCode = RegEnumKeyExW(key, currentKey, keyName.ptr, &keyLen, null, null, null, null); - if (ERROR_SUCCESS == lRetCode) - keyNames ~= to_wstring(keyName.ptr, keyLen); + hr = HRESULT_FROM_WIN32(lRetCode); + } + else if (subKeys > 0) + { + wchar[] keyName = new wchar[maxKeyLen+1]; + for (currentKey = 0; currentKey < subKeys; currentKey++) + { + ULONG keyLen = maxKeyLen+1; + lRetCode = RegEnumKeyExW(key, currentKey, keyName.ptr, &keyLen, null, null, null, null); + if (ERROR_SUCCESS == lRetCode) + keyNames ~= to_wstring(keyName.ptr, keyLen); + } + foreach(wstring subkey; keyNames) + RegDeleteRecursive(key, subkey); } - foreach(wstring subkey; keyNames) - RegDeleteRecursive(key, subkey); } - fail: wstring szPath = path ~ cast(wchar)0; - lRetCode = RegDeleteKeyW(keyRoot, szPath.ptr); + LONG lRetCode = RegDeleteKeyW(keyRoot, szPath.ptr); if (SUCCEEDED(hr) && (ERROR_SUCCESS != lRetCode)) hr = HRESULT_FROM_WIN32(lRetCode); if (key) RegCloseKey(key); diff --git a/visuald/visuald.rc b/visuald/visuald.rc index 04a3cc6d..d45afa26 100644 --- a/visuald/visuald.rc +++ b/visuald/visuald.rc @@ -88,9 +88,15 @@ BMP_SPLASHSCRN BITMAP "resources/dsplashscreenicon.bmp" #include "../version" +#if VERSION_BUILD > 0 +#define VERSION_POSTFIX _str(VERSION_BETA) _str(VERSION_BUILD) +#else +#define VERSION_POSTFIX +#endif + #define VER_COMPANYNAME_STR "Rainer Schuetze" #define VER_FILEVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_REVISION -#define VER_FILEVERSION_STR _str(VERSION_MAJOR.VERSION_MINOR.VERSION_REVISION) +#define VER_FILEVERSION_STR _str(VERSION_MAJOR.VERSION_MINOR.VERSION_REVISION) VERSION_POSTFIX #define VER_PRODUCTVERSION VER_FILEVERSION #define VER_PRODUCTVERSION_STR VER_FILEVERSION_STR #define VER_LEGALCOPYRIGHT_STR "(c) 2010-2012 Rainer Schuetze" diff --git a/visuald/visuald.visualdproj b/visuald/visuald.visualdproj index 4f7838c7..6a6a7326 100644 --- a/visuald/visuald.visualdproj +++ b/visuald/visuald.visualdproj @@ -6,7 +6,7 @@ 0 0 0 - 0 + 2 0 0 0 @@ -31,14 +31,14 @@ 0 0 0 - 1 + 0 0 0 0 0 1 0 - 0 + 1 0 0 0