Skip to content
This repository was archived by the owner on Oct 7, 2025. It is now read-only.

Commit 446a09e

Browse files
committed
chore: use reactive vscode initial
1 parent f567855 commit 446a09e

File tree

6 files changed

+51
-20
lines changed

6 files changed

+51
-20
lines changed

.vscode/launch.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@
6363
],
6464
"outFiles": [
6565
"${workspaceFolder}/dist/**/*.js"
66-
]
66+
],
67+
"env": {
68+
"LFS_USE_REACTIVE_VSCE": "true"
69+
}
6770
}
6871
]
6972
}

.vscodeignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ vsc-extension-quickstart.md
1010
**/*.ts
1111
node_modules
1212
.wdio-vscode-service
13-
**.vsix
13+
**.vsix
14+
media/demo.gif

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
},
4747
"commands": [
4848
{
49-
"command": "lightningflowscanner.viewDefaulFlowRules",
49+
"command": "lightningflowscanner.viewDefaultFlowRules",
5050
"title": "Default Flow Rules"
5151
},
5252
{

src/extension.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,35 @@ import Commands from './commands/handlers';
44
import { CacheProvider } from './providers/cache-provider';
55
import { OutputChannel } from './providers/outputChannel';
66

7+
import {
8+
defineExtension,
9+
useCommand,
10+
useIsDarkTheme,
11+
useLogger,
12+
watchEffect,
13+
} from 'reactive-vscode';
14+
715
export async function activate(context: vscode.ExtensionContext) {
16+
const useVue = process.env.LFS_USE_REACTIVE_VSCE === 'true';
17+
vscode.window.showInformationMessage(`LFS_USE_REACTIVE_VSCE: ${useVue}`);
18+
if (useVue) {
19+
const { activate: vueActivate } = defineExtension(() => {
20+
const logger = useLogger('Lightning Flow Scanner');
21+
logger.info('Extension Activated');
22+
logger.show();
23+
24+
useCommand('lightningflowscanner.viewDefaultFlowRules', () => {
25+
// window.showInformationMessage(message.value);
26+
vscode.window.showInformationMessage('Hello World');
27+
});
28+
29+
const isDark = useIsDarkTheme();
30+
watchEffect(() => {
31+
logger.info('Is Dark Theme:', isDark.value);
32+
});
33+
});
34+
return vueActivate(context);
35+
}
836
OutputChannel.getInstance().logChannel.debug('initialize');
937

1038
CacheProvider.init(context, { results: [], ruleconfig: {} });

src/services/message-service.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,25 @@ export default class MessageService {
1919
}
2020

2121
viewRules(query: any) {
22-
vscode.commands.executeCommand("lightningflowscanner.viewDefaulFlowRules");
22+
vscode.commands.executeCommand('lightningflowscanner.viewDefaulFlowRules');
2323
}
2424

2525
scanFlows(query: any) {
26-
vscode.commands.executeCommand("lightningflowscanner.scanFlows");
26+
vscode.commands.executeCommand('lightningflowscanner.scanFlows');
2727
}
2828

2929
fixFlows(query: any) {
30-
vscode.commands.executeCommand("lightningflowscanner.fixFlows");
30+
vscode.commands.executeCommand('lightningflowscanner.fixFlows');
3131
}
3232

3333
runTests(query: any) {
34-
vscode.commands.executeCommand("lightningflowscanner.calculateFlowTestCoverage");
34+
vscode.commands.executeCommand(
35+
'lightningflowscanner.calculateFlowTestCoverage'
36+
);
3537
}
36-
38+
3739
configRules(query: any) {
38-
vscode.commands.executeCommand("lightningflowscanner.configRules");
40+
vscode.commands.executeCommand('lightningflowscanner.configRules');
3941
}
4042

4143
// Todo implement Cache in Front end components

test/specs/test.e2e.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,30 @@
1-
import { browser, expect } from "@wdio/globals";
1+
import { browser, expect } from '@wdio/globals';
22
import { Workbench } from 'wdio-vscode-service';
33

4-
describe("LFS VSCE Side Bar Smoke Tests", () => {
5-
4+
describe('LFS VSCE Side Bar Smoke Tests', () => {
65
let workbench: Workbench;
76

87
beforeEach(async () => {
98
workbench = await browser.getWorkbench();
109
});
1110

12-
it("Extension is accessible in the Side Bar", async () => {
11+
it('Extension is accessible in the Side Bar', async () => {
1312
// Verify if Lightning Flow Scanner is in the side bar
1413
const viewControls = await workbench.getActivityBar().getViewControls();
1514
expect(
1615
await Promise.all(viewControls.map((vc) => vc.getTitle()))
17-
).toContain("Lightning Flow Scanner");
16+
).toContain('Lightning Flow Scanner');
1817

1918
// Verify if Lightning Flow Scanner can be opened in the side bar
2019
const lfsViewContainer = await workbench
2120
.getActivityBar()
22-
.getViewControl("Lightning Flow Scanner");
21+
.getViewControl('Lightning Flow Scanner');
2322
await lfsViewContainer?.wait();
2423
await lfsViewContainer?.openView();
2524
const selectedView = await workbench
2625
.getActivityBar()
2726
.getSelectedViewAction();
28-
expect(await selectedView.getTitle()).toBe("Lightning Flow Scanner");
27+
expect(await selectedView.getTitle()).toBe('Lightning Flow Scanner');
2928

3029
// // TODO Verify some content of the Lightning Flow Scanner side bar
3130
/*
@@ -38,16 +37,14 @@ describe("LFS VSCE Side Bar Smoke Tests", () => {
3837
*/
3938
});
4039

41-
it("The Get Rules command results in opening the Flow Rules view", async () => {
42-
40+
it('The Get Rules command results in opening the Flow Rules view', async () => {
4341
// Run the View Default Flow Rules via the Command Prompt
4442
const commandInput = await workbench.openCommandPrompt();
45-
await workbench.executeCommand("lightningflowscanner.viewDefaulFlowRules");
43+
await workbench.executeCommand('lightningflowscanner.viewDefaultFlowRules');
4644
const editorView = workbench.getEditorView();
4745
const activeTab = await editorView.getActiveTab();
4846
const title = await activeTab?.getTitle();
4947
console.log('title = ', title);
5048
expect(title).toBe('Flow Rules');
5149
});
52-
5350
});

0 commit comments

Comments
 (0)