Skip to content

Commit

Permalink
Fix compile issues with open v6.2.0, fix rebase issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Luis Campos committed Apr 23, 2019
1 parent b3d11dc commit 7d4c686
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 37 deletions.
4 changes: 2 additions & 2 deletions packages/salesforcedx-vscode-lightning/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"aura-language-server": "2.1.0",
"change-case": "^3.1.0",
"lightning-lsp-common": "2.1.0",
"open": "^6.0.0",
"open": "6.0.0",
"vscode-extension-telemetry": "0.0.17",
"vscode-languageclient": "^3.5.1"
},
Expand All @@ -37,7 +37,7 @@
"@types/chai": "^4.0.0",
"@types/mocha": "2.2.38",
"@types/node": "8.9.3",
"@types/open": "^6.0.0",
"@types/open": "6.0.0",
"@types/sinon": "^2.3.2",
"chai": "^4.0.2",
"cross-env": "5.2.0",
Expand Down
37 changes: 2 additions & 35 deletions packages/salesforcedx-vscode-lwc/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
import { shared as lspCommon } from 'lightning-lsp-common';
import * as path from 'path';
import {
commands,
ConfigurationTarget,
Disposable,
ExtensionContext,
Uri,
workspace,
Expand All @@ -23,9 +21,6 @@ import {
TransportKind
} from 'vscode-languageclient';
import { ESLINT_NODEPATH_CONFIG, LWC_EXTENSION_NAME } from './constants';

import { WorkspaceType } from 'lightning-lsp-common/lib/shared';
import { waitForDX } from './dxsupport/waitForDX';
import { telemetryService } from './telemetry';

// See https://github.com/Microsoft/vscode-languageserver-node/issues/105
Expand All @@ -43,26 +38,6 @@ function protocol2CodeConverter(value: string) {
return Uri.parse(value);
}

async function registerCommands(): Promise<Disposable | undefined> {
try {
await waitForDX(true);
const {
forceLightningLwcCreate
} = require('./commands/forceLightningLwcCreate');

// Customer-facing commands
const forceLightningLwcCreateCmd = commands.registerCommand(
'sfdx.force.lightning.lwc.create',
forceLightningLwcCreate
);

return Disposable.from(forceLightningLwcCreateCmd);
} catch (ignore) {
// ignore
return undefined;
}
}

function getActivationMode(): string {
const config = workspace.getConfiguration('salesforcedx-vscode-lightning');
return config.get('activationMode') || 'autodetect'; // default to autodetect
Expand All @@ -86,7 +61,7 @@ export async function activate(context: ExtensionContext) {

// 3) If activationMode is autodetect or always, check workspaceType before startup
const workspaceType = lspCommon.detectWorkspaceType(
workspace.workspaceFolders[0].uri.fsPath
workspace.workspaceFolders[0].uri.fsPath
);

// Check if we have a valid project structure
Expand All @@ -98,6 +73,7 @@ export async function activate(context: ExtensionContext) {
console.log('WorkspaceType detected: ' + workspaceType);
return;
}
// If activationMode === always, ignore workspace type and continue activating

// 4) If we get here, we either passed autodetect validation or activationMode == always
console.log('Lightning Web Components Extension Activated');
Expand All @@ -114,15 +90,6 @@ export async function activate(context: ExtensionContext) {
);
}

// Register commands async
registerCommands()
.then(disposable => {
if (disposable) {
context.subscriptions.push(disposable);
}
})
.catch();

// Notify telemetry that our extension is now active
telemetryService.sendExtensionActivationEvent(extensionHRStart).catch();
}
Expand Down

0 comments on commit 7d4c686

Please sign in to comment.