Skip to content

Commit

Permalink
Merge pull request #7 from rainers/master
Browse files Browse the repository at this point in the history
transfer to dlang.org
  • Loading branch information
rainers committed Oct 18, 2013
2 parents 4868de7 + bad6051 commit 92359d8
Show file tree
Hide file tree
Showing 31 changed files with 969 additions and 125 deletions.
7 changes: 7 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -571,3 +571,10 @@ unreleased Version 0.3.37
* fixed building with -op and source files on different drive than project
* added file options per configuration
* fixed invoking bad command when no files to compile, but additional arguments set
* added support for VS 2013 to installer, removed VS.NET 2003
* installer now picks up dmd2 folder from DMD installation
* changed license to Boost
* added global option to display the reason for building a target
* fixed custom build rules executed twice sometimes
* improved indentation after opening parenthesis to follow next token
* added commands "Collapse unittests" and "Collapse disabled" to the outlining menu
8 changes: 4 additions & 4 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,18 @@ Project:
- separate compile + link does not write to object dir
- ddoc files
- additional options for resource compiler
- compile and run current buffer/selection
- pass import path from static lib project to dependent projects
- file properties per configuration
- single file compilation for file configuration
- custom command: quotes in dependencies not supported
- different lib paths for Win32/Win64
- support [Environment64] in sc.ini

Language service:
-----------------
- goto definition does not know about scope
- use spell-checker on completion?
- case insensitive completion?
- showScope: function/delegate literal not shown correctly, in/out/body
- collapse disabled version/debug blocks
- disable parsing/outlining for large files?
- replace token: empty dialog when opened without resizing
- check indentation of multiple string literals on several lines
Expand All @@ -65,7 +64,8 @@ Lexer/Parser:
- do not parse file if it is D1?
- deprecated syntax
- syntax error with "@disable new()"
- integrate d_parser.dll
+ integrate d_parser.dll
- 0.ident

Semantics:
---------------
Expand Down
9 changes: 8 additions & 1 deletion doc/Debugging.dd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ $(H2 Visual Studio Debugger)
$(P Thanks to $(LINK2 http://www.dsource.org/projects/cv2pdb, cv2pdb), debugging in Visual Studio integrates well.
Here is an example debugging session)

$(IMG_CENTER images/debug.png, 90%)
<div align="center"><img src="images/debug.png" width="90%"/></div>

$(P Using cv2pdb has a few quirks, like displaying '@' instead of '.'. This is happening because the C++ debugger
that comes with Visual Studio is used and it is confused if there is a '.' in a symbol name.)
Expand Down Expand Up @@ -40,5 +40,12 @@ simply enable the "D Exceptions" entry, but must select the specific exceptions

$(IMG_CENTER images/d_exceptions.png)

$(H2 Visual Studio 2012)

Visual Studio 2012 introduced a new debug engine that loses some of the capabilities of the
preceding debug engine. This includes displaying variables in the Watch Window. You
can switch back to the old debug engine by going to Tools->Options and then under the debugger
settings, turn on native edit and continue. This will also reenable the visualizer macros in autoexp.dat.

Macros:
TITLE=Debugging
13 changes: 7 additions & 6 deletions doc/StartPage.dd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ $(TD $(IMG images/vd_logo.png))
$(TD
$(P Visual D is a Visual Studio package providing both project management and language services.
It works with Visual Studio 2005, 2008, 2010 and 2012 as well as the free Visual Studio Shells.
See the $(LINK2 installation.html, Installation) instructions, especially if not using a commercial edition of Visual Studio.)
See the $(LINK2 Installation.html, Installation) instructions, especially if not using a commercial edition of Visual Studio.)

$(P Visual D aims at providing seamless integration of the D programming language into Visual Studio.))
)
Expand Down Expand Up @@ -37,16 +37,17 @@ $(UL
$(LI Completely written in D)
)
) $(TD
<img src="images/fullvs.png" width="100%"/>
$(LINK2 images/fullvs.png, <img src="images/fullvs.png" width="100%"/>)
))

$(LINK2 features.html, Read more...)
$(LINK2 Features.html, Read more...)

$(H2 News)

$(LINK2 versionhistory.html, Full version history and complete details...)
$(LINK2 VersionHistory.html, Full version history and complete details...)
$(BR)

2013-05-10 $(LINK2 news36.html, Version 0.3.36)
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)
$(LI basic LDC support)
Expand All @@ -73,7 +74,7 @@ $(UL
$(LI fixed spurious crashes due to bug in precise garbage collection)
)

$(LINK2 versionhistory.html, more...)
$(LINK2 VersionHistory.html, more...)

$(H2 Download)

Expand Down
12 changes: 7 additions & 5 deletions doc/visuald.ddoc
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ TOP=
</div>
</form>
<div id="toctop">
$(UL $(H2 <a href="../index.html" title="D Programming Language">D</a>)
$(LI <a href="../download.html" title="Download a D compiler">Downloads &amp; Tools</a>)
$(LI <a href="../spec.html" title="D Language Specification">Language</a>)
$(LI <a href="../phobos/index.html" title="D Runtime Library">Phobos $(LATEST)</a>)
$(UL $(H2 <a href="$(DLANG_ORG)/index.html" title="D Programming Language">D</a>)
$(LI <a href="$(DLANG_ORG)/download.html" title="Download a D compiler">Downloads &amp; Tools</a>)
$(LI <a href="$(DLANG_ORG)/spec.html" title="D Language Specification">Language</a>)
$(LI <a href="$(DLANG_ORG)/phobos/index.html" title="D Runtime Library">Runtime Library $(LATEST)</a>)
)
</div>
</div>
Expand All @@ -163,7 +163,7 @@ NAVIGATION_VISUALD=
<div class="navblock">
$(H2 <a href="StartPage.html" title="Visual Studio Plugin for D">Visual D</a>)
$(UL
$(LI <a href="VersionHistory.html" title="Latest changes">News</a>)
$(LI <a href="VersionHistory.html" title="Latest changes">Version History</a>)
$(LI <a href="Features.html" title="Visual D Features">Features</a>)
$(LI <a href="Installation.html" title="Installation">Installation</a>)
$(LI
Expand Down Expand Up @@ -247,6 +247,8 @@ TD = <td valign=top>$0</td>
TDNW = <td valign=top class="donthyphenate">$0</td>
SUB = <sub>$0</sub>

DLANG_ORG=..
_=http://www.dlang.org
COPYRIGHT= Copyright &copy; 1999-$(YEAR) by Digital Mars, All Rights Reserved

H2=<h2>$0</h2>
Expand Down
21 changes: 13 additions & 8 deletions nsis/visuald.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
!define MAGO_CLSID {97348AC0-2B6B-4B99-A245-4C7E2C09D403}
!define MAGO_ENGINE_KEY AD7Metrics\Engine\${MAGO_CLSID}
!define MAGO_EXCEPTION_KEY AD7Metrics\Exception\${MAGO_CLSID}
!define MAGO_ABOUT "A debug engine dedicated to debugging applications written in the D programming language. See the project website at http://www.dsource.org/projects/mago_debugger for more information. Copyright (c) 2010 Aldo J. Nunez"
!define MAGO_ABOUT "A debug engine dedicated to debugging applications written in the D programming language. See the project website at http://www.dsource.org/projects/mago_debugger for more information. Copyright (c) 2010-2013 Aldo J. Nunez"

!searchparse /file ../../../mago/include/magoversion.h "#define MAGO_VERSION_MAJOR " MAGO_VERSION_MAJOR
!searchparse /file ../../../mago/include/magoversion.h "#define MAGO_VERSION_MINOR " MAGO_VERSION_MINOR
Expand Down Expand Up @@ -120,6 +120,7 @@
;--------------------------------
;installation time variables
Var DMDInstallDir
Var DInstallDir

;--------------------------------
;Interface Settings
Expand Down Expand Up @@ -458,16 +459,16 @@ SectionEnd
LangString DESC_SecVCExpress2010 ${LANG_ENGLISH} "Register for usage in Visual C++ Express 2010 (experimental and unusable)."
!endif
!ifdef CV2PDB
LangString DESC_SecCv2pdb ${LANG_ENGLISH} "cv2pdb is necessary to debug executables in Visual Studio."
LangString DESC_SecCv2pdb ${LANG_ENGLISH} "cv2pdb is necessary to debug Win32 executables in Visual Studio."
LangString DESC_SecCv2pdb2 ${LANG_ENGLISH} "$\r$\nYou might not want to install it, if you have already installed it elsewhere."
!endif
!ifdef MAGO
LangString DESC_SecMago ${LANG_ENGLISH} "Mago is a debug engine especially designed for the D-Language."
LangString DESC_SecMago2 ${LANG_ENGLISH} "$\r$\nMago is written by Aldo Nunez. It is in an early alpha stage, so some things are still in an experimental stage."
LangString DESC_SecMago2 ${LANG_ENGLISH} "$\r$\nMago is written by Aldo Nunez. Distributed under the Apache License Version 2.0. See www.dsource.org/ projects/mago_debugger"
!endif
!ifdef DPARSER
LangString DESC_SecDParser ${LANG_ENGLISH} "DParser is a Parser & Resolver & Completion library for D."
LangString DESC_SecDParser2 ${LANG_ENGLISH} "$\r$\nDParser is written by Alexander Bothe. See https://github.com/aBothe/D_Parser"
LangString DESC_SecDParser ${LANG_ENGLISH} "DParser is a Parser && Resolver && Completion library for D."
LangString DESC_SecDParser2 ${LANG_ENGLISH} "$\r$\nDParser is written by Alexander Bothe. Distributed under the Apache License Version 2.0. See https://github.com/ aBothe/D_Parser"
!endif

;Assign language strings to sections
Expand Down Expand Up @@ -697,9 +698,13 @@ Function DMDInstallPage
!insertmacro MUI_HEADER_TEXT "DMD Installation Folder" "Specify the directory where DMD is installed"

ReadRegStr $DMDInstallDir HKLM "Software\${APPNAME}" "DMDInstallDir"
IfErrors 0 NoDMDInstallDir
ReadRegStr $DMDInstallDir HKLM "SOFTWARE\D" "Install_Dir"
NoDMDInstallDir:
IfErrors DMDInstallDirEmpty
StrCmp "$DMDInstallDir" "" DMDInstallDirEmpty HasDMDInstallDir
DMDInstallDirEmpty:
ReadRegStr $DInstallDir HKLM "SOFTWARE\D" "Install_Dir"
IfErrors HasDmdInstallDir
StrCpy $DmdInstallDir $DInstallDir\dmd2
HasDMDInstallDir:

WriteINIStr "$PLUGINSDIR\dmdinstall.ini" "Field 1" "State" $DMDInstallDir
!insertmacro INSTALLOPTIONS_DISPLAY "dmdinstall.ini"
Expand Down
21 changes: 8 additions & 13 deletions vdc/abothe/VDServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ void addExpansion(string name)
[ClassInterface(ClassInterfaceType.None)]
public class VDServer : IVDServer
{
private ParseCacheList _parseCacheList;
private ParseCache _parseCache;
private CodeLocation _tipStart, _tipEnd;
private string _tipText;
private string _expansions;
Expand All @@ -135,10 +133,6 @@ public class VDServer : IVDServer

public VDServer()
{
_parseCacheList = new ParseCacheList();
_parseCache = new ParseCache();
_parseCacheList.Add(_parseCache);

// MessageBox.Show("VDServer()");
}

Expand All @@ -147,8 +141,7 @@ public void ConfigureSemanticProject(string filename, string imp, string stringI
if (_imports != imp)
{
var impDirs = imp.Split('\n');
if(_parseCache.UpdateRequired(impDirs))
_parseCache.BeginParse(impDirs, "");
GlobalParseCache.BeginAddOrUpdatePaths(impDirs);
}
_imports = imp;
_stringImports = stringImp;
Expand Down Expand Up @@ -186,11 +179,11 @@ public void UpdateModule(string filename, string srcText, bool verbose)
if (_modules.TryGetValue(filename, out oldast))
{
//_parseCache.UfcsCache.RemoveModuleItems(oldast);
_parseCache.Remove(oldast);
GlobalParseCache.RemoveModule(oldast);
}
_parseCache.AddOrUpdate(ast);
GlobalParseCache.AddOrUpdateModule(ast);
ConditionalCompilationFlags cflags = new ConditionalCompilationFlags(_editorData);
_parseCache.UfcsCache.CacheModuleMethods(ast, ResolutionContext.Create(_parseCacheList, cflags, null, null));
//GlobalParseCache.UfcsCache.CacheModuleMethods(ast, ResolutionContext.Create(_parseCacheList, cflags, null, null));

_modules[filename] = ast;
_sources[filename] = srcText;
Expand Down Expand Up @@ -221,6 +214,7 @@ public void GetTip(string filename, int startLine, int startIndex, int endLine,
_tipEnd = new CodeLocation(startIndex + 2, startLine);
_tipText = "";

_setupEditorData();
_editorData.CaretLocation = _tipStart;
_editorData.SyntaxTree = ast as DModule;
_editorData.ModuleCode = _sources[filename];
Expand Down Expand Up @@ -255,6 +249,7 @@ public void GetSemanticExpansions(string filename, string tok, uint line, uint i
if (!_modules.TryGetValue(filename, out ast))
throw new COMException("module not found", 1);

_setupEditorData();
CodeLocation loc = new CodeLocation((int)idx + 1, (int) line);
_editorData.SyntaxTree = ast as DModule;
_editorData.ModuleCode = _sources[filename];
Expand Down Expand Up @@ -329,6 +324,7 @@ public void GetDefinition(string filename, int startLine, int startIndex, int en
_tipEnd = new CodeLocation(endIndex + 1, endLine);
_tipText = "";

_setupEditorData();
_editorData.CaretLocation = _tipEnd;
_editorData.SyntaxTree = ast as DModule;
_editorData.ModuleCode = _sources[filename];
Expand Down Expand Up @@ -385,7 +381,7 @@ void _setupEditorData()
else
versions += "DigitalMars\n";

_editorData.ParseCache = _parseCacheList;
_editorData.ParseCache = new ParseCacheView(_imports.Split('\n'));
_editorData.IsDebug = (_flags & 2) != 0;
_editorData.DebugLevel = (int)(_flags >> 16) & 0xff;
_editorData.VersionNumber = (int)(_flags >> 8) & 0xff;
Expand All @@ -396,7 +392,6 @@ void _setupEditorData()
CompletionOptions.Instance.HideDeprecatedNodes = (_flags & 128) != 0;
}


#if false
[EditorBrowsable(EditorBrowsableState.Never)]
[ComRegisterFunction()]
Expand Down
10 changes: 5 additions & 5 deletions vdc/parser.visualdproj
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
<Config name="TestDebug" platform="Win32">
<obj>0</obj>
<link>0</link>
<lib>1</lib>
<lib>0</lib>
<subsystem>0</subsystem>
<multiobj>0</multiobj>
<singleFileCompilation>0</singleFileCompilation>
Expand Down Expand Up @@ -254,7 +254,7 @@
<debuglevel>0</debuglevel>
<debugids />
<versionlevel>0</versionlevel>
<versionids />
<versionids>MAIN</versionids>
<dump_source>0</dump_source>
<mapverbosity>0</mapverbosity>
<createImplib>0</createImplib>
Expand Down Expand Up @@ -1138,10 +1138,10 @@
<File path="ast\misc.d" />
<File path="ast\mod.d" />
<File path="ast\node.d" />
<File path="ast\stmt.d" />
<File path="ast\tmpl.d" />
<File path="ast\type.d" />
<File path="ast\writer.d" />
<File path="ast\stmt.d" />
</Folder>
<Folder name="parser">
<File path="parser\aggr.d" />
Expand All @@ -1151,17 +1151,17 @@
<File path="parser\iasm.d" />
<File path="parser\misc.d" />
<File path="parser\mod.d" />
<File path="parser\stmt.d" />
<File path="parser\tmpl.d" />
<File path="parser\stmt.d" />
</Folder>
<File path="interpret.d" />
<File path="ivdserver.d" />
<File path="lexer.d" />
<File path="logger.d" />
<File path="parsertest.d" />
<File path="semantic.d" />
<File path="util.d" />
<File path="vdserver.d" />
<File path="versions.d" />
<File path="semantic.d" />
</Folder>
</DProject>
4 changes: 2 additions & 2 deletions vdc/parsertest.d
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ int main(string[] argv)
});
return semanticErrors > 0 ? 1 : 0;
}
else
else if (false)
{
Project prj = new Project;
prj.options.setImportDirs(imps);
Expand All @@ -720,8 +720,8 @@ int main(string[] argv)
string fname = imps[1] ~ r"std\datetime.d";
prj.addAndParseFile(fname);
}
return 0;
}
return 0;
}
}

4 changes: 2 additions & 2 deletions vdc/vdserver.visualdproj
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
<resfile />
<exefile>$(OutDir)\$(ProjectName).exe</exefile>
<useStdLibPath>1</useStdLibPath>
<additionalOptions />
<additionalOptions>-L/SUBSYSTEM:WINDOWS</additionalOptions>
<preBuildCommand />
<postBuildCommand />
<filesToClean>*.obj;*.cmd;*.build;*.json;*.dep</filesToClean>
Expand Down Expand Up @@ -948,7 +948,7 @@ midl /D _DEBUG /nologo /char signed /env win32 /Oicf /out &quot;$(OutDir)&quot;
if errorlevel 1 goto reportError
rc /fo&quot;$(OutDir)\vdserver.res&quot; &quot;/I$(OutDir)&quot; $(InputPath)" outfile="$(OutDir)\vdserver.res" linkoutput="true" />
<File path="vdserver.reg" />
<File path="vdserver_d.reg" />
<File path="vdserverfactory.d" />
<File path="vdserver_d.reg" />
</Folder>
</DProject>
9 changes: 5 additions & 4 deletions vdc/vdserverfactory.d
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class VDServerClassFactory : ComObject, IClassFactory

///////////////////////////////////////////////////////////////

int vdserver_main(string[] argv)
extern(C) int vdserver_main(char[][] argv)
{
HRESULT hr;

Expand Down Expand Up @@ -140,20 +140,21 @@ import std.conv;
static if(version_minor < 64)
{
// dmd 2.064 implicitely adds C main with D main
int main(string[] argv)
int main(char[][] argv)
{
return vdserver_main(argv);
}
}
else
{
extern(C) int _d_run_main(int argc, char **argv, void* mainFunc);
private alias extern(C) int function(char[][] args) MainFunc;
extern(C) int _d_run_main(int argc, char **argv, MainFunc func);

extern (Windows)
int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
char*[2] argv;
argv[0] = lpCmdLine;
argv[0] = cast(char*)("prg".ptr);
argv[1] = null;
return _d_run_main(1, argv.ptr, &vdserver_main);
}
Expand Down
Loading

0 comments on commit 92359d8

Please sign in to comment.