workspaced.com.dcd

  • Declaration

    void start(string dir, string clientPath = "dcd-client", string serverPath = "dcd-server", ushort port = 9166, bool autoStart = true);

    Load function for dcd. Call with {"cmd": "load", "components": ["dcd"]} This will start dcd-server and load all import paths specified by previously loaded modules such as dub if autoStart is true. 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(AsyncCallback cb);

    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(AsyncCallback cb);

    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 using dcd-client --query

    Call With: {"subcmd": "status"}

  • Declaration

    auto searchSymbol(AsyncCallback cb, string query);

    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(AsyncCallback cb, ushort port = 9166);

    Searches for an open port to spawn dcd-server in asynchronously starting with port, always increasing by one.

    Return Value

    null if not available, otherwise the port as number

    Call With: {"subcmd": "find-and-select-port"}

  • Declaration

    void findDeclaration(AsyncCallback cb, string code, int pos);

    Finds the declaration of the symbol at position pos in the code

    Return Value

    [0: file: string, 1: position: int]

    Call With: {"subcmd": "find-declaration"}

  • Declaration

    void getDocumentation(AsyncCallback cb, string code, int pos);

    Finds the documentation of the symbol at position pos in the 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(AsyncCallback cb, string code, int pos);

    Queries for code completion at position pos in 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

    struct DCDIdentifier;

    Type of the identifiers value in listCompletion

    • Declaration

      string identifier;

    • Declaration

      string type;

  • Declaration

    struct DCDSearchResult;

    Returned by search-symbol

    • Declaration

      string file;

    • Declaration

      int position;

    • Declaration

      string type;