Join the Chat | Donate |
---|---|
Discord chat |
Donate for faster
|
There is a new symbol index that will automatically be built on project launch. With this index the following features are introduced:
- Find references (only in its most basic form)
- auto-import completions (type a symbol name and it automatically gets imported on auto-complete submit)
Auto completion now has better sorting and more information.
UFCS is now supported for regular types and trivial templates.
There is support for basic clang compilation database (compile_commands.json) now. Since this is basically a makefile with shell commands and no standardized way of specifying the files, your mileage may vary on this.
CCDB is used in favor of DUB if it can be parsed successfully.
Proper folding support was introduced, it's no longer white-space based, but instead uses statements and can fold import blocks as well.
You can now sort all imports in the entire file. This will also get rid of duplicate imports.
Identifiers/variables can be renamed within a single file now. Putting the text cursor on a variable highlights its uses. Some control flow things such as if/else, switch/case, return, etc. also highlight.
You now get light-bulbs to auto-fix many more issue types, including a bunch of D-Scanner issues.
Diagnostic location, length and information has improved a lot.
Hovers are no longer 1-off at start of the identifier. They include a basic definition of the symbol now.
Improved support for:
- code blocks (fixed)
- tables (new)
- colors (new)
Auto completion ergonomics were improved a little.
You can now auto-format SDL files.
Fixed some spec links. New snippets:
trymain
switch
final switch
if
if auto
while
while auto
for
scope guard
return
throw
goto
with
try
tryf
- try-catch-finally snippets (smart)
default
(smart, in switch)- snippets for vibe.d and mir-ion
The bundled DUB version in serve-d is now at 1.36.0
Auto completion of dub.json has been improved and the issues with quoting have been fixed.
Auto completion of DUB dependencies in dub.json/dub.sdl now show license and copyright information.
The DUB Dependencies view got a few improvements:
- Action taken when clicking on dependencies now is configurable (see
d.dependencyClickBehavior
setting) - by default clicking on a dependency now lists all the README/CHANGES/LICENSE files (configurable with
d.dependencyTextDocumentFilter
setting) - added preview of .rst files if either (preferred) reStructuredText (lextudio.restructuredtext) or RST Preview (tht13.rst-vscode) is installed.
- other added options:
- open DUB recipe (dub.json/dub.sdl)
- do nothing
- open file (dialog) in dependency path
- icons are fixed
The new dependency click actions can also be accessed by right-clicking a dependency.
Linting D code through DUB builds has had many bugs resolved and should work a lot more reliably now, as well as not generating any binaries anymore.
Startup DUB issues have improved error messages and error recovery now.
Serve-D will now ask to upgrade the project and auto-download missing dependencies then when dependencies are missing.
Installation/update of serve-d with multiple vscode windows now works properly.
In this serve-d release we moved away from painlessjson to mir-ion as serialization library. Correctness for LSP implementation has greatly increased.
Support for OpenSSL 3 was introduced.
Fixed various bugs and crashes.
Fixed FreeBSD and OSX M1 support. (serve-d)
The settings view has been overhauled, including a lot of new settings. Manual JSON settings also aren't as likely to cause crashes anymore.
The document outline has been improved.
You will no longer be spammed with project loading notifications at startup.
Various performance improvements.
Adds linting support for dub.json/dub.sdl schema for dependency git commits:
"dependencies": {
"dmd": {
"repository": "git+https://github.com/dlang/dmd.git",
"version": "c60fe8e075fb01c4fa510953c13d6e1e10f79671"
}
}
dependency "dmd" repository="git+https://github.com/dlang/dmd.git" version="c60fe8e075fb01c4fa510953c13d6e1e10f79671"
Fixes CI generated .vsix files (and released extensions with that) not including debug plugins, possibly causing task debugging issues.
Prefers "d.dubCompiler"
now as used compiler when compiling serve-d from source as part of the installer. If you never want to download precompiled releases and always build from source you can set the developer setting "d.forceCompileServeD"
to true in your user settings (JSON) and ignore it being not found / being not documented.
Adds debug settings "d.forceUpdateServeD"
and "d.forceCompileServeD"
.
whew, has it really been 2 years already? Sorry for the delay, here is the update! (finally)
I have often taken breaks while developing code-d/serve-d/workspace-d, so there will probably definitely be bugs and inconsistencies with features that were started but not properly finished. Be sure to report issues you find to https://github.com/Pure-D/code-d/issues!
There is a new getting started guide inside the default VSCode Getting Started page (available when you don't have anything open or through Help -> Get Started)
With it comes a new compiler configuration prompt which helps you installing a compiler.
Make sure you check out the getting started page if you haven't really used this extension before!
The installer downloads and runs Windows setup executables or the official install.sh script on all other platforms. You can use it any time to install new updated DMD/LDC compilers locally just for code-d.
code-d can now be used without open workspace to edit singular D files.
code-d now ships with a debug launch type, which is a wrapper for various debugging extensions. Currently supported debugging extensions are:
- Native Debug (webfreak.code-debug)
- C/C++ (ms-vscode.cpptools)
- CodeLLDB (vadimcn.vscode-lldb)
Through this it is possible to create a single platform-independent, extension-independent debug configuration, which can be used and shared in most projects without changes.
Refer to the new Debugging section in the user guide to see how to use this new feature.
Tasks implementation has been improved and the documentation has been overhauled. The documentation now better shows that Ctrl-Shift-B
is for configured tasks only and not to list all available DUB tasks. _generated
has been removed.
Building projects in subdirectories have been fixed.
Several improvements to warning/error diagnostics have been made. While editing syntax errors are now properly marked as error instead of as warning and have better locations.
Improved examples:
void foo() {
writeln("hello")
}
will now show the missing semicolon error at the end of the line.
if (myObject == null) {}
will now mark the ==
as error for the "use is
instead of ==
when comparing with null
" error message. There is also now a quick fix available to automatically fix this issue quickly.
foreach (auto key; value) {}
while looking nice is not valid D code. The syntax error will now properly explain that the auto
is wrong and suggest removing it with a quick fix.
Among several other improvements of error locations, without any new quick fixes. The experience for newcomers has especially been improved by this.
Auto-completion now shows more information and is better sorted thanks to @RUSshy (Pure-D/serve-d#155)
It's recommended to enable d.argumentSnippets
to have the arguments inserted into code easily and the overloads being shown in the auto completion list.
The d.completeNoDupes
setting has been removed as it is fully implemented by d.argumentSnippets
now.
The following D-Scanner warnings have been disabled by default:
- Public declaration '...' is undocumented
- Variable ... is never modified and could have been declared const or immutable.
For big projects these fields are still recommended and this only applies to projects without any dscanner.ini.
To revert to the old behavior, edit or create a file called dscanner.ini
in your project root and run the "Insert default dscanner.ini content" command (Ctrl-Shift-P) to be able to enable/disable all fields.
The "Insert default dscanner.ini content" command now dumps the currently used settings for code linting instead of a static file. This is useful to start off with the current settings instead of overriding to some different values.
You can now format just the current selection of code. Thanks to @ryuukk for implementing this. (Pure-D/serve-d#120)
Additionally dfmt (the included formatter tool) was upgraded from 0.11.0 (last serve-d stable) to 0.14.0, introducing a lot of fixes and improvements.
This introduced 2 new settings, which have been turned on by default, possibly changing how existing code is formatted:
dfmt.keepLineBreaks
- on by default, turn off to revert to old behaviordfmt.singleIndent
- on by default, turn off to revert to old behavior
The keep line breaks setting will keep line breaks in code and inside function arguments, instead of replacing them, making the formatter work much more like other formatters inside the VSCode ecosystem.
The single indent setting will make subsequent indentation of arguments be extended by a single tab instead of by two.
A regression that auto completion was missing formatting has been fixed.
Additionally now a lot of phobos functions look a lot better and references $(LREF localSymbol)
and $(REF symbol, std,package)
properly display now. Also all unknown macros are now visible.
Example of full writeln
ddoc detail now:
Equivalent to write(args, '\n')
. Calling writeln
without
arguments is valid and just prints a newline to the standard
output.
Params
args
the items to write to stdout
Throws — In case of an I/O error, throws an StdioException
.
Example
Reads stdin
and writes it to stdout
with a argument
counter.
import std.stdio;
void main()
{
string line;
for (size_t count = 0; (line = readln) !is null; count++)
{
writeln("Input ", count, ": ", line);
}
}
The Debugging section in the User Guide has been updated to include the selection and installation of a debugger used for D.
You can now use new context variables in when
clauses in vscode settings like keyboard shortcuts. Added are:
d.isActive
which is true once code-d has been started (user ran some code-d command, opened a D file, wants to debug, has dub.json/dub.sdl, etc.)
- Many improvements in syntax highlighting
- Updated DCD to 0.13.6
- Windows will download precompiled releases again
- Updated D-Scanner to 0.11.1
- Updated dfmt to 0.14.0
- Enabled the extension in untrusted workspaces - secured user settings that could be used maliciously
"d.stdlibPath": "auto"
now uses thed.dubCompiler
setting first to detect stdlibs with the given compiler- added a highlight provider
- Highlights selected variable in scope
- Highlights which statement
return
,break
,continue
affects
- Tasks can use
$current
to use the currently configured project compiler/buildType/configuration/architecture for DUB tasks instead of using the platform default
Minor Changes:
- the "insert dscanner.ini" command now inserts the exact current D-Scanner config for the document instead of some hardcoded one to simplify changing it.
- Running the predefined tasks will auto focus the console now. If you want to do this to your own tasks as well, set
"presentation": {"focus": true}
- Several dub diagnostics improvements
- Added auto completion for
else
blocks afterif
- Fixed many snippet issues
- Fixed various crashes
- dfmt on/off, profilegc and dlangui features are now part of serve-d instead of code-d (available in other editors as well now)
- auto completion and syntax highlighting is off after the
__EOF__
token now
Platform attributes on supported values in dub.sdl are now autocompleted. This includes all the current platforms, architectures and compilers.
Furthermore dependencies complete better now when completing in the middle of a word.
When creating new dub.json and dub.sdl files, the name and syntax boilerplate will be inserted.
User experience when saving dub.json/dub.sdl files has been improved.
Snippets have been completely overhauled and now complete properly based on code grammar. Additionally some snippets (foreach, foreach_revese) can automatically determine default variables now to iterate over which can help you typing the name of big arrays and lists.
There are also new snippets specific to dub packages. These snippets will only be suggested if the workspace has the required dub dependencies installed. Built-in dependency based snippets are the vibe-d snippets viberouter
, vibeserver
, vibeget
, vibegettext
, vibegetjson
and vibepost
. Additionally there is a new API in code-d for other third party VSCode extensions to provide their own dependency based D snippets.
There is a new user guide including tutorials and information about all the code-d features. Use Ctrl-Shift-P -> Open User Guide
to open. (will open automatically for new users first time)
There is a new startup progress bar in the status bar while serve-d is initializing all projects and dependencies.
You can now right-click on symbols and press Search in dpldocs
to look up documentation for anything online much quicker. You can also bind this to a keyboard shortcut in your keyboard bindings and quickly search wherever the code cursor is.
Syntax highlighting was improved
- otbs style D code was improved a lot. (fixes
if
,while
,for
,foreach
,switch
,final switch
,with
,synchronized
andcatch
blocks with braces on same line) typeof
highlightingasm
block fixes- fixed delegate highlighting without arguments
The custom serve-d commands and initialization have all been documented in the README for custom LSP clients in other editors.
The serve-d installer has been refactored a lot, please report any issues in case of any failures with OS & release information!
Minor Changes:
~~deprecated~~
andunused
variables warnings will now be rendered using the standard vscode formatting- Removed upload code selection feature. Use a dedicated extension for this instead. (for example "Share Code"
rolandgreim.sharecode
) - Sort imports is now bound to
Ctrl-Q Ctrl-S
by default. - The changelog now opens in every new version. Add
"d.showUpdateChangelogs": false
to disable.
Bug Fixes:
- Fixed sorting imports inside functions sometimes replacing commented imports.
- Fixes build tasks on windows with CMD
The d.betaStream
setting is now obsolete and got replaced by d.servedReleaseChannel
.
d.servedReleaseChannel
offers 4 different modes:
stable
: this behaves like previously havingd.betaStream
set to false but additionally now will always fetch newer releases directly from GitHub without a new code-d being needed to be installed first.beta
: this is a new option which behaves much likestable
, but additionally to the release builds from GitHub also downloads the pre-release versions. These can be considered mostly stable and will be released in more frequent update iterations. Pick this release channel if you want to report extension issues early.nightly
: this option behaves similar tod.betaStream
set to true. However now only pre-compiled versions will be downloaded and additionally these versions are only released past midnight UTC and only if all tests pass. This new option combines the fast iterations of betaStream with more stable releases that will not cause compilation errors.frozen
: this option completely disables the update check on GitHub and only uses the locally installed serve-d. However if serve-d is not installed or broken, code-d will still attempt to download it from the newest stable version.
Diet completion got a lot of bug fixes and will work a lot better with more D code now.
Adding
//-context=app.d
where app.d
is the primary file in which the template is used will result in improved completion. This comment must be the first token of the file (or second line if first is extends) and the context file must have been opened.
For this serve-d will search for a string using the diet template filename (without folder, but with extension) in the code.
Currently this is not enabled by default because it is still completing too many symbols which aren't even accessible. To enable it anyway, set "d.dietContextCompletion": true
in your user settings.
Implement interface got even more stable and now uses snippets to quickly navigate between implemented methods. It also now puts all methods at the bottom of a class instead of at the top. For default implementations sometimes you can also pick between multiple implementations.
Dub errors now report and disappear much more consistently and have had extreme performance improvements. Template instances will be reported both in calling parts in your projects and where the error actually instantiated first. All error messages will now properly show the following error messages as location markers when hovering over the root cause and suggest only jumping there instead of marking them as invalid.
Saving a file with dub linting enabled will also no longer run the pre/post build commands and only update errors in the current dub project. To show errors in other projects save files in other projects.
You can now use new context variables in when
clauses in vscode settings like keyboard shortcuts. Added are:
d.hasDubProject
which is true if there is a project with dub enabled (when the dub outline is visible)
DCD upgrade to 0.11.1
Minor Changes:
- DCD now downloads with a rich download UI in newer code-d and with console progress bar in older code-d or other editors
- Import paths are now much better resolved if dmd is installed. They will use a very accurate search on Posix platforms using dmd.conf and on windows relative to the exe path. Also per-project overrides using dmd.conf are possible with this.
- Added
d.lintOnFileOpen
with possible values"always", "project", "never"
which controls whether files should be linted with DScanner when opening. (defaults to "project") To revert this to always lint every file, including phobos and other libraries, change it to"always"
- Files external to the project no longer persist linting warnings when closing anymore.
- Added
$dmd
problem matcher to build tasks.
Bug Fixes:
- Build tasks now finally work properly
- The statusbar now only loads once dub is ready.
- Some memory optimizations and segfault fixes.
- Dub build task doesn't break anymore for not loaded workspaces.
- Some threading issues fixed which previously caused random crashes.
- Unreadable directories don't crash serve-d startup anymore.
- Fixed several "Sort imports" bugs.
- Module name insertion properly takes the longest import path now for determining the module name, so it will always insert the shortest module name for your imports.
- When uninstalling code-d an uninstall script deleting the code-d folder should run now.
- Code actions now properly show on all characters on diagnostics instead of just the first character.
- DML autocompletes again
- Installation will no longer silently halt if dependencies aren't installed
- Serve-D installation will now fall back to x86 if x86_mscoff isn't available (fixes installation if only LDC is available)
- Fixed DCD stdout error message box on Windows on shutdown
- Sorting imports now supports
public import
andstatic import
and will also sort those before the other imports. - Fixed code coverage highlighting on Windows
When compiling serve-d from source, don't inline (fixes fatal OSX bug)
Upgrade serve-d to 0.4.1, fix installation of serve-d and DCD deleting itself.
You can now just fix your syntax mistakes and save the file again (or maybe twice for good measure) and it will magically just start working again!
Dependency issues also no longer cause issues as they are now loaded and upgraded in-memory if there are any missing, keeping your working directory clean while making sure that everything is working.
Don't open your browser to browse phobos and other project documentation anymore.
You can now browse through the online documentation of Phobos and all your dub dependencies using the new embedded documentation browser powered by dpldocs.info.
Just open up your command palette and search for Search dpldocs for Phobos & Dependency documentation
or press Ctrl-Q Ctrl-Q
by default. You can also map this to a keyboard shortcut to make this even easier to access.
This is a really useful command, try it out!
vibe.d Diet templates have gotten a lot of love.
New features include:
- Auto-Completion + Calltips of D code inside diet + HTML Tag & Attribute Name & Value completions
- Proper language config (autoclosing quotes)
If you were often frustrated with how random the old syntax highlighting was, it has now been made a lot more consistent and less buggy in general.
Check out a comparision on https://twitter.com/WebFreak001/status/1079446928256053249
The implement interface code action will no longer insert duplicate code and a lot more tests have been added to ensure correctness.
If you do OOP, try it out by simply extending an interface or abstract class and going on the inherited symbol with your cursor.
If you have d.argumentSnippets
enabled, you will now have a much cleaner experience. Types and default values are no longer passed inside the snippets, so only variable names are put in inside the function arguments.
This makes it much easier to especially write OOP code or code where your variables are often called the same thing as the arguments.
Additionally autocompletion no longer shows duplicates of the same symbols. The documentation and definition of all symbols with same name, kind are merged into one for the autocompletion.
You can revert this back to a slightly modified version using "d.completeNoDupes": false
, symbols with same name, kind and definition are always merged now however.
You can now convert dub package recipes between JSON/SDL using a click on the convert button in the toolbar or by running the "Convert between dub.json/dub.sdl" command while having the recipe open. You can still undo after conversion if it missed something or you noticed you had comments it removed.
The server now tries to restart more. It now only doesn't restart after 20 restart fails in one minute instead of 5 fails in 3 minutes.
Implemented proper outline view and with that also breadcrumbs. See #201
Fixed an SDL parsing issue with comments not consuming line endings. Comments won't affect parsing of the next line anymore.
When opening a file, it will get linted by D-Scanner immediately.
serve-d upgrade to 0.4.0
DCD upgrade to 0.10.1
Coverage and GC decorations (red/green background tint and allocation code lenses) can now be toggled with the new d.enableCoverageDecoration
and d.enableGCProfilerDecorations
settings respectively. Coverage will always still show in the statusbar.
Status bar items will now only be shown when a D file is opened. You can revert this to the old behaviour by setting d.alwaysShowDubStatusButtons
to true
in your user or workspace settings to bring back dub buttons and you can enable d.alwaysShowCoverageStatus
to do the same to the coverage status indicator.
The installation of DCD is fixed and reloading after installation is no longer required.
Minor stuff:
- removed long gone dscannerPath and dfmtPath from the settings (as they are integrated into serve-d and have been ignored ever since)
- Workspace symbol search now shows all symbols starting with the search query.
- DScanner issues can now be disabled per workspace and per line of code (using
@suppress(all)
,@suppress(dscanner.xxx)
or@supress(xxx)
in the same line as the issue, a code fix helps removing it) - Build tasks replace the old compile buttons in the status bar (Ctrl-Shift-B)
serve-d upgrade to 0.3.0
Fixed fsworkspace provider and d.extraRoots
not working. (serve-d update to 0.2.1)
This release finally includes multi workspace support. You can manually add instances using the new d.extraRoots
setting and prevent automatic instance detection partially using d.disabledRootGlobs
or disable it fully using "d.scanAllFolders": false
to get back to the old behaviour (but still with working multi-root workspaces).
Some bugs may occur and some old ones may have been fixed during this transition. Please report issues to the code-d github repository.
Project dependent settings such as the status bar buttons or the dub dependencies are linked to the project containing the file you are currently editing.
Minor things:
- Dependency upgrades (dub to 1.10.0, dfmt to 0.8.2, dscanner to 0.5.7)
- Settings are now properly categorized for multi-workspace projects and some settings can be set in all cases and some only in user settings.
- DCD is now fetched from the official github releases (0.9.9)
- dub.json completion now properly inserts quotes
- some dub startup errors were fixed
- import timing takes into account possible second-run optimizations.
- some requests in code-d were previously decoded wrong, causing silent ignoring of some configuration and parameters. This has been fixed with a single character.
Fixed a bug where d.betaStream
would have recloned serve-d on every startup if the latest commit has been made on a 10th of any month or later or if the last digit of the current compiled serve-d date was less than the commit date.
Upgrade language client to 4.1.3
DCD Installation fixes, especially on windows.
The switch to serve-d / Microsoft Language Server Protocol!
- Added dub dependencies view in the UI that shows a dependency tree in the currently opened project
- New syntax highlighting using ysgard/d-struct grammar
- automatic module naming: when you rename a file you are currently in or create a new file a module statement will be added/changed
- the English, German and Japanese translations are finally used! Thanks to @SeijiFujita for the Japanese translation
- dfmt and dscanner are now included in serve-d and workspace-d and no longer need to be installed
- Fancy new ddoc renderer when hovering over symbols
- Live DScanner linting: you get errors from dscanner while you type now
- dscanner.ini auto completion of sections, fields & values
- ddoc auto completion: press ctrl-space before a function definition and select the /// or the /** completion option to get a documentation template with arguments and sections
- added sort imports command only sorting the "block" (separated by whitespaces) and not all imports in the file for more user control (but not compatible with the dscanner sortedness linting)
- When autocompleting functions automatically insert the signature as snippet which can be navigated using tab. (configuration d.argumentSnippets)
- Automatically implement classes and interfaces using the new
Implement selected interface/base class
command or by using the code actions - All imports are annotated with a code lens to show how long they need to import. For this just a dmd call using just the import is called multiple times (up to 500ms per import).
- DCD Compilation is fixed (especially on windows)
Minor changes:
- Installing dependencies uses the dubPath setting now for dub
- dub.json auto completion was broken in an vscode update, should work again now
- Added
d.enableStaticLinting
&d.enableFormatting
- Dub installer upgraded to 1.4.0
- Dependent programs are now installed without user confirmation by default
- Use
"d.aggressiveUpdate": false
to disable this behaviour. - On linux files are installed into
~/.local/share/code-d
or as fallback (and also on mac) into~/.code-d
. On Windows files are installed into%APPDATA%/code-d
- Use
- Will now install dub before trying to compile dependencies
- If no D compiler is present the browser will be opened on the D download page
- Dedicated output channel in the output tab for error messages & alike
- Current parameter in calltips is more exact now
- Goto definition got more efficient
- Fix dub.json/dub.sdl snippets on vscode 1.13.0 and above
- Auto-fix broken tool paths when upgrading code-d
- Fixed windows dscanner exe path
- Fixed goto definition in unopened files
- Better default stdlibPath values (platform dependent) + snippets for it
- Import fixer will suggest stdlib & works with UFCS
- Bump to workspace-d 2.10.0
- Primarily makes importer better
- Finds outdated DCD/Dscanner/dfmt now (warnings/update not yet implemented in code-d)
- Fixed installation on macOS
- Installer uses the http.proxy settings now
- Better error checks for invalid executables
- "line is longer than" error now starts at the correct column
- Fixed installer with portable/custom git/vscode installation
- Auto fix for suggested imports from compiler
- Dscanner symbol search fix for missing symbols from compiler
- File paths from any custom error messages generated using pragma(msg) will get checked through string import paths now to fix file names (for example compiling diet template files will have the correct path now)
- Running a dub build for linting when a diet file is saved
- Switched from .editorconfig to vscode user settings for dfmt formatting settings.
- Updating workspace-d when outdated