Skip to content
This repository has been archived by the owner on Feb 20, 2024. It is now read-only.

Commit

Permalink
#19 added askEnableCheckProcedureDocumentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Krieg committed Jul 24, 2020
1 parent a9abadc commit 26975b2
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 1 deletion.
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@
"default": true,
"description": "Specifies whether <param> description should be shown on procedure signatures."
},
"bdev-al-xml-doc.askEnableCheckProcedureDocumentation": {
"type": "boolean",
"scope": "resource",
"default": true,
"description": "Specifies whether a confirmation will appear to enable procedure documentation for each workspace."
},
"bdev-al-xml-doc.checkProcedureDocumentation": {
"type": "boolean",
"scope": "resource",
Expand Down
25 changes: 25 additions & 0 deletions src/CheckConfiguration.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { workspace, window } from "vscode";

export class CheckConfiguration {
constructor() {
this.AskEnableCheckProcedureDocumentation();
}

private AskEnableCheckProcedureDocumentation() {
if (workspace.getConfiguration("bdev-al-xml-doc").askEnableCheckProcedureDocumentation) {
if (workspace.getConfiguration("bdev-al-xml-doc").inspect('checkProcedureDocumentation')?.workspaceValue) {
return; // do not ask again
}

window.showInformationMessage('Do you want to enable AL XML Documentation procedure check for this workspace?', ...['Yes', 'No']).then(answer => {
if (answer === undefined) {
return;
}
workspace.getConfiguration("bdev-al-xml-doc").update('checkProcedureDocumentation', (answer === "Yes"));
});
}
}

public dispose() {
}
}
3 changes: 3 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ import { DoComment } from "./DoComment";
import { DoExport } from "./DoExport";
import { DoHover } from "./DoHover";
import { DoCheckDocumentation } from "./DoCheckDocumentation";
import { CheckConfiguration } from "./CheckConfiguration";

export function activate(context: ExtensionContext) {
const checkConfiguration = new CheckConfiguration();
const doComment = new DoComment();
const doExport = new DoExport();
const doHover = new DoHover();
const doCheckDocumentation = new DoCheckDocumentation();

context.subscriptions.push(checkConfiguration);
context.subscriptions.push(doComment);
context.subscriptions.push(doExport);
context.subscriptions.push(doHover);
Expand Down
3 changes: 2 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ export type AlXmlDocConfig = {
enableDocComments: boolean;
enableSummaryHover: boolean;
enableSignatureHover: boolean;
checkProcedureDocumentation: string;
checkProcedureDocumentation: boolean;
askEnableCheckProcedureDocumentation: boolean;
};

export enum CodeType {
Expand Down

0 comments on commit 26975b2

Please sign in to comment.