|
| 1 | +Ddoc |
| 2 | + |
| 3 | +$(P The latest release 0.3.36 of Visual D included a considerable number of bug fixes and improvements |
| 4 | +(you can find all of them listed in the $(DDLINK VersionHistory,history)), but I'd like to detail on a few |
| 5 | +bigger highlights. |
| 6 | +) |
| 7 | + |
| 8 | +$(H2 Unit testing and code coverage) |
| 9 | + |
| 10 | +$(P With unittesting built into the D programming language testing your code gets even simpler in |
| 11 | +combination with Visual D. With the new command "Compile and Run" from the Visual D menu you can compile |
| 12 | +the current D source file through rdmd which will pick up imported modules automatically |
| 13 | +and add them to the compilation. If the file is part of a project in the solution |
| 14 | +the current compiler settings will be used, otherwise the defaults from the !ConsoleApp |
| 15 | +project template are taken. You can add other options in Visual D's global |
| 16 | +project settings. |
| 17 | +) |
| 18 | + |
| 19 | +$(IMG_CENTER images/compile_and_run_opt.png) |
| 20 | + |
| 21 | +$(P The standard is "-unittest --main" so after successfully building the |
| 22 | +source file to an executable ("--main" adds an empty main function to the source to automatically create a valid executable), your unit tests will run and you will see |
| 23 | +the result in the output pane. |
| 24 | +) |
| 25 | + |
| 26 | +$(P [Actually, while writing this text a number of issues have been fixed and improvements |
| 27 | +have been made, so please try the latest release candidate for next version of Visual D |
| 28 | +from the download folder (0.3.37rc1 as of now). Especially, it will remove some of the |
| 29 | +command line options used to call rdmd that make it crash pretty often.] |
| 30 | +) |
| 31 | + |
| 32 | +<table><tr><td valign="top" width="45%"> |
| 33 | +$(P If you add "-cov" to the command line aswell the executable will be instrumented to record |
| 34 | +the source code lines that have been executed and will mark the lines that have |
| 35 | +code generated but are never executed. This information is written into files named as the |
| 36 | +source files but with extension ".lst". If you enable option "Colorize Coverage" in |
| 37 | +the Visual D colorizer settings (easily reachable through the new entry in the Visual D |
| 38 | +menu), these lines will be highlighted in the editor. The highlighting will not show |
| 39 | +up unless the lst-file is newer than the source file as it will probably be out of sync |
| 40 | +otherwise. |
| 41 | +) |
| 42 | + |
| 43 | +$(P If you fix the last test and add the line |
| 44 | +$(D assert(fib(19) == 4181);) |
| 45 | +to the unittest, and run the unittest again, all lines will become green. |
| 46 | +) |
| 47 | + |
| 48 | +$(P If you start editing the source file Visual D will try to keep coverage information in sync. |
| 49 | +If you want to get rid of the coverage coloring, just resave the source file. |
| 50 | +Visual D will assume the coverage is invalid then and stop displaying it. |
| 51 | +) |
| 52 | + |
| 53 | +$(P If you don't want syntax highlighting from coverage generated .LST files, you can disable |
| 54 | +it by disabling the respective option on the Tools->Options->Text Editor->D->Colorizer page. |
| 55 | +) |
| 56 | +</td><td width="55%"> |
| 57 | +$(IMG_CENTER images/coverage.png) |
| 58 | +</td></tr></table> |
| 59 | + |
| 60 | +$(P If you select code within the editor and issue the command "Compile and Run", only |
| 61 | +the selected code will be passed to rdmd through the --eval option. This allows to |
| 62 | +execute just a code snippet like a script and see whether it compiles and how it behaves. |
| 63 | +) |
| 64 | + |
| 65 | +$(H1 New code completion engine by Alexander Bothe) |
| 66 | + |
| 67 | +$(P While Visual D has been running a semantic analysis for about a year now to |
| 68 | +support code completion and type information in tool tips, I didn't have much time |
| 69 | +to complete it to support all aspects of the D programming language. It is especially |
| 70 | +lacking on topics like template instantiation, function overload resolution and |
| 71 | +unified function call syntax (UFCS). Also, compile time function evaluation (CTFE) is |
| 72 | +pretty incomplete. |
| 73 | +Due to its pretty large memory foot print the |
| 74 | +stop-the-world garbage collector has been interrupting the source code editing to |
| 75 | +inacceptable degrees, so the analyzer had been |
| 76 | +moved into a separate process communicating with Visual D as a local COM server. |
| 77 | +) |
| 78 | + |
| 79 | +$(P This also opens the door to easily exchange the semantic analyzer with a different engine, |
| 80 | +so this is where Alexander Bothe's parsing engine enters the scene, the engine that |
| 81 | +also powers Mono-D and D-IDE. |
| 82 | +) |
| 83 | + |
| 84 | +$(IMG_CENTER images/intellisense_options.png) |
| 85 | + |
| 86 | +$(P Alex has put much more effort into making the semantic |
| 87 | +analysis complete, and it obviously does it more efficiently. I wrapped the library |
| 88 | +as a local COM server implementing the same interfaces as Visual D's engine (having to do |
| 89 | +this in C# was a bit of a downer) and just using a different factory now allows switching |
| 90 | +between the two. Right now, Visual D's engine is the default, but you can select |
| 91 | +Alex's engine by enabling the respective checkbox in the Intellisense |
| 92 | +settings page (there is a new menu entry for faster access). It provides UFCS |
| 93 | +expansion and also displays DDoc help strings in tool tips. |
| 94 | +) |
| 95 | + |
| 96 | +$(P There is currently work being done on the D front end implemented by DMD |
| 97 | +to be converted from C++ to D, bringing it within reach of using it as a library for IDEs. |
| 98 | +This might produce |
| 99 | +another semantic engine in the future which easily keeps in lock step with the latest |
| 100 | +compiler updates. |
| 101 | +) |
| 102 | + |
| 103 | +$(H2 LDC support) |
| 104 | + |
| 105 | +$(P LDC, the D compiler built on top of the LLVM compiler infrastructure is getting |
| 106 | +close to being useful on Windows aswell (at least on Win64 the longest standing |
| 107 | +blocker exception handling is starting to work). You can grab pre-compiled binaries |
| 108 | +here: http://www.redstar.de/ldc/LDC.zip (after extracting to any directory just update |
| 109 | +the paths specified in LDC2\etc\ldc2.conf). |
| 110 | +In the Visual D project options, path settings for the three major compilers have been |
| 111 | +separated to different pages allowing for different import and library paths aswell. |
| 112 | +The specified install directories are mapped to macros like $(LDCINSTALLDIR), so they |
| 113 | +can be reused in other places of your project configuration. |
| 114 | +To use LDC by your project, select the compiler with the respective option on the |
| 115 | +General page of your project's property page. |
| 116 | +) |
| 117 | + |
| 118 | +$(IMG_CENTER images/ldc_compiler.png) |
| 119 | + |
| 120 | +$(P Please be aware that both LDC for Windows aswell as the Visual D support for |
| 121 | +it are pretty experimental, so expect some glitches. Known issue: there is no debug |
| 122 | +information in the built executable that can be used by the VS debugger. |
| 123 | +) |
| 124 | + |
| 125 | +$(H2 Trivia) |
| 126 | + |
| 127 | +$(P If you ever wondered why Visual D versions are numbered 0.3.x, here is the explanation: |
| 128 | +Each package to be loaded in Visual Studio 2008 needs to be equipped with a valid identification |
| 129 | +called a package load key (PLK). This key is generated by Microsoft and includes |
| 130 | +author and package name aswell as the major and minor version of the package. It |
| 131 | +is used to authenticate the package to Visual Studio. |
| 132 | +Unfortunately the PLK generation service is no longer available as it is no more necessary |
| 133 | +to have a PLK for Visual Studio 2010 or 2012 extensions. Unless I choose to be inconsistent |
| 134 | +with the registered version and the displayed version, Visual D is stuck at version 0.3. |
| 135 | +) |
| 136 | + |
| 137 | +Macros: |
| 138 | + TITLE=Version 0.3.36 |
| 139 | + |
| 140 | + |
0 commit comments