Skip to content

Commit

Permalink
[#17] Allow webview to interpret command URIs
Browse files Browse the repository at this point in the history
  • Loading branch information
ryu1kn committed Apr 25, 2019
1 parent ea79f28 commit efd5602
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 2 additions & 3 deletions lib/command/annotate.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ class AnnotateCommand {
if (!uri) return;

const title = this._editorTitleResolver.resolve(uri);
const panel = this._vscode.window.createWebviewPanel(
'annotator-annotation', title, this._vscode.ViewColumn.Active, {enableScripts: true}
);
const panel = this._vscode.window.createWebviewPanel('annotator-annotation',
title, this._vscode.ViewColumn.Active, {enableScripts: true, enableCommandUris: true});
return this._contentProvider.provideTextDocumentContent(uri).then(content => {
panel.webview.html = content;
panel.onDidDispose(() => {}, null, {});
Expand Down
4 changes: 3 additions & 1 deletion test/lib/command/annotate.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ suite('#AnnotateCommand', () => {
};
return command.execute(editor).then(() => {
expect(uriService.convertToAnnotateFileAction).to.have.been.calledWith('URI');
expect(vscode.window.createWebviewPanel).to.have.been.calledWith('annotator-annotation', 'ANNOTATION_TITLE', 'active', {enableScripts: true});
expect(vscode.window.createWebviewPanel).to.have.been.calledWith(
'annotator-annotation', 'ANNOTATION_TITLE', 'active', {enableScripts: true, enableCommandUris: true}
);
});
});

Expand Down

0 comments on commit efd5602

Please sign in to comment.