dls 0.1.2
D Language Server
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
D Language Server
This is a work in progress...
DLS implements the server side of the Language Server Protocol (LSP) for the D programming language. It does not contain any language feature itself (yet), but uses existing components and provides an interface to work with the LSP. It currently provides:
Client side configuration
All these keys should be formatted as d.dls.[section].[key]
(e.g. d.dls.formatter.endOfLine
).
Section: general | Type | Default value |
---|---|---|
importPaths | string[] | [] |
Section: formatter | Type | Default value |
---|---|---|
endOfLine | "lf" or "cr" or "crlf" | "lf" |
maxLineLength | number | 120 |
dfmtBraceStyle | "allman" or "otbs" or "stroustrup" | "allman" |
dfmtSoftMaxLineLength | number | 80 |
dfmtAlignSwitchStatements | boolean | true |
dfmtOutdentAttributes | boolean | true |
dfmtSplitOperatorAtLineEnd | boolean | false |
dfmtSpaceAfterCast | boolean | true |
dfmtSpaceAfterKeywords | boolean | true |
dfmtSpaceBeforeFunctionParameters | boolean | false |
dfmtSelectiveImportSpace | boolean | true |
dfmtCompactLabeledStatements | boolean | true |
The find
subpackage and the update system
In order to simplify the process of updating DLS, an update system is implemented.
However, the extension will need to locate a first version of DLS; this is where dls:find
comes in.
The steps are:
dub fetch dls
will fetch the latest version of DLSdub run --quiet dls:find
will output the directory to its parent DLS packagedub build --build=release
launched in the just acquired DLS directory will build DLS (sending notifications before and after the build to the user might be a good idea, as it can take several minutes)- The
dls
executable will now be right under the same directory
IMPORTANT: when building DLS on Windows, --arch=x86_mscoff
must be added to the arguments for the build to succeed.
After this, the Language Client has to listen to telemetry events.
As this Language Server won't be using telemetry, the telemetry/event
server-to-client notification has been re-purposed: the event sent by the server will be the path to the new DLS executable after every update.
Otherwise nothing specific is required on the client's part regarding updates: the server will send notifications to the user when an update is available, and build its next version in parallel to responding to requests.
Caveats
The server may delegate a few operations to the client-side extension depending on the language client's capabilities. The client should watch these files for the server to work properly:
dub.selections.json
dub.json
dub.sdl
If the client supports dynamic registration of the workspace/didChangeWatchedFiles
method, then the server will automatically register file watching.
If the client doesn't support dynamic registration however, the client-side extension will need to manually do it.
The server needs to know at least when dub.selections.json
files change to properly provide completion support.
If dub.json
and dub.sdl
are also watched, dub.selections.json
will automatically be regenerated and then it will be used for completion support.
As support for messages regarding workspace folders are not yet supported in Visual Studio Code (used for testing the server), dls also lacks support for multiple workspace folders for now.
- 0.1.2 released 7 years ago
- d-language-server/dls
- MIT
- Copyright © 2017, Laurent Tréguier
- Authors:
- Dependencies:
- dfmt, dcd, dub
- Versions:
-
0.26.2 2020-Mar-20 0.26.1 2020-Jan-25 0.26.0 2019-Dec-03 0.25.19 2019-Oct-29 0.25.18 2019-Oct-28 - Download Stats:
-
-
1 downloads today
-
9 downloads this week
-
32 downloads this month
-
14238 downloads total
-
- Score:
- 2.7
- Short URL:
- dls.dub.pm