@effect/language-service 0.10.1 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +24 -7
  2. package/index.js +353 -1936
  3. package/index.js.map +1 -1
  4. package/package.json +1 -1
package/README.md CHANGED
@@ -4,8 +4,8 @@ This package implements a TypeScript language service plugin that allows additio
4
4
 
5
5
  ## Installation
6
6
 
7
- 1) `npm install @effect/language-service --save-dev` in your project
8
- 2) inside your tsconfig.json, you should add the plugin configuration as follows:
7
+ 1. `npm install @effect/language-service --save-dev` in your project
8
+ 2. inside your tsconfig.json, you should add the plugin configuration as follows:
9
9
 
10
10
  ```json
11
11
  {
@@ -18,10 +18,11 @@ This package implements a TypeScript language service plugin that allows additio
18
18
  }
19
19
  }
20
20
  ```
21
- 3) Ensure that you set your editor to use your workspace TypeScript version.
22
-
23
- - In VSCode you can do this by pressing "F1" and typing "TypeScript: Select TypeScript version". Then select "Use workspace version".
24
- - In JetBrains you may have to disable the Vue language service, and chose the workspace version of TypeScript in the settings from the dropdown.
21
+
22
+ 3. Ensure that you set your editor to use your workspace TypeScript version.
23
+
24
+ - In VSCode you can do this by pressing "F1" and typing "TypeScript: Select TypeScript version". Then select "Use workspace version".
25
+ - In JetBrains you may have to disable the Vue language service, and chose the workspace version of TypeScript in the settings from the dropdown.
25
26
 
26
27
  And you're done! You'll now be able to use a set of refactor and diagnostics that targets Effect!
27
28
 
@@ -36,7 +37,8 @@ Few options can be provided alongside the initialization of the Language Service
36
37
  {
37
38
  "name": "@effect/language-service",
38
39
  "diagnostics": true, // controls Effect diagnostics (on by default)
39
- "quickinfo": true // controls quickinfo over Effect (on by default)
40
+ "quickinfo": true, // controls quickinfo over Effect (on by default)
41
+ "completions": true // controls Effect completions (on by default)
40
42
  }
41
43
  ]
42
44
  }
@@ -46,6 +48,7 @@ Few options can be provided alongside the initialization of the Language Service
46
48
  ## Provided functionalities
47
49
 
48
50
  ### Quickinfo
51
+
49
52
  - Show the extended type of the current Effect
50
53
 
51
54
  ### Diagnostics
@@ -56,6 +59,7 @@ Few options can be provided alongside the initialization of the Language Service
56
59
  - Detect unnecessary usages of Effect.gen
57
60
 
58
61
  ### Completions
62
+
59
63
  - Autocomplete 'Self' in Effect.Service, Context.Tag, Schema.TaggedClass, Schema.TaggedRequest and family
60
64
 
61
65
  ### Refactors
@@ -67,3 +71,16 @@ Few options can be provided alongside the initialization of the Language Service
67
71
  - Pipe to datafirst: Transform a pipe() call into a series of datafirst function calls (where available).
68
72
  - Toggle return type signature: With a single refactor, adds or removes type annotations from the definition.
69
73
  - Remove unnecessary `Effect.gen` definitions that contains a single `yield` statement.
74
+ - Wrap an `Effect` expression with `Effect.gen`
75
+
76
+ ## Configuring diagnostics
77
+
78
+ You can either disable or change the severity of specific diagnostics by using comments in your code.
79
+
80
+ ```ts
81
+ // @effect-diagnostics effect/floatingEffect:off
82
+ Effect.succeed(1); // This will not be reported as a floating effect
83
+
84
+ // @effect-diagnostics effect/floatingEffect:error
85
+ Effect.succeed(1); // This will be reported as a floating effect
86
+ ```