This is the Power Platform VS Code extension that provides tooling for creating, building, and deploying Power Platform solutions, packages, and portals. It integrates the Power Platform CLI (pac) directly into VS Code.
- Client (
src/client/): Main VS Code extension logic, UI components, and Power Pages tooling - Server (
src/server/): Language servers for HTML/Liquid and YAML files - Debugger (
src/debugger/): PCF debugging capabilities for Power Platform components - Web (
src/web/): VS Code for Web support - Common (
src/common/): Shared utilities, telemetry, and services
- PAC CLI Integration: The extension automatically downloads and manages the Power Platform CLI (
src/client/lib/CliAcquisition.ts,src/client/pac/PacWrapper.ts) - Multi-Target Build: Uses webpack to build for desktop VS Code, web, and language servers (
webpack.config.js) - Telemetry-First: Comprehensive telemetry using OneDSLogger for both desktop and web (
src/common/OneDSLoggerTelemetry/) - Service Architecture: Core services in
src/common/services/(ArtemisService, BAPService, PPAPIService)
npm run buildorgulp: Full build (uses gulpfile.mjs)npm run compile-web: Build web version onlynpm run test-desktop-int: Run desktop integration testsnpm run test-web-integration: Run web integration tests
src/client/extension.ts: Main extension entry pointpackage.json: Extension manifest with commands and contributionssrc/client/lib/PacActivityBarUI.ts: Activity bar panels and UI registrationsrc/client/PortalWebView.ts: Power Pages portal webview managementsrc/client/pac/PacWrapper.ts: Wrapper for Power Platform CLI commandssrc/client/power-pages/actions-hub/ActionsHubTreeDataProvider.ts: Power Pages Actions Hub tree data provider
// Always use PacWrapper for CLI operations
const pacWrapper = new PacWrapper(context);
await pacWrapper.executeCommand(['solution', 'list']);- Use 4 spaces for indentation (no tabs)
- Arrow functions
=>over anonymous functions - Curly braces on same line, always use braces for loops/conditionals
- No whitespace in parenthesized constructs:
for (let i = 0; i < 10; i++)
- PascalCase:
typenames,enumvalues - camelCase:
function/methodnames,propertynames,local variables - UPPER_CASE: constants
- Use whole words when possible
- "double quotes" for user-facing strings that need localization
- 'single quotes' for internal strings
- All user-visible strings MUST be externalized using
vscode-nls
- Use JSDoc style comments for functions, interfaces, enums, and classes
- Include parameter descriptions and return types
- Use async/await for asynchronous code
- When modifying any localization strings, run
npm run translations-exportto ensure updates are captured.
- Mocha test framework with
describeanditblocks - Chai
expectassertions (not assert) - Sinon for stubs and spies
- Mock dependencies extensively for unit tests
- Unit tests:
src/*/test/unit/ - Integration tests:
src/*/test/integration/ - No
//Arrange,//Act,//Assertcomments
npm run test # Unit tests
npm run test-desktop-int # Desktop integration tests
npm run test-web-integration # Web integration tests- Portal files use specific extensions:
.copy.html,.custom_javascript.js(seesrc/common/constants.ts) - File system callbacks in
src/client/power-pages/fileSystemCallbacks.ts - Bootstrap diff functionality for portal template updates
- CLI versions managed in
src/client/lib/CliAcquisition.ts - Global storage for CLI binaries in VS Code's global storage path
- Cross-platform support (Windows
.exe, Unix executables)
- Use
oneDSLoggerWrapperfor all telemetry events - Events defined in
src/common/OneDSLoggerTelemetry/telemetryConstants.ts - Separate telemetry for desktop vs web experiences