workspaced.com.dcd
-
Declaration
void
start
(stringdir
, stringclientPath
= "dcd-client", stringserverPath
= "dcd-server", ushortport
= 9166, boolautoStart
= true);Load function for dcd. Call with
{"cmd": "load", "components": ["dcd"]}
This willstart
dcd-server and load all import paths specified by previously loaded modules such as dub ifautoStart
istrue
. It also checks for the version. All dcd methods are used with"cmd": "dcd"
Note: This will block any incoming requests while loading.
-
Declaration
bool
isOutdated
(); -
Declaration
void
stop
();This stops the dcd-server instance safely and waits for it to exit
-
Declaration
void
setupServer
(string[]additionalImports
= []);This will start the dcd-server and load import paths from the current provider
Call With:
{"subcmd": "setup-server"}
-
Declaration
void
startServer
(string[]additionalImports
= []);This will start the dcd-server
Call With:
{"subcmd": "start-server"}
-
Declaration
void
stopServer
(AsyncCallbackcb
);This stops the dcd-server asynchronously
Return Value
null
Call With:
{"subcmd": "stop-server"}
-
Declaration
void
killServer
();This will kill the process associated with the dcd-server instance
Call With:
{"subcmd": "kill-server"}
-
Declaration
void
restartServer
(AsyncCallbackcb
);This will stop the dcd-server safely and restart it again using setup-server asynchronously
Return Value
null
Call With:
{"subcmd": "restart-server"}
-
Declaration
@property auto
serverStatus
();This will query the current dcd-server status
Return Value
{isRunning: bool}
If the dcd-server process is not running anymore it will return isRunning:false
. Otherwise it will check for server status usingdcd-client --query
Call With:
{"subcmd": "status"}
-
Declaration
auto
searchSymbol
(AsyncCallbackcb
, stringquery
);Searches for a symbol across all files using
dcd-client --search
Return Value
[{file: string, position: int, type: string}]
Call With:
{"subcmd": "search-symbol"}
-
Declaration
void
refreshImports
();Reloads import paths from the current provider. Call reload there before calling it here.
Call With:
{"subcmd": "refresh-imports"}
-
Declaration
void
addImports
(string[]imports
);Manually adds import paths as string array
Call With:
{"subcmd": "add-
imports
"} -
Declaration
void
findAndSelectPort
(AsyncCallbackcb
, ushortport
= 9166);Searches for an open
port
to spawn dcd-server in asynchronously starting with
, always increasing by one.port
Return Value
null
if not available, otherwise theport
as numberCall With:
{"subcmd": "find-and-select-
port
"} -
Declaration
void
findDeclaration
(AsyncCallbackcb
, stringcode
, intpos
);Finds the declaration of the symbol at position
in thepos
code
Return Value
[0: file: string, 1: position: int]
Call With:
{"subcmd": "find-declaration"}
-
Declaration
void
getDocumentation
(AsyncCallbackcb
, stringcode
, intpos
);Finds the documentation of the symbol at position
in thepos
code
Return Value
[string]
Call With:
{"subcmd": "get-documentation"}
-
Declaration
string
getSocketFile
();Returns the used socket file. Only available on OSX, linux and BSD with DCD >= 0.8.0 Throws an error if not available.
-
Declaration
ushort
getRunningPort
();Returns the used running port. Throws an error if using unix sockets instead
-
Declaration
void
listCompletion
(AsyncCallbackcb
, stringcode
, intpos
);Queries for
code
completion at position
inpos
code
Return Value
{type:string}
where type is either identifiers, calltips or raw. When identifiers:{type:"identifiers", identifiers:[{identifier:string, type:string}]}
When calltips:{type:"calltips", calltips:[string]}
When raw:{type:"raw", raw:[string]}
Raw is anything else than identifiers and calltips which might not be implemented by this point.Call With:
{"subcmd": "list-completion"}
-
Declaration
struct
DCDServerStatus
;Returned by status
-
Declaration
bool
isRunning
;
-
-
Declaration
struct
DCDIdentifier
;Type of the identifiers value in listCompletion
-
Declaration
string
identifier
; -
Declaration
string
type
;
-
-
Declaration
struct
DCDSearchResult
;