Skip to content

Commit f8c34dd

Browse files
committed
Version 0.2.1: Update vscode-languageclient to 10.0.0-next-19, @vscode/vsce to 3.7.1 and vscode engine compatibility to 1.105+. Add 'restart ER and debug' command. Show project environments in action tree. Put actions in a folder and collapse by default.
1 parent 20b50b7 commit f8c34dd

15 files changed

Lines changed: 289 additions & 245 deletions

esbuild.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ async function client() {
4444
// if not specified, this plugin uses ESBuild.build outdir/outfile options as base path.
4545
resolveFrom: "cwd",
4646
assets: {
47-
from: ["././src/assets/**/*"],
47+
from: ["./src/assets/**/*"],
4848
to: ["./dist/assets/"],
4949
},
5050
watch: true,

package-lock.json

Lines changed: 189 additions & 186 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"displayName": "FineCode",
44
"description": "",
55
"engines": {
6-
"vscode": "^1.90.0"
6+
"vscode": "^1.105.0"
77
},
8-
"version": "0.2.0",
8+
"version": "0.2.1",
99
"preview": true,
1010
"serverInfo": {
1111
"name": "FineCode",
@@ -96,6 +96,14 @@
9696
"dark": "dist/assets/icons/dark/refresh.svg"
9797
}
9898
},
99+
{
100+
"command": "finecode.restartAndDebugExtensionRunner",
101+
"title": "Restart and Debug Extension Runner",
102+
"icon": {
103+
"light": "dist/assets/icons/light/debug.svg",
104+
"dark": "dist/assets/icons/dark/debug.svg"
105+
}
106+
},
99107
{
100108
"command": "finecode.reloadAction",
101109
"title": "Reload action",
@@ -154,7 +162,12 @@
154162
},
155163
{
156164
"command": "finecode.restartExtensionRunner",
157-
"when": "view == fineCodeActions && viewItem == project",
165+
"when": "view == fineCodeActions && viewItem == env",
166+
"group": "inline"
167+
},
168+
{
169+
"command": "finecode.restartAndDebugExtensionRunner",
170+
"when": "view == fineCodeActions && viewItem == env",
158171
"group": "inline"
159172
}
160173
],
@@ -195,19 +208,19 @@
195208
"devDependencies": {
196209
"@types/mocha": "^10.0.10",
197210
"@types/node": "^22.15.18",
198-
"@types/vscode": "^1.90.0",
211+
"@types/vscode": "^1.105.0",
199212
"@typescript-eslint/eslint-plugin": "^8.32.1",
200213
"@typescript-eslint/parser": "^8.32.1",
201214
"@vscode/test-cli": "^0.0.10",
202215
"@vscode/test-electron": "^2.5.2",
203-
"@vscode/vsce": "^3.4.0",
204-
"esbuild": "^0.25.4",
216+
"@vscode/vsce": "^3.7.1",
217+
"esbuild": "^0.27.2",
205218
"esbuild-plugin-copy": "^2.1.1",
206219
"eslint": "^8.57.0",
207220
"npm-run-all": "^4.1.5",
208221
"typescript": "^5.4.5"
209222
},
210223
"dependencies": {
211-
"vscode-languageclient": "^9.0.1"
224+
"vscode-languageclient": "^10.0.0-next.19"
212225
}
213226
}

src/action-tree-provider.ts

Lines changed: 58 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ enum NodeType {
88
DIRECTORY = 0,
99
PACKAGE = 1,
1010
ACTION = 2,
11-
PRESET = 3,
11+
ACTION_GROUP = 3,
12+
PRESET = 4,
13+
ENV_GROUP = 5,
14+
ENV = 6
1215
};
1316

1417
export type ActionTreeNode = {
@@ -25,9 +28,11 @@ export type FinecodeGetActionsResponse = {
2528

2629
const actionNodeToAction = (node: ActionTreeNode): Action => {
2730
let state = vscode.TreeItemCollapsibleState.None;
28-
if (node.nodeType === NodeType.PACKAGE) {
29-
state = vscode.TreeItemCollapsibleState.Expanded;
30-
} else if (node.nodeType === NodeType.DIRECTORY || node.nodeType === NodeType.ACTION) {
31+
if (node.nodeType === NodeType.PACKAGE
32+
|| node.nodeType === NodeType.DIRECTORY
33+
|| node.nodeType === NodeType.ACTION
34+
|| node.nodeType === NodeType.ENV_GROUP
35+
|| node.nodeType === NodeType.ACTION_GROUP) {
3136
// directories are shown only to be able to create a new packages in them. It happens not
3237
// so often, collapse by default
3338
state = vscode.TreeItemCollapsibleState.Collapsed;
@@ -180,26 +185,53 @@ class Action extends vscode.TreeItem {
180185
};
181186
}
182187

183-
iconPath = {
184-
light: vscode.Uri.parse(path.join(
185-
__filename,
186-
"..",
187-
"assets",
188-
"icons",
189-
"light",
190-
// TODO: folder / folder-opened doesn't change, investigate why
191-
(this.actionType === NodeType.PACKAGE) ? "package.svg" : ((this.actionType === NodeType.DIRECTORY) ? this.collapsibleState === vscode.TreeItemCollapsibleState.Expanded ? "folder-opened.svg" : "folder.svg" : "symbol-event.svg")
192-
)),
193-
dark: vscode.Uri.parse(path.join(
194-
__filename,
195-
"..",
196-
"assets",
197-
"icons",
198-
"dark",
199-
// TODO: folder / folder-opened doesn't change, investigate why
200-
(this.actionType === NodeType.PACKAGE) ? "package.svg" : ((this.actionType === NodeType.DIRECTORY) ? this.collapsibleState === vscode.TreeItemCollapsibleState.Expanded ? "folder-opened.svg" : "folder.svg" : "symbol-event.svg")
201-
)),
202-
};
203-
204-
contextValue = (this.actionType === NodeType.PACKAGE) ? "project" : this.actionType === NodeType.DIRECTORY ? "directory" : "action";
188+
iconPath = this.getIconPath();
189+
190+
private getIconPath() {
191+
let iconName: string;
192+
switch (this.actionType) {
193+
case NodeType.PACKAGE:
194+
iconName = "package.svg";
195+
break;
196+
case NodeType.DIRECTORY:
197+
iconName = "folder.svg";
198+
break;
199+
case NodeType.ENV_GROUP:
200+
iconName = "folder-library.svg";
201+
break;
202+
case NodeType.ENV:
203+
iconName = "book.svg";
204+
break;
205+
case NodeType.ACTION_GROUP:
206+
iconName = "symbol-method-arrow.svg";
207+
break;
208+
default:
209+
iconName = "symbol-event.svg";
210+
break;
211+
}
212+
213+
return {
214+
light: vscode.Uri.parse(path.join(__filename, "..", "assets", "icons", "light", iconName)),
215+
dark: vscode.Uri.parse(path.join(__filename, "..", "assets", "icons", "dark", iconName))
216+
};
217+
}
218+
219+
contextValue = this.getContextValue();
220+
221+
private getContextValue(): string {
222+
switch (this.actionType) {
223+
case NodeType.PACKAGE:
224+
return "project";
225+
case NodeType.DIRECTORY:
226+
return "directory";
227+
case NodeType.ENV_GROUP:
228+
return "envgroup";
229+
case NodeType.ACTION_GROUP:
230+
return "actiongroup";
231+
case NodeType.ENV:
232+
return "env";
233+
default:
234+
return "action";
235+
}
236+
}
205237
}

src/assets/icons/dark/book.svg

Lines changed: 1 addition & 0 deletions
Loading

src/assets/icons/dark/debug.svg

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

src/assets/icons/dark/folder-opened.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Loading

src/assets/icons/light/book.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)