You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.MD
+33-2Lines changed: 33 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,6 +67,17 @@ const usersList = []
67
67
usersList.map// -> usersList.map((user) => )
68
68
```
69
69
70
+
### Locality Bonus
71
+
72
+
(*disabled by default*, SUPER recommended, enable with `suggestions.localityBonus`)
73
+
74
+
Suggestions closer to cursor will appear higher, useful for local variables (eg callback parameters), requires TS >=5.0
75
+
76
+
Why not enable built-in *Locality Bonus* setting:
77
+
78
+
- Sometimes it just doesn't work
79
+
- In other cases it might lead to misleading suggestions (as it's text-based and not smart)
80
+
70
81
### Case-sensitive Completions
71
82
72
83
(*disabled by default*)
@@ -256,6 +267,7 @@ There are value descriptions for two settings:
256
267
257
268
```ts
258
269
const example = ({ a }, b?, c = 5, ...d) => { }
270
+
259
271
// binding-name (default)
260
272
example({ a }, b, c, ...d)
261
273
// always-declaration (also popular)
@@ -268,11 +280,14 @@ example(__0, b, c, d)
268
280
269
281
```ts
270
282
const example = ({ a }, b?, c = 5, ...d) => { }
283
+
271
284
// only-rest
272
285
example({ a }, b, c)
273
-
// optional-and-rest
286
+
// optional-and-rest (default)
274
287
example({ a })
275
-
// no-skip (default)
288
+
// all
289
+
example() // (cursor inside)
290
+
// no-skip (popular)
276
291
example({ a }, b, c, ...d)
277
292
```
278
293
@@ -300,6 +315,22 @@ function Foo() {
300
315
}
301
316
```
302
317
318
+
### Ambiguous Suggestions
319
+
320
+
Some variables like `Object` or `lodash` are common to access properties as well as call directly:
321
+
322
+
```ts
323
+
Object.assign(...)
324
+
Object()
325
+
// or
326
+
lodash.version
327
+
lodash(...)
328
+
```
329
+
330
+
To not be annoying, we don't insert a method snippet on such suggestion accept.
331
+
332
+
Instead, for these *ambiguous* suggestions we require you to accept the same suggestion twice to ensure you actually want a method snippet.
333
+
303
334
## Auto Imports
304
335
305
336
With this plugin you have total (almost) control over auto imports that appear in completions, quick fixes and import all quick fix. Some examples of what you can do:
0 commit comments