diff --git a/.vscodeignore b/.vscodeignore index 559c52bc..0f566a38 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -3,10 +3,11 @@ ** !dist/*.js !dist/*.txt -!snippets/ -!images/ -!syntaxes/ -!webview/ +!snippets/*.json +!images/*.svg +!images/*.png +!syntaxes/*.json +!webview/*.js !CHANGELOG.md !LICENSE !README.md diff --git a/src/commands/documaticPreviewPanel.ts b/src/commands/documaticPreviewPanel.ts index 6db7f6f0..3bee6640 100644 --- a/src/commands/documaticPreviewPanel.ts +++ b/src/commands/documaticPreviewPanel.ts @@ -38,7 +38,7 @@ export class DocumaticPreviewPanel { */ public static currentPanel: DocumaticPreviewPanel | undefined; - public static create(extensionUri: vscode.Uri): void { + public static create(): void { // Get the open document and check that it's an ObjectScript class const openEditor = vscode.window.activeTextEditor; if (openEditor === undefined) { @@ -70,9 +70,6 @@ export class DocumaticPreviewPanel { return; } - // Get the full path to the folder containing our webview files - const webviewFolderUri: vscode.Uri = vscode.Uri.joinPath(extensionUri, "webview"); - // Create the documatic preview webview const panel = vscode.window.createWebviewPanel( this.viewType, @@ -81,20 +78,20 @@ export class DocumaticPreviewPanel { { enableScripts: true, enableCommandUris: true, - localResourceRoots: [webviewFolderUri], + localResourceRoots: [], } ); panel.iconPath = iscIcon; - this.currentPanel = new DocumaticPreviewPanel(panel, webviewFolderUri, openEditor); + this.currentPanel = new DocumaticPreviewPanel(panel, openEditor); } - private constructor(panel: vscode.WebviewPanel, webviewFolderUri: vscode.Uri, editor: vscode.TextEditor) { + private constructor(panel: vscode.WebviewPanel, editor: vscode.TextEditor) { this._panel = panel; this._editor = editor; // Set the webview's initial content - this.setWebviewHtml(webviewFolderUri); + this.setWebviewHtml(); // Register handlers this.registerEventHandlers(); @@ -114,7 +111,7 @@ export class DocumaticPreviewPanel { /** * Set the static html for the webview. */ - private setWebviewHtml(webviewFolderUri: vscode.Uri) { + private setWebviewHtml() { // Set the webview's html this._panel.webview.html = ` @@ -122,12 +119,20 @@ export class DocumaticPreviewPanel { - + -

+