Commit Graph

561 Commits

Author SHA1 Message Date
Matt Bierner
b36fddfc1f Experimentally marking a few more quick fixes as preferred 2019-01-25 11:48:25 -08:00
Matt Bierner
0927975565 Mark more quick fixes as preferred
#62110
https://github.com/Microsoft/TypeScript/issues/29450
2019-01-24 12:00:40 -08:00
Matt Bierner
4a39da971e Extend disposable in more places 2019-01-24 12:00:40 -08:00
Matt Bierner
e6f93f3074 Extract isPreferredFix 2019-01-24 12:00:40 -08:00
Matt Bierner
508f43166b Rename source.autoFix to source.fixAll
Part of #62110

`autoFix` is a confusing term since we have a `auto fix` command now. Using `fix all` as this term is used by many linters for this type of operation
2019-01-22 14:34:43 -08:00
Matt Bierner
73dfd92e65 Fix spelling 2019-01-22 14:34:43 -08:00
Matt Bierner
f929531dfb Add CodeActionKind.intersects
Fixes #66881
2019-01-21 18:04:01 -08:00
Matt Bierner
c994fc20fa Apply auto fix on save actions sequentially and make sure we request fixes of the specific type we are interested in 2019-01-21 17:16:06 -08:00
Matt Bierner
ee65a242a9 Gate auto fix for TS to use an undocumented experimental TS setting
We likely do not want to enable autofixes until we have proper TS support: https://github.com/Microsoft/TypeScript/issues/29452
2019-01-21 17:16:06 -08:00
Matt Bierner
4e6bd4aedd Prototype autofix source code action
Part of #62110

* Adds a new `CodeActionKind`: `source.autoFix`.
* Implements a simple auto fix provider for typescript. This provider can auto fix `implement interface` and `spelling` errors (provided there is only a single valid fix listed)

The provider is likely not something we actually want to check it (especially in its current state), we should ask TS for proper autoFix support
2019-01-21 17:16:06 -08:00
Matt Bierner
4f8d546aa7 De-duplicate "fix all" quick fixes across requests for multiple diagnostics in selection range
For https://github.com/Microsoft/typescript-tslint-plugin/issues/49
2019-01-21 17:15:49 -08:00
Matt Bierner
bcc2281e45 Rename CodeAction.canAutoApply -> CodeAction.preferred
Part of #62110

Use the more generic name as suggested in https://github.com/Dart-Code/Dart-Code/issues/1393. This makes the intent of the field more clear and also allows us to extend the concept of preferred code actions to refactorings and other classes of code actions

Experimentally also allows a `preferred` value for `apply` when configuring code aciton keyboard shortcuts. This applies the preferred code action returned from the list of code actions returned
2019-01-21 14:09:30 -08:00
Matt Bierner
1904cd8d84 Prototype auto fixable quick fixes
Part of #62110

- Adds a new field `canAutoApply` to code actions. This field indicates that a code action can be applied without additional user input. For quick fixes, this should be set if the fix properly addresses the error

- Enable auto fixes for TS spelling errors

- Added a `editor.action.autoFix` command to triggers auto fixes at the current cursor position
2019-01-16 17:56:22 -08:00
Matt Bierner
2ab82c12ed Make sure we opt in to new TS user preferences for enabling rename features
Fixes #66176
2019-01-11 15:42:03 -08:00
Matt Bierner
adb4b04bfd Fix type error 2019-01-11 14:40:17 -08:00
Matt Bierner
beef295f9a Normalize the TS server path in logged TS server errors 2019-01-11 14:23:29 -08:00
Matt Bierner
e730375b7a Don't make semantic requests against the TS server when the languageService has been disabled 2019-01-11 14:23:29 -08:00
Matt Bierner
6682006c8b Use more explicit state for TS server states
Try to prevent the tracked server state from getting into weird invalid states and make the state more explicit
2019-01-11 14:23:29 -08:00
Matt Bierner
2f5d88899d Make NoContentResponse an constant instead of a class 2019-01-11 11:04:58 -08:00
Matt Bierner
60f232b246 Include TypeScript version in errors logged to dev tools
Fixes #66368
2019-01-11 11:04:58 -08:00
Matt Bierner
3da39a64dd Improve logging of TypeScript server errors
Fixes #66366
Fixes #66367

Avoid printing the error twice in the trace

Make sure we show helpful error information in the VS Code dev tools when a TS server error occurrs
2019-01-11 11:04:57 -08:00
Matt Bierner
d2a8ca946f Use isCancellationRequested 2019-01-11 11:04:57 -08:00
Matt Bierner
66511a0bdb Interup geterror during rename
Rename is a user triggered operation and should interupt long run error computations
2019-01-11 11:04:57 -08:00
SteVen Batten
ccdd2997a6 update AI module (#66370)
fixes #64849
2019-01-10 17:43:25 -08:00
Matt Bierner
299997228d Don't include object key types in completeFunctionCalls
Fixes #66297
2019-01-09 11:52:02 -08:00
Matt Bierner
e44801f2b3 Fix inserting of duplicate calls when using typescript.suggest.completeFunctionCalls
Fixes #18131
2019-01-08 16:25:07 -08:00
Matt Bierner
f49c40947e Add test for completeFunctionCalls 2019-01-08 16:07:40 -08:00
Matt Bierner
6eeb11ecf2 Extract updateConfig 2019-01-08 15:53:11 -08:00
Matt Bierner
d9e2246c9b Temporarily revert using word range for TS completions due to #66187 2019-01-07 17:49:58 -08:00
Matt Bierner
9d2787e42e Accepting a member completion should result in valid code
Fixes #58597

Default to replacing the word range in js/ts. This is a change in core behavior so  we'll need to see what the feedback is like for it.
2019-01-04 18:09:48 -08:00
Matt Bierner
7a4944fb64 Add pinning test for paren accept character on bracket completion 2019-01-04 18:08:17 -08:00
Matt Bierner
6494c1c513 Adding pinning test for function treating paren as commit character 2019-01-04 18:01:01 -08:00
Matt Bierner
24cb22200e Move wait to setup block 2019-01-04 17:33:08 -08:00
Matt Bierner
6366adf510 Add pinning test for period treated as bracket trigger character 2019-01-04 17:30:26 -08:00
Matt Bierner
b166d5896f Add basic pinning test for commit character var completion 2019-01-04 16:56:42 -08:00
Matt Bierner
483adec7a5 Add simple pinning test for basic completion 2019-01-04 16:49:40 -08:00
Matt Bierner
df2d0c0fee Add pinning test for #53962 2019-01-04 16:29:19 -08:00
Matt Bierner
b4964bcf35 Replace some common index based for loops with for-of loops
Replaces many loops of the form:

```js
for (let i = 0; i < elements.length; ++i) {
    const i = elements[i];
   ...
}
```

with:

```js
for (const element of elements) {
    ...
}
```

Mix of a horrible regex based find/replace and manual touch ups
2019-01-03 19:11:18 -08:00
Matt Bierner
5cc00861fc Enable no-var-keyword tslint rule 2019-01-03 18:02:48 -08:00
Matt Bierner
3f8579f96a Avoid some common type casts
Casts can hide some type errors
2019-01-03 17:44:14 -08:00
Rob Lourens
ef2547d547 replace void 0 with undefined 2019-01-03 11:20:19 -08:00
Matt Bierner
3e7bb120c7 Use label text indexes to mark active paramter for js/ts
Fixes #65513
2019-01-02 14:53:21 -08:00
Matt Bierner
44b5a77632 Use TS's document highlight API instead of references api to get highlights
Fixes #65921
Fixes #65051
2019-01-02 11:56:39 -08:00
Matt Bierner
494e5e8509 Fix bug for completing function name parameters if function name contained special snippet syntax 2018-12-23 22:22:38 -06:00
Matt Bierner
8ac2c23fdc Don't force convert fixable diagnostics to numbers
Fixes #64848 for the VS Code side
2018-12-14 14:57:37 -08:00
Matt Bierner
45c34a2c51 Remove extra Array.from 2018-12-14 14:57:37 -08:00
Matt Bierner
7632e0133e Use clear 2018-12-14 14:57:37 -08:00
Matt Bierner
83ce38f6de Make fixPathPrefixes a bit more resiliant 2018-12-14 14:57:36 -08:00
Prabhanjan S Koushik
0f5b2d14e7 Fix #64253 - Support ~/ paths for typescript.tsdk (#64892)
* fix-64253 Added fixPathPrefixes

* fix-64253 Removed  and handled ~/path
2018-12-14 14:18:24 -08:00
Matt Bierner
a87dc2b62f Interup getError for refactor and updatePaths on rename
These are user triggered operations that should interupt the background getError requests
2018-12-14 13:48:53 -08:00