Skip to content

Commit 14d5798

Browse files
Refactor Effect context tracking (#724)
1 parent 6943d59 commit 14d5798

65 files changed

Lines changed: 916 additions & 92 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/tall-maps-unite.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@effect/language-service": patch
3+
---
4+
5+
Refactor Effect context tracking to use cached node context flags and direct generator lookups.
6+
7+
This aligns the TypeScript implementation more closely with the TSGo version and simplifies diagnostics that need to detect whether code is inside an Effect generator.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
globalConsoleInEffect_skipNextLine from 207 to 226
2+
globalConsoleInEffect_skipFile from 207 to 226
3+
globalConsoleInEffect_skipNextLine from 413 to 439
4+
globalConsoleInEffect_skipFile from 413 to 439
5+
globalConsoleInEffect_skipNextLine from 289 to 308
6+
globalConsoleInEffect_skipFile from 289 to 308
7+
globalConsoleInEffect_skipNextLine from 522 to 556
8+
globalConsoleInEffect_skipFile from 522 to 556
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
console.log("sync")
2+
6:47 - 6:66 | 0 | This Effect code uses `console.log`, logging in Effect code is represented through `Effect.log or Logger`. effect(globalConsoleInEffect)
3+
4+
console.warn("try")
5+
9:13 - 9:32 | 0 | This Effect code uses `console.warn`, logging in Effect code is represented through `Effect.logWarning or Logger`. effect(globalConsoleInEffect)
6+
7+
console.log("try-promise")
8+
13:65 - 13:91 | 0 | This Effect code uses `console.log`, logging in Effect code is represented through `Effect.log or Logger`. effect(globalConsoleInEffect)
9+
10+
console.warn("try-promise-object")
11+
16:19 - 16:53 | 0 | This Effect code uses `console.warn`, logging in Effect code is represented through `Effect.logWarning or Logger`. effect(globalConsoleInEffect)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
globalDateInEffect_skipNextLine from 201 to 211
2+
globalDateInEffect_skipFile from 201 to 211
3+
globalDateInEffect_skipNextLine from 386 to 396
4+
globalDateInEffect_skipFile from 386 to 396
5+
globalDateInEffect_skipNextLine from 274 to 284
6+
globalDateInEffect_skipFile from 274 to 284
7+
globalDateInEffect_skipNextLine from 476 to 486
8+
globalDateInEffect_skipFile from 476 to 486
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Date.now()
2+
6:44 - 6:54 | 0 | This Effect code uses `Date.now()`, time access in Effect code is represented through `Clock` from Effect. effect(globalDateInEffect)
3+
4+
new Date()
5+
9:13 - 9:23 | 0 | This Effect code constructs `new Date()`, date values in Effect code are represented through `DateTime` from Effect. effect(globalDateInEffect)
6+
7+
Date.now()
8+
13:62 - 13:72 | 0 | This Effect code uses `Date.now()`, time access in Effect code is represented through `Clock` from Effect. effect(globalDateInEffect)
9+
10+
new Date()
11+
16:19 - 16:29 | 0 | This Effect code constructs `new Date()`, date values in Effect code are represented through `DateTime` from Effect. effect(globalDateInEffect)
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
no codefixes
1+
globalFetchInEffect_skipNextLine from 198 to 203
2+
globalFetchInEffect_skipFile from 198 to 203
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
// no diagnostics
1+
fetch
2+
6:37 - 6:42 | 0 | This Effect code calls the global `fetch` function, HTTP requests in Effect code are represented through `HttpClient` from `@effect/platform`. effect(globalFetchInEffect)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
globalFetchInEffect_skipNextLine from 203 to 208
2+
globalFetchInEffect_skipFile from 203 to 208
3+
globalFetchInEffect_skipNextLine from 432 to 437
4+
globalFetchInEffect_skipFile from 432 to 437
5+
globalFetchInEffect_skipNextLine from 297 to 302
6+
globalFetchInEffect_skipFile from 297 to 302
7+
globalFetchInEffect_skipNextLine from 553 to 558
8+
globalFetchInEffect_skipFile from 553 to 558
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
fetch
2+
6:45 - 6:50 | 0 | This Effect code calls the global `fetch` function, HTTP requests in Effect code are represented through `HttpClient` from `@effect/platform`. effect(globalFetchInEffect)
3+
4+
fetch
5+
9:13 - 9:18 | 0 | This Effect code calls the global `fetch` function, HTTP requests in Effect code are represented through `HttpClient` from `@effect/platform`. effect(globalFetchInEffect)
6+
7+
fetch
8+
13:63 - 13:68 | 0 | This Effect code calls the global `fetch` function, HTTP requests in Effect code are represented through `HttpClient` from `@effect/platform`. effect(globalFetchInEffect)
9+
10+
fetch
11+
16:19 - 16:24 | 0 | This Effect code calls the global `fetch` function, HTTP requests in Effect code are represented through `HttpClient` from `@effect/platform`. effect(globalFetchInEffect)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
globalRandomInEffect_skipNextLine from 205 to 218
2+
globalRandomInEffect_skipFile from 205 to 218
3+
globalRandomInEffect_skipNextLine from 397 to 410
4+
globalRandomInEffect_skipFile from 397 to 410
5+
globalRandomInEffect_skipNextLine from 280 to 293
6+
globalRandomInEffect_skipFile from 280 to 293
7+
globalRandomInEffect_skipNextLine from 492 to 505
8+
globalRandomInEffect_skipFile from 492 to 505

0 commit comments

Comments
 (0)