Commit Graph

5007 Commits

Author SHA1 Message Date
Joseph Wunderlich
21ab39649c remove any annotation from declare method quickfix 2019-02-22 17:24:21 -08:00
xiaofa
7c8c6cf4d0 fix no space before equal operator in type parameter 2019-02-20 18:12:09 +08:00
Ron Buckton
61d13b740e Merge pull request #29726 from bmeurer/modifierFlagsCache
Make modifierFlagsCache mandatory for Node objects
2019-02-07 12:13:46 -08:00
Jesse Trinity
7fd1e62a63 accepted new baselines 2019-02-06 14:37:26 -08:00
Jesse Trinity
f0a6154e9b Added auto setting to quotePreference 2019-02-06 14:37:26 -08:00
Benedikt Meurer
0c7a7df09d Also initialize transformFlags properly in NodeObjects. 2019-02-06 20:57:02 +01:00
Benedikt Meurer
fb65adbd23 Fix initialization of TokenOrIdentifierObject#transformFlags.
This should start with `TransformFlags.None` just like in the `Node`
constructor in `src/compiler/utilities.ts`.
2019-02-06 16:51:32 +01:00
Benedikt Meurer
97c557eb04 Make modifierFlagsCache mandatory for Node objects
The `modifierFlagsCache` property is among the top properties that cause
megamorphic stub cache misses when having `tsc` build itself. This is
because it's added sort of randomly to a whole lot of different objects,
at arbitrary points after their initialization.

This also means that `modifierFlagsCache` is often not present on the
instances, which means that when missing on the megamorphic stub cache,
Node/V8 has to compute `NonExistent` handlers for the relevant inline
caches.

It's a lot cheaper to just make sure that the property is always
existent on the instance, and ideally also at the same offset. This
change ensures exactly that.

Drive-by-fix: Also make sure that `transformFlags` (and `parent`)
is always at the same offset for `Node` objects.
2019-02-04 14:46:27 +01:00
Ryan Cavanaugh
a856a64a5c Merge pull request #29446 from fuafa/infer-js-doc
fix quick fix infer parameter types from usage in js file
2019-02-01 13:55:31 -08:00
Benjamin Lichtman
62cf44cb9b Allow per-file setting for rename default behavior preferences (#29593)
<!--
Thank you for submitting a pull request!

Here's a checklist you might find useful.
* [ ] There is an associated issue that is labeled
  'Bug' or 'help wanted' or is in the Community milestone
* [ ] Code is up-to-date with the `master` branch
* [ ] You've successfully run `jake runtests` locally
* [ ] You've signed the CLA
* [ ] There are new or updated unit tests validating the change

Refer to CONTRIBUTING.MD for more details.
  https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md
-->

Fixes #29585.
#29314 and #29385 made it so their respective settings are only recognized when provided to the host as a whole.
This PR makes it so that the relevant settings for the preferences on the file override those of the preferences on the host.
2019-01-30 19:08:30 -08:00
xiaofa
ddbac8f3fe get appropriate parent jsdoc node for arrow functions 2019-01-26 23:59:32 +08:00
Sheetal Nandi
73fe3fc0f5 Merge pull request #29532 from Microsoft/umdModuleGlobalMerge
Handle find all references for symbol merged with UMD module and global var
2019-01-23 11:13:58 -08:00
Sheetal Nandi
d42185373a PR feedback 2019-01-23 10:48:17 -08:00
Ron Buckton
76b78a4df5 Fix crash in signatureHelp 2019-01-22 15:02:30 -08:00
Sheetal Nandi
f0227ecb2c Handle find all references for symbol merged with UMD module and global var
Fixes #29093
2019-01-22 14:52:39 -08:00
Andrew Casey
737fda928c Don't treat interfaces as implementations
...even if they're in ambient contexts.  Same for type aliases.
2019-01-17 15:45:01 -08:00
Andrew Casey
94ca50177a Merge pull request #29451 from amcasey/GH27937
Consider JSX namespace imports when moving statements between files
2019-01-17 10:19:02 -08:00
Andrew Casey
3e256e14dc Add fourslash tests 2019-01-16 19:18:25 -08:00
Andrew Casey
7102de77d3 Consider JSX namespace imports when moving statements between files
Each of the old and new files should end up with a JSX namespace import
iff it contains JSX.

Fixes #27939
2019-01-16 18:55:27 -08:00
xiaofa
c9c9f859f3 fix quick fix infer parameter types from usage in js file 2019-01-17 05:51:57 +08:00
Benjamin Lichtman
5fc8f1dd80 Add opt-in user preference for prefix and suffix text on renames (#29314)
* Add user preference to control renaming through exports

* Only impact renaming

* Update baselines

* Use flag to control all prefix and suffix text and imports

* [WIP] add tests

* Only skip export import specifier with flag

* [WIP] Update tests

* Update test

* Pick up preference from host and update test

* Shorten flag name

* Add missing utility function

* Update comment

* [WIP] rename flag and respond to cr

* [WIP] Add flag for forRelatedSymbol

* Use larger search symbol set for old-style rename

* Respond to CR

* Fix small error

* Fix type mismatch

* Update comment and remove unnecessary exprot

* Respond to CR
2019-01-16 10:58:07 -08:00
Benjamin Lichtman
c5948bf068 Merge pull request #29385 from uniqueiniquity/renameImportPref
Add user preference to opt-in to renaming import paths
2019-01-15 10:29:57 -08:00
Benjamin Lichtman
2c50ed3089 Respond to CR 2019-01-14 17:05:25 -08:00
Sheetal Nandi
d53619a30d Merge pull request #29418 from Microsoft/exportEquals
Handle generating action for export equals with anonymous symbol
2019-01-14 16:12:32 -08:00
Sheetal Nandi
6e54cbdaff Handle generating action for export equals with anonymous symbol
Fixes #28845
2019-01-14 15:32:13 -08:00
Wesley Wigham
3d2bf6a75f Fix implement interface quickfix import types (#29410)
* Pass module specifier resolution host thru types constructed by implements quickfixes

* Add regression test

* Fix scope node for generated methods, fix lints
2019-01-14 13:56:27 -08:00
Benjamin Lichtman
d029fae35c Add user preference to opt-in to renaming import paths 2019-01-11 14:45:08 -08:00
Josh Goldberg
7b6adae6dd Extracted compilerOptions setting to helper function 2019-01-11 15:05:24 -05:00
Josh Goldberg
8d28f9230c Added codefix to enable experimentalDecorators in the user's config file
Starts on #29035 by creating a codefix to enable the `experimentalDecorators` setting in a user's config file, if one exists. The issue's discussion also mentions giving a more precise error message if the user has a jsconfig or tsconfig or creating one if not; I'd rather tackle those in separate PRs to keep this one small.

Doesn't create the code action if no config file is present. Otherwise keeps to the precedent of returning without action when the config file contents aren't the expected JSON structure (looking at `fixCannotFindModule.ts`).  Moves a couple JSON helpers from that file into the sibling `helpers.ts` so both codefixes can use them.
2019-01-11 09:20:12 -05:00
Sheetal Nandi
387be1fffa Merge pull request #29316 from Microsoft/randomIdentifier
Verify that completion with new identifier location returns isNewIdentifierLocation: true
2019-01-09 13:01:22 -08:00
Sheetal Nandi
46482e14a4 Verify that completion with new identifier location returns isNewIdentifierLocation: true
Fixes #24009

Signed-off-by: Sheetal Nandi <shkamat@microsoft.com>
2019-01-08 16:21:46 -08:00
Sheetal Nandi
08f738fc42 There is no need to check for file presence when trying to rename imports based on file rename
Fixes #29031
2019-01-08 15:18:52 -08:00
Sheetal Nandi
93249db692 Use the sourceFile to determine the jsxNamespace at the location for organizingImports
Fixes #28827
2019-01-04 14:12:04 -08:00
Sheetal Nandi
d35ea02cc6 Merge pull request #29247 from ajafff/organizeimports-crash
Fix crash in organizeImports
2019-01-03 08:54:34 -08:00
Klaus Meinhardt
6a9ad0e2eb Fix crash in organizeImports
Fixes: #29236
2019-01-03 16:20:46 +01:00
Benjamin Lichtman
799656a037 Merge pull request #29214 from uniqueiniquity/nestedAsyncCodeFix
Only provide suggestion for outermost async fix
2018-12-31 17:18:39 -08:00
Benjamin Lichtman
11585d29bc Merge pull request #29218 from uniqueiniquity/jsdocSpanForVarStatement
Jsdoc span for var statement
2018-12-31 16:27:34 -08:00
Benjamin Lichtman
cb57f17aba Simplify approach 2018-12-31 16:25:26 -08:00
Benjamin Lichtman
28e68a6891 Fix spelling of convertible 2018-12-31 16:00:24 -08:00
Benjamin Lichtman
048d04684b use existing util functions 2018-12-31 15:56:54 -08:00
Benjamin Lichtman
aebcb6df36 Merge pull request #29216 from uniqueiniquity/multilineArgumentSpans
Give appropriate outlining span for array and object literals as args in call expression
2018-12-31 15:18:07 -08:00
Benjamin Lichtman
34970d8a69 give jsdoc outline span before func exp assigned to var 2018-12-31 15:10:22 -08:00
Benjamin Lichtman
6c34520281 Use normal start for spans for args 2018-12-31 14:37:31 -08:00
Benjamin Lichtman
b466336a3e Add class expression to set of nodes for outlining 2018-12-31 14:04:48 -08:00
Benjamin Lichtman
2dd6e20ef9 Only provide suggestion for outermost async fix 2018-12-31 11:50:40 -08:00
Daniel Rosenwasser
0dbb9760c0 Merge pull request #29147 from Kingwl/type_query_completions
fix typeof completions broken
2018-12-31 10:36:39 -08:00
Benjamin Lichtman
c46090b8dc Show template literal in navtree function call args 2018-12-27 17:43:56 -08:00
王文璐
7c93affd7d fix typeof completions broken 2018-12-25 17:30:04 +08:00
Sheetal Nandi
fcd502502a Merge pull request #28886 from Microsoft/sourceMapDecoder
Enhancements to SourceMap decoder from tsserver
2018-12-19 12:51:42 -08:00
Wesley Wigham
4f7184a587 Fix all new lint failures (#29080) 2018-12-18 11:34:02 -08:00