Skip to content

Commit

Permalink
Added listImports, bump version to 0.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
WebFreak001 committed Jan 29, 2016
1 parent bbd4f73 commit d35b4df
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "code-d",
"description": "auto-complete, snippets, linter and formatter for dlang",
"version": "0.7.0",
"version": "0.8.0",
"publisher": "webfreak",
"repository": {
"type": "git",
Expand Down
10 changes: 8 additions & 2 deletions src/workspace-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ export class WorkspaceD extends EventEmitter implements
setConfiguration(config: string) {
this.request({ cmd: "dub", subcmd: "set:configuration", configuration: config }).then((success) => {
if (success) {
this.request({ cmd: "dub", subcmd: "list:import" }).then(console.log);
this.listImports().then(console.log);
this.emit("configuration-change", config);
}
else
Expand Down Expand Up @@ -377,7 +377,7 @@ export class WorkspaceD extends EventEmitter implements
if (this.dcdReady) {
this.request({ cmd: "dcd", subcmd: "refresh-imports" }).then(() => {
resolve(true);
this.request({ cmd: "dub", subcmd: "list:import" }).then(console.log);
this.listImports().then(console.log);
});
} else {
vscode.window.showWarningMessage("Could not update DCD. Please restart DCD if its not working properly");
Expand All @@ -387,6 +387,12 @@ export class WorkspaceD extends EventEmitter implements
});
}

listImports(): Thenable<string[]> {
if (!this.dubReady)
return new Promise((resolve, reject) => { resolve([]); });
return this.request({ cmd: "dub", subcmd: "list:import" });
}

getDlangUI(): DlangUIHandler {
return new DlangUIHandler(this);
}
Expand Down

0 comments on commit d35b4df

Please sign in to comment.