Skip to content

Commit 736e331

Browse files
committed
build D_Parser against .net-framework 4.5
add (experimental) option to evaluate value of constant expression in tooltip new VC project: use $(LatestTargetPlatformVersion) as default sdk remove a couple of options and rearrange setting pages
1 parent 492c58d commit 736e331

File tree

17 files changed

+240
-130
lines changed

17 files changed

+240
-130
lines changed

CHANGES

Lines changed: 41 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -988,21 +988,46 @@ Version history
988988

989989
unreleased Version 0.48.0
990990

991-
* fixed uninstallation for VS2017
992-
* installation for VS2013+ now uses PackageManifest format instead of Vsix
993-
* restore project templates for VS2008, new project wizard doesn't work there'
994-
* new mixed D/C++ VC project: optionally adding main in C++, setup precompiled headers
995-
* avoid error message regarding altered assemblies with same version
996-
* fix default library path if UCRT has different version than SDK
997-
* fix help via F1 for dmd 2.072+
998-
* show detected compiler version below installation path
999-
* fix installation of the D icon for the solution explorer
991+
* installation
992+
- fixed uninstallation for VS2017
993+
- installation for VS2013+ now uses PackageManifest format instead of Vsix
994+
- VS2017: loading the Visual D package could crash with some VS installation "ids""
995+
- avoid initial error message regarding altered assemblies with same version
996+
- fix installation of the D icon for the solution explorer in VS2017
997+
- installer hides options for VS2005-VS2012 if not installed
998+
* new project wizard
999+
- restore project templates for VS2008, new project wizard doesn't work there'
1000+
- mixed D/C++ VC project: optionally adding main in C++, setup precompiled headers
1001+
- new VCProject: now uses $(LatestTargetPlatformVersion) as WindowsTargetPlatformVersion to
1002+
avoid defaulting to Windows SDK 8.1
1003+
* settings
1004+
- fix default library path if UCRT has different version than SDK
1005+
- VS2017: D compiler installation paths and "demangle link errors" are now saved
1006+
to "HKCR\Softwre\Visual D" to be picked up by msbuild
1007+
- show detected compiler version below installation path
1008+
- removed option "parse source for syntax errors", now always on
1009+
- removed option "expansions from text buffer", now always off
1010+
- removed option "use semantic analysis for goto definition", now always on
1011+
- removed option "override linker settings from sc.ini", always on as linker no
1012+
longer set in sc.ini since dmd 2.079
1013+
- removed option "additional linker options", it was invisible anyway
1014+
- rearrange settings to better show their scope
1015+
* dparser
1016+
- semantic analysis did not work if "parse source for syntax errors" was disabled
1017+
- no semantic info for a package if any file in the package has fatal parser error
1018+
- now has semantic support for static foreach (thanks to Alexander Bothe)
1019+
- fixed "Find references"
1020+
* mago
1021+
- added option to show base class fields as direct fields
1022+
- allow suffix 'h' for hex numbers for better interoperablility with VS disassembly
1023+
- concord: can now show return values of functions stepped over (not slices or delegates
1024+
on x64 or small non-POD-structs)
1025+
- concord: fix crash when showing children in data tooltip (mostly occured in VS2017)
1026+
- concord: allow dragging addresses to the disassembly window
1027+
- engine: Fix the way the debugger steps over instructions with REP prefix.
1028+
* cv2pdb
1029+
- can now detect VS2017 via Setup-COM-API
1030+
- some DWARF fixes
10001031
* when pasting code to D source file newlines are adapted to surrounding code
1001-
* VS2017: D compiler installation paths are now saved to "HKCR\Softwre\Visual D" to be picked up by msbuild
1002-
* mago: added option to show base class fields as direct fields
1003-
* semantic analysis did not work if "parse source for syntax errors" was disabled
1004-
* mago: can now show return values of functions stepped over (not slices or delegates or small non-POD-structs)
1005-
* mago: fix crash when showing children in data tooltip
10061032
* fixed "Compile and Run" on selection
1007-
* dparser: no semantic info for a package if any file in the package has fatal parser error
1008-
* dparser: now has semantic support for static foreach
1033+
* fix help via F1 for dmd 2.072+

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ vdserver:
4949
devenv /Project "vdserver" /Build "$(CONFIG)|Win32" visuald_vs10.sln
5050

5151
dparser:
52-
cd vdc\abothe && $(MSBUILD15) vdserver.sln /p:Configuration=Release;Platform="Any CPU" /p:TargetFrameworkVersion=4.0 /p:DefineConstants=NET40 /t:Rebuild
52+
cd vdc\abothe && $(MSBUILD15) vdserver.sln /p:Configuration=Release;Platform="Any CPU" /p:TargetFrameworkVersion=4.5 /p:DefineConstants=NET40 /t:Rebuild
5353

5454
fake_dparser:
5555
if not exist bin\Release\DParserCOMServer\nul md bin\Release\DParserCOMServer

doc/Editor.dd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ $(UL
2020
)
2121
)
2222

23-
$(P The colorizer can be configured in the "Colorizer" setup page of the language settings in
24-
Tools->Options->Text Editor->D->Colorizer: )
23+
$(P The colorizer can be configured in the "Editor" setup page of the language settings in
24+
Tools->Options->Text Editor->D->Editor: )
2525

2626
$(IMG_CENTER images/editor-options.png)
2727

msbuild/dbuild/CompileD.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -889,11 +889,11 @@ protected static ushort GetPEArchitecture(string pFilePath)
889889
{
890890
using (System.IO.BinaryReader bReader = new System.IO.BinaryReader(fStream))
891891
{
892-
if (bReader.ReadUInt16() == 23117) //check the MZ signature
892+
if (bReader.ReadUInt16() == 0x5A4D) //check the MZ signature
893893
{
894894
fStream.Seek(0x3A, System.IO.SeekOrigin.Current); //seek to e_lfanew.
895895
fStream.Seek(bReader.ReadUInt32(), System.IO.SeekOrigin.Begin); //seek to the start of the NT header.
896-
if (bReader.ReadUInt32() == 17744) //check the PE\0\0 signature.
896+
if (bReader.ReadUInt32() == 0x4550) //check the PE\0\0 signature.
897897
{
898898
fStream.Seek(20, System.IO.SeekOrigin.Current); //seek past the file header,
899899
architecture = bReader.ReadUInt16(); //read the magic number of the optional header.

msbuild/dcompile_defaults.props

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,11 @@
2727

2828
<DDemangleLink Condition="$(DDemangleLink) == ''">$([MSBuild]::GetRegistryValueFromView('HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\$(VisualStudioVersion)\ToolsOptionsPages\Projects\Visual D Settings', 'demangleError', '', RegistryView.Registry64, RegistryView.Registry32))</DDemangleLink>
2929
<DDemangleLink Condition="$(DDemangleLink) == ''">$([MSBuild]::GetRegistryValueFromView('HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\$(VisualStudioVersion)_Config\ToolsOptionsPages\Projects\Visual D Settings', 'demangleError', '', RegistryView.Registry64, RegistryView.Registry32))</DDemangleLink>
30+
<DDemangleLink Condition="$(DDemangleLink) == ''">$([MSBuild]::GetRegistryValueFromView('HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\$(VisualStudioVersion)_Config\ToolsOptionsPages\Projects\Visual D Settings', 'demangleError', '', RegistryView.Registry64, RegistryView.Registry32))</DDemangleLink>
31+
<DDemangleLink Condition="$(DDemangleLink) == ''">$([MSBuild]::GetRegistryValueFromView('HKEY_CURRENT_USER\SOFTWARE\Visual D\dbuild\$(VisualStudioVersion)', 'demangleError', '', RegistryView.Registry64, RegistryView.Registry32))</DDemangleLink>
3032
<DDemangleLink Condition="$(DDemangleLink) == ''">1</DDemangleLink>
31-
</PropertyGroup>
33+
34+
</PropertyGroup>
3235

3336
<ItemDefinitionGroup>
3437
<DCompile>

vdc/abothe/comserver/VDServer.cs

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public interface IVDServer
4242
void ConfigureSemanticProject(string filename, string imp, string stringImp, string versionids, string debugids, uint flags);
4343
void ClearSemanticProject();
4444
void UpdateModule(string filename, string srcText, bool verbose);
45-
void GetTip(string filename, int startLine, int startIndex, int endLine, int endIndex);
45+
void GetTip(string filename, int startLine, int startIndex, int endLine, int endIndex, int flags);
4646
void GetTipResult(out int startLine, out int startIndex, out int endLine, out int endIndex, out string answer);
4747
void GetSemanticExpansions(string filename, string tok, uint line, uint idx, string expr);
4848
void GetSemanticExpansionsResult(out string stringList);
@@ -375,7 +375,7 @@ void runAsync(Action a)
375375
}
376376
}
377377

378-
public void GetTip(string filename, int startLine, int startIndex, int endLine, int endIndex)
378+
public void GetTip(string filename, int startLine, int startIndex, int endLine, int endIndex, int flags)
379379
{
380380
filename = normalizePath(filename);
381381
var ast = GetModule(filename);
@@ -428,26 +428,28 @@ public void GetTip(string filename, int startLine, int startIndex, int endLine,
428428
while (tipText.Length > 0 && tipText[tipText.Length - 1] == '\a')
429429
tipText.Length--;
430430

431-
#if false
432-
var ctxt = _editorData.GetLooseResolutionContext(LooseResolution.NodeResolutionAttempt.Normal);
433-
ctxt.Push(_editorData);
434-
try
435-
{
436-
ISymbolValue v = null;
437-
var var = dn as DVariable;
438-
if (var != null && var.Initializer != null && var.IsConst)
439-
v = Evaluation.EvaluateValue(var.Initializer, ctxt);
440-
if (v == null && sr is IExpression)
441-
v = Evaluation.EvaluateValue(sr as IExpression, ctxt);
442-
if (v != null)
443-
tipText.Append("\avalue = ").Append(v.ToString());
444-
}
445-
catch(Exception e)
431+
bool eval = (flags & 1) != 0;
432+
if (eval)
446433
{
447-
tipText.Append("\aException during evaluation = ").Append(e.Message);
434+
var ctxt = _editorData.GetLooseResolutionContext(LooseResolution.NodeResolutionAttempt.Normal);
435+
ctxt.Push(_editorData);
436+
try
437+
{
438+
ISymbolValue v = null;
439+
var var = dn as DVariable;
440+
if (var != null && var.Initializer != null && var.IsConst)
441+
v = Evaluation.EvaluateValue(var.Initializer, ctxt);
442+
if (v == null && sr is IExpression)
443+
v = Evaluation.EvaluateValue(sr as IExpression, ctxt);
444+
if (v != null)
445+
tipText.Append("\avalue = ").Append(v.ToString());
446+
}
447+
catch (Exception e)
448+
{
449+
tipText.Append("\aException during evaluation = ").Append(e.Message);
450+
}
451+
ctxt.Pop();
448452
}
449-
ctxt.Pop();
450-
#endif
451453

452454
if (dn != null)
453455
VDServerCompletionDataGenerator.GenerateNodeTooltipBody(dn, tipText);

vdc/ivdserver.d

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import sdk.win32.oleauto;
3232
// expensive calls to be asynchronous: methods GetTip, GetDefinition, GetSemanticExpansions
3333
// and UpdateModule return immediately, but start some background processing.
3434
// The client (aka Visual D) polls the result with GetTipResult, GetDefinitionResult,
35-
// GetSemanticExpansionsResult // and GetParseErrors, repectively, until they return successfully.
35+
// GetSemanticExpansionsResult and GetParseErrors, repectively, until they return successfully.
3636
// While doing so, GetLastMessage is called to get status line messages (e.g. "parsing module...")
3737
//
3838
// All methods reference modules by their file name.
@@ -86,10 +86,11 @@ public:
8686
// filename: file name
8787
// startLine, startIndex, endLine, endIndex: selected range in the editor
8888
// if start==end, mouse hovers without selection
89+
// flags: 1 - try to evaluate constants/expressions
8990
//
9091
// it is assumed that the semantic analysis is forwarded to some other thread
9192
// and that the status can be polled by GetTipResult
92-
HRESULT GetTip(in BSTR filename, int startLine, int startIndex, int endLine, int endIndex);
93+
HRESULT GetTip(in BSTR filename, int startLine, int startIndex, int endLine, int endIndex, int flags);
9394

9495
// get the result of the previous GetTip
9596
//

vdc/vdserver.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ class VDServer : ComObject, IVDServer
276276
return S_OK;
277277
}
278278

279-
override HRESULT GetTip(in BSTR filename, int startLine, int startIndex, int endLine, int endIndex)
279+
override HRESULT GetTip(in BSTR filename, int startLine, int startIndex, int endLine, int endIndex, int flags)
280280
{
281281
string fname = to_string(filename);
282282
ast.Module mod;

vdc/vdserver.idl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ interface IVDServer : IUnknown
2222
HRESULT ConfigureSemanticProject([in] BSTR filename, [in] BSTR imp, [in] BSTR stringImp, [in] BSTR versionids, [in] BSTR debugids, [in] DWORD flags);
2323
HRESULT ClearSemanticProject();
2424
HRESULT UpdateModule([in] BSTR filename, [in] BSTR srcText, [in] BOOL verbose);
25-
HRESULT GetTip([in] BSTR filename, [in] DWORD startLine, [in] DWORD startIndex, [in] DWORD endLine, [in] DWORD endIndex);
25+
HRESULT GetTip([in] BSTR filename, [in] DWORD startLine, [in] DWORD startIndex, [in] DWORD endLine, [in] DWORD endIndex, [in] DWORD flags);
2626
HRESULT GetTipResult([out] DWORD *startLine, [out] DWORD *startIndex, [out] DWORD *endLine, [out] DWORD *endIndex, [out,retval] BSTR* answer);
2727
HRESULT GetSemanticExpansions([in] BSTR filename, [in] BSTR tok, [in] DWORD line, [in] DWORD idx, [in] BSTR expr);
2828
HRESULT GetSemanticExpansionsResult([out,retval] BSTR* stringList);

vdextensions/vdextensions.sln

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 14
4-
VisualStudioVersion = 14.0.25420.1
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.28010.2016
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "vdextensions", "vdextensions.csproj", "{3A338E86-A08A-4F9A-8DB1-A5C280773BA3}"
77
EndProject
@@ -185,4 +185,7 @@ Global
185185
GlobalSection(SolutionProperties) = preSolution
186186
HideSolutionNode = FALSE
187187
EndGlobalSection
188+
GlobalSection(ExtensibilityGlobals) = postSolution
189+
SolutionGuid = {D174EDB9-40A2-454C-8997-4BDB7FB1C00C}
190+
EndGlobalSection
188191
EndGlobal

0 commit comments

Comments
 (0)