Skip to content

Commit

Permalink
Merge pull request #102 from rainers/master
Browse files Browse the repository at this point in the history
Visual D 0.48.0-beta2
  • Loading branch information
rainers authored Oct 10, 2018
2 parents b8f673c + 146a27b commit 72df0fe
Show file tree
Hide file tree
Showing 13 changed files with 107 additions and 27 deletions.
22 changes: 14 additions & 8 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -989,12 +989,14 @@ Version history
unreleased Version 0.48.0

* installation
- installer and binaries now digitally signed by the "D Language Foundation"
- fixed uninstallation for VS2017
- installation for VS2013+ now uses PackageManifest format instead of Vsix
- VS2017: loading the Visual D package could crash with some VS installation "ids""
- avoid initial error message regarding altered assemblies with same version
- fix installation of the D icon for the solution explorer in VS2017
- installer hides options for VS2005-VS2012 if not installed
- remove old extension folders before installation
* new project wizard
- restore project templates for VS2008, new project wizard doesn't work there'
- mixed D/C++ VC project: optionally adding main in C++, setup precompiled headers
Expand All @@ -1005,18 +1007,21 @@ unreleased Version 0.48.0
- VS2017: D compiler installation paths and "demangle link errors" are now saved
to "HKCR\Softwre\Visual D" to be picked up by msbuild
- show detected compiler version below installation path
- removed option "parse source for syntax errors", now always on
- removed option "expansions from text buffer", now always off
- removed option "use semantic analysis for goto definition", now always on
- removed option "override linker settings from sc.ini", always on as linker no
longer set in sc.ini since dmd 2.079
- removed option "additional linker options", it was invisible anyway
- rearrange settings to better show their scope
- removed option "parse source for syntax errors", now always on
- removed option "expansions from text buffer", now always off
- removed option "use semantic analysis for goto definition", now always on
- removed option "override linker settings from sc.ini", always on as linker no
longer set in sc.ini since dmd 2.079
- removed option "additional linker options", it was invisible anyway
- rearrange settings to better show their scope
* dparser
- semantic analysis did not work if "parse source for syntax errors" was disabled
- no semantic info for a package if any file in the package has fatal parser error
- now has semantic support for static foreach (thanks to Alexander Bothe)
- fixed "Find references"
- added experimental option to show value of constants in tooltip
- the last user specified version was prepended to "Windows"
- predefined versions now evaluated by compiler invocation
* mago
- added option to show base class fields as direct fields
- allow suffix 'h' for hex numbers for better interoperablility with VS disassembly
Expand All @@ -1025,9 +1030,10 @@ unreleased Version 0.48.0
- concord: fix crash when showing children in data tooltip (mostly occured in VS2017)
- concord: allow dragging addresses to the disassembly window
- engine: Fix the way the debugger steps over instructions with REP prefix.
- engine: the disassemble view now supports SSE4 and AVX
* cv2pdb
- can now detect VS2017 via Setup-COM-API
- some DWARF fixes
- some DWARF fixes
* when pasting code to D source file newlines are adapted to surrounding code
* fixed "Compile and Run" on selection
* fix help via F1 for dmd 2.072+
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ $(DCXXFILT_EXE): tools\dcxxfilt.d
##################################
# create installer

install_vs: install_modules dparser cv2pdb mago dbuild12 dbuild14 dbuild15 install_only
install_release_modules: install_modules dparser cv2pdb mago dbuild12 dbuild14 dbuild15

install_vs: install_release_modules install_only

install_vs_no_vs2017: install_modules fake_dparser cv2pdb mago dbuild12 dbuild14 fake_dbuild15 install_only

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#define VERSION_MINOR 48
#define VERSION_REVISION 0
#define VERSION_BETA -beta
#define VERSION_BUILD 1
#define VERSION_BUILD 2
5 changes: 3 additions & 2 deletions build/dte_idl.bat
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ set MSENV=%COMMONPROGRAMFILES%\Microsoft Shared\MSEnv
if not exist "%MSENV%\dte80.olb" (echo "%MSENV%\dte80.olb" does not exist && exit /B 1)

set IVIEWER=
if "%IVIEWER%" == "" if exist "%WindowsSdkDir%\bin\x86\iviewers.dll" set IVIEWER=%WindowsSdkDir%\bin\x86\iviewers.dll
if "%IVIEWER%" == "" if exist "%WindowsSdkDir%\bin\iviewers.dll" set IVIEWER=%WindowsSdkDir%\bin\iviewers.dll
if "%IVIEWER%" == "" if exist "%WindowsSdkVerBinPath%\x86\iviewers.dll" set IVIEWER=%WindowsSdkVerBinPath%\x86\iviewers.dll
if "%IVIEWER%" == "" if exist "%WindowsSdkDir%\bin\x86\iviewers.dll" set IVIEWER=%WindowsSdkDir%\bin\x86\iviewers.dll
if "%IVIEWER%" == "" if exist "%WindowsSdkDir%\bin\iviewers.dll" set IVIEWER=%WindowsSdkDir%\bin\iviewers.dll
if "%IVIEWER%" == "" (echo "iviewer.dll" not found && exit /B 1)

echo "%TLB2IDL%" "%MSENV%\dte80.olb" "%DTE_IDL_PATH%\dte80.idl" "%IVIEWER%"
Expand Down
2 changes: 1 addition & 1 deletion c2d/cpp2d_main.d
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ unittest
}

///////////////////////////////////////////////////////////////
version(Win32) // different mangling for Win64
version(none) // different mangling for Win64
{
extern extern(C) __gshared ModuleInfo D4core3sys7windows10stacktrace12__ModuleInfoZ;

Expand Down
6 changes: 3 additions & 3 deletions c2d/idl2d.d
Original file line number Diff line number Diff line change
Expand Up @@ -2770,7 +2770,7 @@ struct tagSIZE
LONG cx;
LONG cy;
}
alias tagSIZE SIZE; alias tagSIZE *PSIZE; alias tagSIZE *LPSIZE; }q{
alias tagSIZE SIZE; alias tagSIZE *PSIZE; alias tagSIZE *LPSIZE; } ~ q{
// WIN16
};
else // !remove_pp
Expand Down Expand Up @@ -2831,7 +2831,7 @@ unittest
hallo2
";
string exptxt = "
int convert() { return " "
int convert() { return " ~ "
hello; }
// #define noconvert(n,m) \\
// hallo1 |\\
Expand Down Expand Up @@ -2930,7 +2930,7 @@ alias _PROPSHEETPAGEA_V2 _PROPSHEETPAGEA;
} else {
alias _PROPSHEETPAGEA_V1 _PROPSHEETPAGEA;
} " "
} " ~ "
";
testConvert(txt, exptxt, "prsht");
Expand Down
5 changes: 5 additions & 0 deletions nsis/visuald.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ ${MementoSection} "Install in VS 2010" SecVS2010
${RegisterWin32Exception} ${VS2010_REGISTRY_KEY} "Win32 Exceptions\D Exception"

ReadRegStr $1 ${VS_REGISTRY_ROOT} "${VS2010_REGISTRY_KEY}" InstallDir
RMDir /r '$1${EXTENSION_DIR_APP}'
ExecWait 'rundll32 "$INSTDIR\${DLLNAME}" WritePackageDef ${VS2010_REGISTRY_KEY} $1${EXTENSION_DIR}\visuald.pkgdef'
${AddItem} "$1${EXTENSION_DIR}\visuald.pkgdef"

Expand All @@ -341,6 +342,7 @@ ${MementoSection} "Install in VS 2012" SecVS2012
${RegisterWin32Exception} ${VS2012_REGISTRY_KEY} "Win32 Exceptions\D Exception"

ReadRegStr $1 ${VS_REGISTRY_ROOT} "${VS2012_REGISTRY_KEY}" InstallDir
RMDir /r '$1${EXTENSION_DIR_APP}'
ExecWait 'rundll32 "$INSTDIR\${DLLNAME}" WritePackageDef ${VS2012_REGISTRY_KEY} $1${EXTENSION_DIR}\visuald.pkgdef'
${AddItem} "$1${EXTENSION_DIR}\visuald.pkgdef"

Expand Down Expand Up @@ -373,6 +375,7 @@ ${MementoSection} "Install in VS 2013" SecVS2013
${RegisterWin32Exception} ${VS2013_REGISTRY_KEY} "Win32 Exceptions\D Exception"

ReadRegStr $1 ${VS_REGISTRY_ROOT} "${VS2013_REGISTRY_KEY}" InstallDir
RMDir /r '$1${EXTENSION_DIR_APP}'
ExecWait 'rundll32 "$INSTDIR\${DLLNAME}" WritePackageDef ${VS2013_REGISTRY_KEY} $1${EXTENSION_DIR}\visuald.pkgdef'
${AddItem} "$1${EXTENSION_DIR}\visuald.pkgdef"

Expand Down Expand Up @@ -405,6 +408,7 @@ ${MementoSection} "Install in VS 2015" SecVS2015
${RegisterWin32Exception} ${VS2015_REGISTRY_KEY} "Win32 Exceptions\D Exception"

ReadRegStr $1 ${VS_REGISTRY_ROOT} "${VS2015_REGISTRY_KEY}" InstallDir
RMDir /r '$1${EXTENSION_DIR_APP}'
ExecWait 'rundll32 "$INSTDIR\${DLLNAME}" WritePackageDef ${VS2015_REGISTRY_KEY} $1${EXTENSION_DIR}\visuald.pkgdef'
${AddItem} "$1${EXTENSION_DIR}\visuald.pkgdef"

Expand Down Expand Up @@ -438,6 +442,7 @@ ${MementoSection} "Install in VS 2017" SecVS2017

ReadRegStr $1 ${VS_REGISTRY_ROOT} "${VS2017_INSTALL_KEY}" "15.0"
StrCpy $1 "$1Common7\IDE\"
RMDir /r '$1${EXTENSION_DIR_APP}'
ExecWait 'rundll32 "$INSTDIR\${DLLNAME}" WritePackageDef ${VS2017_REGISTRY_KEY} $1${EXTENSION_DIR}\visuald.pkgdef'
${AddItem} "$1${EXTENSION_DIR}\visuald.pkgdef"

Expand Down
2 changes: 1 addition & 1 deletion vdc/abothe/Parser
Submodule Parser updated 39 files
+1 −0 .gitignore
+2 −5 DParser2/Completion/MemberCompletionEnumeration.cs
+2 −2 DParser2/Completion/ParameterInsightResolution.cs
+2 −2 DParser2/Completion/Providers/AttributeCompletionProvider.cs
+3 −12 DParser2/Completion/Providers/StructInitializerCompletion.cs
+1 −1 DParser2/DParser2.csproj
+7 −14 DParser2/Dom/Expressions/OperatorBasedExpression.cs
+4 −2 DParser2/Dom/Nodes/OtherNodeDefinitions.cs
+28 −3 DParser2/Misc/Mangling/Demangler.cs
+3 −1 DParser2/Refactoring/ClassInterfaceDerivativeFinder.cs
+13 −16 DParser2/Resolver/ASTScanner/AbstractVisitor.StatementHandler.cs
+4 −9 DParser2/Resolver/ASTScanner/AbstractVisitor.cs
+3 −1 DParser2/Resolver/ASTScanner/ItemEnumeration.cs
+29 −32 DParser2/Resolver/ASTScanner/NameScan.cs
+3 −26 DParser2/Resolver/ASTScanner/SingleNodeNameScan.cs
+29 −60 DParser2/Resolver/ExpressionSemantics/CTFE/FunctionEvaluation.cs
+9 −18 DParser2/Resolver/ExpressionSemantics/CTFE/InterpretationContext.cs
+2 −2 DParser2/Resolver/ExpressionSemantics/Evaluation.Identifiers.cs
+15 −16 DParser2/Resolver/ExpressionSemantics/Evaluation.PostfixExpressions.cs
+3 −7 DParser2/Resolver/ExpressionSemantics/Evaluation.PrimaryExpression.cs
+1 −2 DParser2/Resolver/ExpressionSemantics/Evaluation.UnaryExpressions.cs
+1 −1 DParser2/Resolver/ExpressionSemantics/Evaluation.cs
+1 −1 DParser2/Resolver/ExpressionSemantics/ExpressionTypeEvaluation.cs
+63 −81 DParser2/Resolver/ExpressionSemantics/ISymbolValueProvider.cs
+1 −1 DParser2/Resolver/ExpressionSemantics/MethodOverloadsByParameterTypeComparisonFilter.cs
+20 −11 DParser2/Resolver/Model/ContextFrame.cs
+15 −15 DParser2/Resolver/Model/DType.cs
+24 −5 DParser2/Resolver/ResolutionContext.cs
+1 −1 DParser2/Resolver/ResolvedTypeCloner.cs
+48 −23 DParser2/Resolver/StaticProperties.cs
+1 −3 DParser2/Resolver/Templates/DeducedTypeDictionary.cs
+2 −2 DParser2/Resolver/TypeResolution/ClassInterfaceResolver.cs
+31 −30 DParser2/Resolver/TypeResolution/DSymbolBaseTypeResolver.cs
+42 −109 DParser2/Resolver/TypeResolution/TypeDeclarationResolver.cs
+3 −1 DParser2/Resolver/TypeResolution/UFCSResolver.cs
+4 −4 Tests/CompletionTests.cs
+93 −0 Tests/ExpressionEvaluation/EvaluationTests.cs
+25 −0 Tests/Resolution/DeclDefScopingTests.cs
+6 −2 Tests/Resolution/MixinResolutionTests.cs
10 changes: 6 additions & 4 deletions vdc/abothe/comserver/VDServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ public void UpdateModule(string filename, string srcText, bool verbose)
try
{
ast = DParser.ParseString(srcText, false, true, _taskTokens);
}
catch(Exception ex)
}
catch (Exception ex)
{
ast = new DModule{ ParseErrors = new System.Collections.ObjectModel.ReadOnlyCollection<ParserError>(
new List<ParserError>{
Expand Down Expand Up @@ -441,7 +441,7 @@ public void GetTip(string filename, int startLine, int startIndex, int endLine,
v = Evaluation.EvaluateValue(var.Initializer, ctxt);
if (v == null && sr is IExpression)
v = Evaluation.EvaluateValue(sr as IExpression, ctxt);
if (v != null)
if (v != null && !(v is ErrorValue))
tipText.Append("\avalue = ").Append(v.ToString());
}
catch (Exception e)
Expand Down Expand Up @@ -768,7 +768,9 @@ public void GetReferencesResult(out string stringList)
///////////////////////////////////
void _setupEditorData()
{
string versions = _versionIds;
string versions = _versionIds;
if (!String.IsNullOrEmpty(versions) && !versions.EndsWith("\n"))
versions += "\n";
versions += "Windows\n" + "LittleEndian\n" + "D_HardFloat\n" + "all\n" + "D_Version2\n";
if ((_flags & 1) != 0)
versions += "unittest\n";
Expand Down
5 changes: 4 additions & 1 deletion visuald/colorizer.d
Original file line number Diff line number Diff line change
Expand Up @@ -1408,7 +1408,10 @@ class Colorizer : DisposingComObject, IVsColorizer, ConfigModifiedListener
if(mConfig)
{
ProjectOptions opts = mConfig.GetProjectOptions();
changes += modifyValue(opts.versionids, mConfigVersions[kIndexVersion]);

string versionids = mConfig.getCompilerVersionIDs();

changes += modifyValue(versionids, mConfigVersions[kIndexVersion]);
changes += modifyValue(opts.debugids, mConfigVersions[kIndexDebug]);
changes += modifyValue(opts.release, mConfigRelease);
changes += modifyValue(opts.useUnitTests, mConfigUnittest);
Expand Down
47 changes: 46 additions & 1 deletion visuald/config.d
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import std.string;
import std.conv;
import std.file;
import std.path;
import std.process : execute, ExecConfig = Config;
import std.utf;
import std.array;
import std.exception;
Expand Down Expand Up @@ -1592,7 +1593,7 @@ class ProjectOptions

fromElem(elem, "filesToClean", filesToClean);
}
};
}

class ConfigProvider : DisposingComObject,
// IVsExtensibleObject,
Expand Down Expand Up @@ -3308,6 +3309,50 @@ class Config : DisposingComObject,
return files;
}

string getCompilerVersionIDs()
{
ProjectOptions opts = GetProjectOptions();

string cmd = opts.buildCommandLine(this, true, false, null, true);
cmd ~= " -v -o- dummy.obj";
if (opts.additionalOptions.length)
cmd ~= " " ~ opts.additionalOptions;

__gshared string[string] cachedVersions;
synchronized
{
if (cmd.startsWith("dmd "))
cmd = quoteFilename(Package.GetGlobalOptions().DMD.getCompilerPath()) ~ cmd[3..$];
else if (cmd.startsWith("ldc2 "))
cmd = quoteFilename(Package.GetGlobalOptions().LDC.getCompilerPath()) ~ cmd[4..$];
else if (cmd.startsWith("gdc "))
cmd = quoteFilename(Package.GetGlobalOptions().GDC.getCompilerPath()) ~ cmd[3..$];

string key = cmd;
if (auto p = key in cachedVersions)
return *p;

string versions = opts.versionids;
try
{
auto cmds = tokenizeArgs(cmd);
auto res = execute(cmds, null, ExecConfig.suppressConsole);
if (res.status == 0)
{
auto lines = res.output.splitLines;
foreach(line; lines)
if (line.startsWith("predefs"))
versions = line[7..$];
}
}
catch(Exception)
{
}
cachedVersions[key] = versions;
return versions;
}
}

string GetPhobosPath()
{
string libpath = normalizeDir(GetIntermediateDir());
Expand Down
4 changes: 2 additions & 2 deletions visuald/dlangsvc.d
Original file line number Diff line number Diff line change
Expand Up @@ -881,8 +881,8 @@ class LanguageService : DisposingComObject,
if (cfgopts.addDepImp)
foreach(dep; cfg.getImportsFromDependentProjects())
imp.addunique(dep);

versionids = tokenizeArgs(cfgopts.versionids);
string versions = cfg.getCompilerVersionIDs();
versionids = tokenizeArgs(versions);
debugids = tokenizeArgs(cfgopts.debugids);
}
else
Expand Down
20 changes: 18 additions & 2 deletions visuald/dpackage.d
Original file line number Diff line number Diff line change
Expand Up @@ -1235,8 +1235,11 @@ struct CompilerDirectories
{
return detectCompilerVersion(InstallDir);
}

bool detectCompilerVersion(string instdir)
string getCompilerPath()
{
return getCompilerPath(InstallDir);
}
string getCompilerPath(string instdir)
{
string exe;
if (compiler == Compiler.DMD)
Expand All @@ -1252,7 +1255,12 @@ struct CompilerDirectories
exe = "bin\\gdc.exe";
}
exe = normalizeDir(instdir) ~ exe;
return exe;
}

bool detectCompilerVersion(string instdir)
{
string exe = getCompilerPath(instdir);
try
{
if(std.file.exists(exe))
Expand Down Expand Up @@ -1355,6 +1363,7 @@ class GlobalOptions
bool lastColorizeCoverage;
bool lastColorizeVersions;
bool lastUseDParser;
string lastInstallDirs;

int vsVersion;
bool isVS2017() { return vsVersion == 15; }
Expand Down Expand Up @@ -1834,6 +1843,7 @@ class GlobalOptions
UserTypesSpec = getStringOpt("UserTypesSpec", defUserTypesSpec);
UserTypes = parseUserTypes(UserTypesSpec);

lastInstallDirs = DMD.InstallDir ~ ";" ~ GDC.InstallDir ~ ";" ~ LDC.InstallDir;
lastColorizeCoverage = ColorizeCoverage;
lastColorizeVersions = ColorizeVersions;
lastUseDParser = useDParser;
Expand Down Expand Up @@ -1984,6 +1994,12 @@ class GlobalOptions
lastColorizeCoverage = ColorizeCoverage;
updateColorizer = true;
}
string installDirs = DMD.InstallDir ~ ";" ~ GDC.InstallDir ~ ";" ~ LDC.InstallDir;
if(lastInstallDirs != installDirs)
{
lastInstallDirs = installDirs;
updateColorizer = true;
}
if(updateColorizer)
if(auto svc = Package.s_instance.mLangsvc)
svc.UpdateColorizer(true);
Expand Down

0 comments on commit 72df0fe

Please sign in to comment.