diff --git a/package.json b/package.json index 128dcaec..6b96ce43 100644 --- a/package.json +++ b/package.json @@ -58,16 +58,6 @@ "onLanguage:html" ], "contributes": { - "configuration": { - "title": "powerplatform-vscode", - "properties": { - "powerplatform-vscode.enablePortalFeatures": { - "type": "boolean", - "default": false, - "description": "Enable Portal features in VSCode Extension" - } - } - }, "commands": [ { "command": "pacCLI.openDocumentation", diff --git a/src/client/extension.ts b/src/client/extension.ts index 636572eb..7c3d9e16 100644 --- a/src/client/extension.ts +++ b/src/client/extension.ts @@ -25,70 +25,65 @@ export async function activate( _context = context; - const isPaportalFeatureEnabled = vscode.workspace - .getConfiguration("powerplatform-vscode") - .get("enablePortalFeatures"); - if (isPaportalFeatureEnabled) { - // add portal specific features in this block - - vscode.workspace.onDidOpenTextDocument(didOpenTextDocument); - vscode.workspace.textDocuments.forEach(didOpenTextDocument); - - // portal web view panel - _context.subscriptions.push( - vscode.commands.registerCommand( - "microsoft-powerapps-portals.preview-show", - () => { - PortalWebView.createOrShow(_context); - } - ) - ); - - _context.subscriptions.push( - vscode.workspace.onDidOpenTextDocument(() => { - if (vscode.window.activeTextEditor === undefined) { - return; - } else if ( - vscode.workspace.workspaceFolders !== undefined && - PortalWebView.currentPanel && - PortalWebView.currentDocument !== - vscode.window.activeTextEditor.document.fileName && - PortalWebView.checkDocumentIsHTML() - ) { - PortalWebView.currentPanel._update(); - } - }) - ); - _context.subscriptions.push( - vscode.workspace.onDidChangeTextDocument(() => { - if (vscode.window.activeTextEditor === undefined) { - return; - } else if ( - vscode.workspace.workspaceFolders !== undefined && - PortalWebView.currentPanel && - PortalWebView.currentDocument === - vscode.window.activeTextEditor.document.fileName + // add portal specific features in this block + + vscode.workspace.onDidOpenTextDocument(didOpenTextDocument); + vscode.workspace.textDocuments.forEach(didOpenTextDocument); + + // portal web view panel + _context.subscriptions.push( + vscode.commands.registerCommand( + "microsoft-powerapps-portals.preview-show", + () => { + PortalWebView.createOrShow(_context); + } + ) + ); + + _context.subscriptions.push( + vscode.workspace.onDidOpenTextDocument(() => { + if (vscode.window.activeTextEditor === undefined) { + return; + } else if ( + vscode.workspace.workspaceFolders !== undefined && + PortalWebView.currentPanel && + PortalWebView.currentDocument !== + vscode.window.activeTextEditor.document.fileName && + PortalWebView.checkDocumentIsHTML() + ) { + PortalWebView.currentPanel._update(); + } + }) + ); + _context.subscriptions.push( + vscode.workspace.onDidChangeTextDocument(() => { + if (vscode.window.activeTextEditor === undefined) { + return; + } else if ( + vscode.workspace.workspaceFolders !== undefined && + PortalWebView.currentPanel && + PortalWebView.currentDocument === + vscode.window.activeTextEditor.document.fileName + ) { + PortalWebView.currentPanel._update(); + } + }) + ); + + if (vscode.window.registerWebviewPanelSerializer) { + vscode.window.registerWebviewPanelSerializer( + PortalWebView.viewType, + { + async deserializeWebviewPanel( + webviewPanel: vscode.WebviewPanel ) { - PortalWebView.currentPanel._update(); - } - }) + PortalWebView.revive( + webviewPanel, + _context.extensionUri + ); + }, + } ); - - if (vscode.window.registerWebviewPanelSerializer) { - vscode.window.registerWebviewPanelSerializer( - PortalWebView.viewType, - { - async deserializeWebviewPanel( - webviewPanel: vscode.WebviewPanel - ) { - PortalWebView.revive( - webviewPanel, - _context.extensionUri - ); - }, - } - ); - } } const cli = new CliAcquisition(new CliAcquisitionContext(_context));