import { shared as lspCommon } from '@salesforce/lightning-lsp-common' ; import * as vscode from 'vscode' ; /**
 * Provide capabilities for VS Code regarding LWC workspace types defined in lightning-lsp-common
 */ class WorkspaceService { private currentWorkspaceType : lspCommon . WorkspaceType = lspCommon . WorkspaceType . UNKNOWN ; param context param workspaceType public register ( context , workspaceType ) { this . setCurrentWorkspaceType ( workspaceType ) ; const isInternalDev = this . isCoreWorkspace ( workspaceType ) ; vscode . commands . executeCommand ( 'setContext' , 'sfdx:internal_dev' , isInternalDev ) ; } public getCurrentWorkspaceType ( ) { return this . currentWorkspaceType ; } public setCurrentWorkspaceType ( workspaceType ) { this . currentWorkspaceType = workspaceType ; } public isSFDXWorkspace ( workspaceType ) { return workspaceType === lspCommon . WorkspaceType . SFDX ; } public isCoreWorkspace ( workspaceType ) { return ( workspaceType === lspCommon . WorkspaceType . CORE_ALL || workspaceType === lspCommon . WorkspaceType . CORE_PARTIAL ) ; } returns { String } public getCurrentWorkspaceTypeForTelemetry ( ) { return lspCommon . WorkspaceType [ this . getCurrentWorkspaceType ( ) ] ; } } export const workspaceService = new WorkspaceService ( ) ;