workspaced.com.dub

  • Declaration

    void startup(string dir, bool registerImportProvider = true, bool registerStringImportProvider = true, bool registerImportFilesProvider = false);

    Load function for dub. Call with {"cmd": "load", "components": ["dub"]} This will start dub and load all import paths. All dub methods are used with "cmd": "dub"

    Note: This will block any incoming requests while loading.

  • Declaration

    void stop();

    Stops dub when called.

  • Declaration

    void update(AsyncCallback callback);

    Reloads the dub.json or dub.sdl file from the cwd

    Return Value

    false if there are no import paths available

    Call With: {"subcmd": "update"}

  • Declaration

    void upgrade();

    Calls dub upgrade

    Call With: {"subcmd": "upgrade"}

  • Declaration

    @property auto dependencies();

    Lists all dependencies. This will go through all dependencies and contain the dependencies of dependencies. You need to create a tree structure from this yourself.

    Return Value

    [{dependencies: [string], ver: string, name: string}]

    Call With: {"subcmd": "list:dep"}

  • Declaration

    @property auto rootDependencies();

    Lists dependencies of the root package. This can be used as a base to create a tree structure.

    Return Value

    [string]

    Call With: {"subcmd": "list:rootdep"}

  • Declaration

    @property string[] imports();

    Lists all import paths

    Call With: {"subcmd": "list:import"}

  • Declaration

    @property string[] stringImports();

    Lists all string import paths

    Call With: {"subcmd": "list:string-import"}

  • Declaration

    @property string[] fileImports();

    Lists all import paths to files

    Call With: {"subcmd": "list:file-import"}

  • Declaration

    @property string[] configurations();

    Lists all configurations defined in the package description

    Call With: {"subcmd": "list:configurations"}

  • Declaration

    @property string[] buildTypes();

    Lists all build types defined in the package description AND the predefined ones from dub ("plain", "debug", "release", "release-debug", "release-nobounds", "unittest", "docs", "ddox", "profile", "profile-gc", "cov", "unittest-cov")

    Call With: {"subcmd": "list:build-types"}

  • Declaration

    @property string configuration();

    Gets the current selected configuration

    Call With: {"subcmd": "get:configuration"}

  • Declaration

    bool setConfiguration(string configuration);

    Selects a new configuration and updates the import paths accordingly

    Return Value

    false if there are no import paths in the new configuration

    Call With: {"subcmd": "set:configuration"}

  • Declaration

    @property string[] archTypes();

    List all possible arch types for current set compiler

    Call With: {"subcmd": "list:arch-types"}

  • Declaration

    @property string archType();

    Returns the current selected arch type

    Call With: {"subcmd": "get:arch-type"}

  • Declaration

    bool setArchType(JSONValue request);

    Selects a new arch type and updates the import paths accordingly

    Return Value

    false if there are no import paths in the new arch type

    Call With: {"subcmd": "set:arch-type"}

  • Declaration

    @property string buildType();

    Returns the current selected build type

    Call With: {"subcmd": "get:build-type"}

  • Declaration

    bool setBuildType(JSONValue request);

    Selects a new build type and updates the import paths accordingly

    Return Value

    false if there are no import paths in the new build type

    Call With: {"subcmd": "set:build-type"}

  • Declaration

    @property string compiler();

    Returns the current selected compiler

    Call With: {"subcmd": "get:compiler"}

  • Declaration

    bool setCompiler(string compiler);

    Selects a new compiler for building

    Return Value

    false if the compiler does not exist

    Call With: {"subcmd": "set:compiler"}

  • Declaration

    @property string name();

    Returns the project name

    Call With: {"subcmd": "get:name"}

  • Declaration

    @property auto path();

    Returns the project path

    Call With: {"subcmd": "get:path"}

  • Declaration

    void build(AsyncCallback cb);

    Asynchroniously builds the project WITHOUT OUTPUT. This is intended for linting code and showing build errors quickly inside the IDE.

    Return Value

    [{line: int, column: int, type: ErrorType, text: string}] where type is an integer

    Call With: {"subcmd": "build"}

  • Declaration

    enum ErrorType: ubyte;

  • Declaration

    struct BuildIssue;

    Returned by build

    • Declaration

      int line;

    • Declaration

      int column;

    • Declaration

      string file;

    • Declaration

      ErrorType type;

    • Declaration

      string text;