Commit Graph

529 Commits

Author SHA1 Message Date
Matt Bierner
88a6b2fb03 Auto indent case/default body for js/ts
Fixes #48735
2019-04-08 17:55:25 -07:00
Matt Bierner
80db6c43bd Treat updateOpen as a fence command 2019-04-03 14:43:37 -07:00
Matt Bierner
e50c2572d4 Also treat all unused imports as a style error
Fixes #71067
2019-04-02 17:15:53 -07:00
Matt Bierner
1bccbd1cb6 Avoid sync stat call 2019-03-21 16:40:43 -07:00
Matt Bierner
4d81d14de0 Make updatePaths require TS 3.0+
Removes workarounds that were required to support this feature on TS 2.9.
2019-03-21 16:40:43 -07:00
Matt Bierner
25bfefce9e Make sure update imports handles js/ts directory moves
Fixes #62018
2019-03-21 16:40:43 -07:00
Matt Bierner
e5463022e1 Show error if TS returns an empty refactoring
Fixes #70526

An empty refactoring response indicates that something went wrong
2019-03-14 17:58:07 -07:00
Matt Bierner
05efab0e4e Treat diagnostics recieved as js/ts init complete
Fixes #68896
2019-03-11 11:08:28 -07:00
Matt Bierner
36fb7647d7 Flush buffer changes if we see the same file again 2019-03-11 10:14:07 -07:00
Matt Bierner
0e6496dff8 Don't add change if there are no changes 2019-03-11 10:14:07 -07:00
Matt Bierner
0aa886c72e Add undocumented setting to disable batched sync 2019-03-11 10:14:07 -07:00
Matt Bierner
d597028001 Readonly 2019-03-11 10:14:07 -07:00
Matt Bierner
4b9c55d14e Don't leak knowledge that updateOpen is special 2019-03-11 10:14:07 -07:00
Matt Bierner
2a5d86952a Use TS's updateOpen api to batch file changes
For #64485

Batching file changes should be more efficent than sending requests one at a time.
2019-03-11 10:14:07 -07:00
Matt Bierner
2a2f817990 Use the updateOpen TS api to sync multiple changes in a single file
Fixes #69492
2019-03-06 14:54:40 -08:00
Matt Bierner
4bfec9c80f Make sure we match whole file name for config file 2019-03-06 10:50:09 -08:00
Matt Bierner
c93f5e3560 Use regular expression to identify config file names instead of singe file name 2019-03-06 10:50:09 -08:00
Matt Bierner
38c3f4bede Use config file diagnostics provided by TS Server
Fixes #69880
2019-03-05 17:07:14 -08:00
Matt Bierner
491dd0feb8 Add logging to see if TS buffers are in an invalid state
An example would be trying to change a file that is not opened
2019-03-01 16:06:51 -08:00
Matt Bierner
1cb65ce8e5 Extract and lift constant 2019-03-01 16:06:51 -08:00
Matt Bierner
29acd11312 Fix bad newline 2019-03-01 16:06:51 -08:00
Matt Bierner
553e6e4f79 Always clear diagnostics for a js/ts file when it closes
Fixes #59363
Fixes #58088
Reopens #47386
2019-02-21 10:45:43 -08:00
Matt Bierner
2e4d4a6bb1 Don't make extra reloadProjects call when a js/tsconfig files changes
The TypeScript Server should be watching these files already so we do not need to tell it to 'reloadProjects'. In the current case, 'reloadProjects' is causing a TS Server error

https://github.com/Microsoft/TypeScript/issues/30005

Fixes #68428
2019-02-20 16:59:35 -08:00
Matt Bierner
a2eee79774 Use 2018 as target for extensions since we are now running on node 10 2019-02-20 16:09:25 -08:00
Matt Bierner
ea995be36c Make sure we send correctly normalized stacks on errors 2019-02-14 14:33:56 -08:00
Matt Bierner
ba19df41ff Normalize stack 2019-02-14 14:33:56 -08:00
Matt Bierner
b4522997ac Add preference to disable shorthand renaming
Fixes #68029

Use the `typescript.preferences.renameShorthandProperties` and `javascript.preferences.renameShorthandProperties` to disable shorthand property renames. Default to enabling renames
2019-02-13 17:44:08 -08:00
Matt Bierner
a8216d42a4 Make the typescript plugins contribution point dynamic
Part of #67575
2019-02-11 16:41:59 -08:00
Matt Bierner
1cb2f5500a Support TypeScript's explicit "auto" quotePreference
Fixes #68185
2019-02-07 17:31:25 -08:00
Matt Bierner
9a766eaa38 Make sure we update tag closing registration when the document's language changes
Fixes #67613
2019-01-30 18:50:41 -08:00
Matt Bierner
10c3fcb4fc Fixes #67430 2019-01-30 12:58:11 -08:00
Thai Pangsakulyanont
84424c84fd Use jsonc parser to parse a config file
This fixes a problem where the `typescript` VSCode task runs `tsc` with `-p`
when it should run `-b` when `tsconfig.json` has the `"references"` property.

```js
{
  "extends": "./tsconfig.app.json",
  // meow
  "references": [{ "path": "./tsconfig.lib.json" }]
}
```

This bug happens because while `tsconfig.json` file allows comment, the
parsing logic here uses vanilla `JSON.parse` which cannot parse comments.

This commit fixes it by using `jsonc.parse` instead.
2019-01-30 17:46:45 +07:00
Matt Bierner
c37d497f2b Mark add missing async as auto fixable 2019-01-28 18:12:32 -08:00
Matt Bierner
13aff1eff2 Add workaround for TS not supporting providePrefixAndSuffixTextForRename not being supported per-file
Workaround for https://github.com/Microsoft/TypeScript/issues/29585
2019-01-28 17:16:49 -08:00
Matt Bierner
52fb9079e9 Merge pull request #67148 from RomainMuller/master
Fix the "tsc watch" task when references are used
2019-01-28 15:32:21 -08:00
Matt Bierner
b15877def6 Handle some edge cases of #18131 2019-01-28 14:46:29 -08:00
Matt Bierner
807759ecff Rename jsDocCompletion.enabled to javascript.suggest.completeJsDocs and typescript.suggest.completeJsDocs
Fixes #67146
2019-01-28 14:46:29 -08:00
Matt Bierner
a70b1317a1 Removing languageServiceEnabled check
After further discussion with the TS team, we determined that we do not need to stop sending  semantic commands when the language service disables itself
2019-01-28 13:40:27 -08:00
Matt Bierner
ef25b181ea Move ServerResponse into namespace 2019-01-28 13:40:27 -08:00
Matt Bierner
ccb5a625c2 Mark extract constant as a preferred refactoring
https://github.com/Microsoft/TypeScript/issues/29587
2019-01-28 13:40:27 -08:00
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