workspaced.com.dcd
-
Declaration
voidstart(stringdir, stringclientPath= "dcd-client", stringserverPath= "dcd-server", ushortport= 9166, boolautoStart= true);Load function for dcd. Call with
{"cmd": "load", "components": ["dcd"]}This willstartdcd-server and load all import paths specified by previously loaded modules such as dub ifautoStartistrue. It also checks for the version. All dcd methods are used with"cmd": "dcd"Note: This will block any incoming requests while loading.
-
Declaration
boolisOutdated(); -
Declaration
voidstop();This stops the dcd-server instance safely and waits for it to exit
-
Declaration
voidsetupServer(string[]additionalImports= []);This will start the dcd-server and load import paths from the current provider
Call With:
{"subcmd": "setup-server"} -
Declaration
voidstartServer(string[]additionalImports= []);This will start the dcd-server
Call With:
{"subcmd": "start-server"} -
Declaration
voidstopServer(AsyncCallbackcb);This stops the dcd-server asynchronously
Return Value
nullCall With:
{"subcmd": "stop-server"} -
Declaration
voidkillServer();This will kill the process associated with the dcd-server instance
Call With:
{"subcmd": "kill-server"} -
Declaration
voidrestartServer(AsyncCallbackcb);This will stop the dcd-server safely and restart it again using setup-server asynchronously
Return Value
nullCall With:
{"subcmd": "restart-server"} -
Declaration
@property autoserverStatus();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 --queryCall With:
{"subcmd": "status"} -
Declaration
autosearchSymbol(AsyncCallbackcb, stringquery);Searches for a symbol across all files using
dcd-client --searchReturn Value
[{file: string, position: int, type: string}]Call With:
{"subcmd": "search-symbol"} -
Declaration
voidrefreshImports();Reloads import paths from the current provider. Call reload there before calling it here.
Call With:
{"subcmd": "refresh-imports"} -
Declaration
voidaddImports(string[]imports);Manually adds import paths as string array
Call With:
{"subcmd": "add-imports"} -
Declaration
voidfindAndSelectPort(AsyncCallbackcb, ushortport= 9166);Searches for an open
portto spawn dcd-server in asynchronously starting with, always increasing by one.portReturn Value
nullif not available, otherwise theportas numberCall With:
{"subcmd": "find-and-select-port"} -
Declaration
voidfindDeclaration(AsyncCallbackcb, stringcode, intpos);Finds the declaration of the symbol at position
in theposcodeReturn Value
[0: file: string, 1: position: int]Call With:
{"subcmd": "find-declaration"} -
Declaration
voidgetDocumentation(AsyncCallbackcb, stringcode, intpos);Finds the documentation of the symbol at position
in theposcodeReturn Value
[string]Call With:
{"subcmd": "get-documentation"} -
Declaration
stringgetSocketFile();Returns the used socket file. Only available on OSX, linux and BSD with DCD >= 0.8.0 Throws an error if not available.
-
Declaration
ushortgetRunningPort();Returns the used running port. Throws an error if using unix sockets instead
-
Declaration
voidlistCompletion(AsyncCallbackcb, stringcode, intpos);Queries for
codecompletion at positioninposcodeReturn 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
structDCDServerStatus;Returned by status
-
Declaration
boolisRunning;
-
-
Declaration
structDCDIdentifier;Type of the identifiers value in listCompletion
-
Declaration
stringidentifier; -
Declaration
stringtype;
-
-
Declaration
structDCDSearchResult;