Skip to content

Commit e60f0b9

Browse files
Add current span stack view to debugger section (#30)
1 parent 1e1cb37 commit e60f0b9

29 files changed

+4882
-1782
lines changed

.changeset/seven-walls-doubt.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"effect-vscode": minor
3+
---
4+
5+
Add current span stack view to debugger section

.prettierrc.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

.vscode/launch.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"sourceMaps": true,
1515
"resolveSourceMapLocations": [
1616
"${workspaceFolder}/src/**",
17+
"${workspaceFolder}/out/**",
1718
"!**/node_modules/**"
1819
]
1920
},

.vscode/settings.json

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,22 @@
88
},
99
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
1010
"typescript.tsc.autoDetect": "off",
11-
"typescript.tsdk": "node_modules/typescript/lib"
12-
}
11+
"typescript.tsdk": "node_modules/typescript/lib",
12+
"typescript.enablePromptUseWorkspaceTsdk": true,
13+
"editor.formatOnSave": true,
14+
"eslint.format.enable": true,
15+
"[typescript]": {
16+
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
17+
},
18+
"[typescriptreact]": {
19+
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
20+
},
21+
"eslint.validate": [
22+
"markdown",
23+
"javascript",
24+
"typescript"
25+
],
26+
"editor.codeActionsOnSave": {
27+
"source.fixAll.eslint": "explicit"
28+
}
29+
}

eslint.config.mjs

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
import * as effectEslint from "@effect/eslint-plugin"
2+
import eslint from "@eslint/js"
3+
import * as tsResolver from "eslint-import-resolver-typescript"
4+
import importPlugin from "eslint-plugin-import-x"
5+
import simpleImportSort from "eslint-plugin-simple-import-sort"
6+
import sortDestructureKeys from "eslint-plugin-sort-destructure-keys"
7+
import tseslint from "typescript-eslint"
8+
9+
export default tseslint.config(
10+
{
11+
ignores: ["**/dist", "**/out", "**/build", "**/docs", "**/*.md"]
12+
},
13+
eslint.configs.recommended,
14+
tseslint.configs.strict,
15+
importPlugin.flatConfigs.recommended,
16+
importPlugin.flatConfigs.typescript,
17+
effectEslint.configs.dprint,
18+
{
19+
plugins: {
20+
"simple-import-sort": simpleImportSort,
21+
"sort-destructure-keys": sortDestructureKeys
22+
},
23+
24+
languageOptions: {
25+
parser: tseslint.parser,
26+
ecmaVersion: 2018,
27+
sourceType: "module"
28+
},
29+
30+
settings: {
31+
"import-x/resolver": {
32+
name: "tsResolver",
33+
resolver: tsResolver,
34+
options: {
35+
alwaysTryTypes: true
36+
}
37+
}
38+
},
39+
40+
rules: {
41+
"no-fallthrough": "off",
42+
"no-irregular-whitespace": "off",
43+
"object-shorthand": "error",
44+
"prefer-destructuring": "off",
45+
"sort-imports": "off",
46+
47+
"no-restricted-syntax": [
48+
"error",
49+
{
50+
selector: "CallExpression[callee.property.name='push'] > SpreadElement.arguments",
51+
message: "Do not use spread arguments in Array.push"
52+
}
53+
],
54+
55+
"no-unused-vars": "off",
56+
"require-yield": "off",
57+
"prefer-rest-params": "off",
58+
"prefer-spread": "off",
59+
"import-x/export": "off",
60+
"import-x/first": "error",
61+
"import-x/newline-after-import": "error",
62+
"import-x/no-duplicates": "error",
63+
"import-x/no-named-as-default-member": "off",
64+
"import-x/no-unresolved": "off",
65+
"import-x/order": "off",
66+
"simple-import-sort/imports": "off",
67+
"sort-destructure-keys/sort-destructure-keys": "error",
68+
"deprecation/deprecation": "off",
69+
70+
"@typescript-eslint/array-type": [
71+
"warn",
72+
{
73+
default: "generic",
74+
readonly: "generic"
75+
}
76+
],
77+
"@typescript-eslint/no-dynamic-delete": "off",
78+
"@typescript-eslint/ban-ts-comment": "off",
79+
"@typescript-eslint/ban-types": "off",
80+
"@typescript-eslint/camelcase": "off",
81+
"@typescript-eslint/explicit-module-boundary-types": "off",
82+
"@typescript-eslint/consistent-type-imports": "warn",
83+
"@typescript-eslint/explicit-function-return-type": "off",
84+
"@typescript-eslint/interface-name-prefix": "off",
85+
"@typescript-eslint/member-delimiter-style": 0,
86+
"@typescript-eslint/no-array-constructor": "off",
87+
"@typescript-eslint/no-explicit-any": "off",
88+
"@typescript-eslint/no-empty-interface": "off",
89+
"@typescript-eslint/no-empty-object-type": "off",
90+
"@typescript-eslint/no-invalid-void-type": "off",
91+
"@typescript-eslint/no-namespace": "off",
92+
"@typescript-eslint/no-non-null-assertion": "off",
93+
"@typescript-eslint/no-unsafe-function-type": "off",
94+
"@typescript-eslint/no-unused-vars": [
95+
"error",
96+
{
97+
argsIgnorePattern: "^_",
98+
varsIgnorePattern: "^_"
99+
}
100+
],
101+
"@typescript-eslint/no-use-before-define": "off",
102+
"@typescript-eslint/prefer-for-of": "off",
103+
"@typescript-eslint/unified-signatures": "off",
104+
105+
"@effect/dprint": [
106+
"error",
107+
{
108+
config: {
109+
indentWidth: 2,
110+
lineWidth: 120,
111+
semiColons: "asi",
112+
quoteStyle: "alwaysDouble",
113+
trailingCommas: "never",
114+
operatorPosition: "maintain",
115+
"arrowFunction.useParentheses": "force"
116+
}
117+
}
118+
]
119+
}
120+
},
121+
{
122+
files: ["packages/*/src/**/*", "packages/*/test/**/*"],
123+
rules: {
124+
"no-console": "error"
125+
}
126+
}
127+
)

package.json

Lines changed: 79 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@
3636
"type": "integer",
3737
"default": 500,
3838
"description": "The time in milliseconds between polling for metrics"
39+
},
40+
"effect.tracer.pollInterval": {
41+
"type": "integer",
42+
"default": 250,
43+
"description": "The time in milliseconds between polling for span data while using the debug protocol transport"
3944
}
4045
}
4146
},
@@ -50,6 +55,11 @@
5055
"title": "Effect Dev Tools: Stop Server",
5156
"icon": "$(debug-stop)"
5257
},
58+
{
59+
"command": "effect.attachDebugSessionClient",
60+
"title": "Effect Dev Tools: Attach Debug Session Client",
61+
"icon": "$(debug)"
62+
},
5363
{
5464
"command": "effect.resetMetrics",
5565
"title": "Effect Dev Tools: Reset Metrics",
@@ -64,6 +74,16 @@
6474
"command": "effect.copyInfoValue",
6575
"title": "Copy value",
6676
"icon": "$(copy)"
77+
},
78+
{
79+
"command": "effect.revealSpanLocation",
80+
"title": "Effect Dev Tools: Reveal Span Location",
81+
"icon": "$(go-to-file)"
82+
},
83+
{
84+
"command": "effect.revealFiberCurrentSpan",
85+
"title": "Effect Dev Tools: Reveal Fiber Current Span Location",
86+
"icon": "$(go-to-file)"
6787
}
6888
],
6989
"viewsContainers": {
@@ -95,6 +115,16 @@
95115
"id": "effect-context",
96116
"name": "Effect Context",
97117
"when": "inDebugMode"
118+
},
119+
{
120+
"id": "effect-debug-span-stack",
121+
"name": "Effect Span Stack",
122+
"when": "inDebugMode"
123+
},
124+
{
125+
"id": "effect-debug-fibers",
126+
"name": "Effect Fibers",
127+
"when": "inDebugMode"
98128
}
99129
]
100130
},
@@ -116,6 +146,11 @@
116146
"when": "view === effect-clients && effect:running === true",
117147
"group": "navigation"
118148
},
149+
{
150+
"command": "effect.attachDebugSessionClient",
151+
"when": "view === effect-clients && inDebugMode",
152+
"group": "navigation"
153+
},
119154
{
120155
"command": "effect.resetMetrics",
121156
"when": "view === effect-metrics",
@@ -131,38 +166,61 @@
131166
{
132167
"command": "effect.copyInfoValue",
133168
"when": "viewItem == info"
169+
},
170+
{
171+
"command": "effect.revealSpanLocation",
172+
"when": "inDebugMode && view === effect-debug-span-stack",
173+
"group": "inline"
174+
},
175+
{
176+
"command": "effect.revealFiberCurrentSpan",
177+
"when": "inDebugMode && view === effect-debug-fibers",
178+
"group": "inline"
134179
}
135180
]
136181
}
137182
},
138183
"scripts": {
139184
"vscode:prepublish": "pnpm build",
140-
"build": "tsup",
185+
"build": "tsup --config tsup.instrumentation.config.ts && tsup",
141186
"dev": "tsup --watch",
142-
"pretest": "pnpm run compile && pnpm run lint",
187+
"lint": "eslint src",
188+
"lint-fix": "eslint src --fix",
189+
"check": "tsc -b tsconfig.json",
143190
"test": "node ./out/test/runTest.js",
144-
"ci:publish": "vsce publish"
191+
"ci:publish": "vsce publish --no-dependencies"
145192
},
146193
"devDependencies": {
147-
"@changesets/changelog-github": "^0.5.0",
148-
"@changesets/cli": "^2.27.9",
149-
"@effect/experimental": "^0.32.0",
150-
"@effect/language-service": "^0.2.0",
151-
"@effect/platform-node": "^0.64.18",
152-
"@types/mocha": "^10.0.9",
153-
"@types/node": "~22.9.0",
194+
"@changesets/changelog-github": "^0.5.1",
195+
"@changesets/cli": "^2.29.5",
196+
"@effect/eslint-plugin": "^0.3.2",
197+
"@effect/experimental": "^0.52.0",
198+
"@effect/language-service": "^0.26.0",
199+
"@effect/platform": "^0.88.0",
200+
"@effect/platform-node": "^0.90.0",
201+
"@types/mocha": "^10.0.10",
202+
"@types/node": "~24.0.13",
154203
"@types/vscode": "1.84.0",
155-
"@types/ws": "^8.5.13",
156-
"@vscode/test-electron": "^2.4.1",
157-
"@vscode/vsce": "^3.2.1",
158-
"effect": "3.10.10",
159-
"glob": "^11.0.0",
160-
"mocha": "^10.8.2",
161-
"prettier": "^3.3.3",
204+
"@types/ws": "^8.18.1",
205+
"@typescript-eslint/eslint-plugin": "^8.37.0",
206+
"@typescript-eslint/parser": "^8.37.0",
207+
"@vscode/test-electron": "^2.5.2",
208+
"@vscode/vsce": "^3.6.0",
209+
"effect": "3.16.13",
210+
"eslint": "^9.31.0",
211+
"eslint-import-resolver-typescript": "^4.4.4",
212+
"eslint-plugin-import-x": "^4.16.1",
213+
"eslint-plugin-simple-import-sort": "^12.1.1",
214+
"eslint-plugin-sort-destructure-keys": "^2.0.0",
215+
"glob": "^11.0.3",
216+
"mocha": "^11.7.1",
217+
"prettier": "^3.6.2",
162218
"tslib": "^2.8.1",
163-
"tsup": "^8.3.5",
164-
"typescript": "^5.6.3",
165-
"ws": "^8.18.0"
219+
"tsup": "^8.5.0",
220+
"typescript": "^5.8.3",
221+
"typescript-eslint": "^8.37.0",
222+
"ws": "^8.18.3",
223+
"@swc/core": "^1.12.14"
166224
},
167225
"sideEffects": false,
168226
"pnpm": {
@@ -172,4 +230,4 @@
172230
]
173231
}
174232
}
175-
}
233+
}

0 commit comments

Comments
 (0)