Commit Graph
5866 Commits
Author SHA1 Message Date
Oleksandr T ad70313141 fix(39858): generate valid async/await code for imported functions (#40154) 2020-11-02 16:12:08 -08:00
Oleksandr T 5d81b17d02 fix(40042): add modifiers in correct position for decorated methods (#40050) 2020-11-02 15:52:57 -08:00
Oleksandr T e4c1568c5d fix(41078): add element access expressions support in convertFunctionToEs6Class (#41089) 2020-11-02 15:49:22 -08:00
Oleksandr T 3f92a6498f fix(40257): fix type parameters range (#40265) 2020-11-02 15:20:13 -08:00
Wenlu WangandNathan Shively-Sanders ce8d702586 Add support for pedantic property access (#40171)
* Add support for pedantic property access

* accept baseline

* Update diag message

* Avoid pedantic

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-11-02 15:19:00 -08:00
Nathan Shively-Sanders ae81add083 Separate delete-all-imports from other delete-all (#41105)
This fixes the first part of #32196
2020-11-02 14:18:50 -08:00
Oleksandr T eb6ddf6b29 fix(40671): suggest ConvertStringToTemplateLiteral refactoring for string with property/element acceses elements (#40942) 2020-10-29 15:23:11 -07:00
MichaelandAndrew Branch 71cd5d522d Fix two issues with ConvertToTypeOnlyExport codefix (#40490)
* Modify test case to reproduce error

* Fix TypeOnlyExport codefix to work with 3 or more type exports in the same declaration

The check to ensure that a fixed export declaration wasn't fixed again
was reversed. This only surfaced when 3 or more type exports existed in
the same declaration.

* Add failing test cases for comments being duplicated

* Fix convertToTypeOnlyExport codefix from duplicating leading comments

* Simplify convertToTypeOnlyExport when change is just inserting `type` keyword

Co-authored-by: Andrew Branch <andrew@wheream.io>
2020-10-27 15:08:20 -07:00
Oleksandr T 9ed608b439 fix(41244): ignore synthesized imports (#41267) 2020-10-27 13:22:02 -07:00
Oleksandr T 3754bb4455 fix(40994): change type for optional properties (#41011) 2020-10-27 10:05:40 -07:00
Alex T 417b8a9481 fix(29881): infer quote preference for property access conversion in completions (#41041) 2020-10-13 10:06:27 -07:00
Andrew Branch 83d02a5f05 Fix auto imports for export default edge cases (#41068) 2020-10-12 15:42:58 -07:00
Andrew Branch 4766a2e5a3 Fix overlapping changes when un-qualifying import use site within transformed export (#40987)
* Fix overlapping changes when un-qualifying import use site within transformed export

* Break long line
2020-10-09 13:24:18 -07:00
Alex T 23c5f9260c fix(3758): show completion for object literals in an assignment pattern (#40976) 2020-10-08 12:27:53 -07:00
Wesley Wigham 4dc7e59248 Merge pull request #40953 from weswigham/improve-completions-large-literal-perf
Improve the performance of requesting completions within a massive array literal
2020-10-07 12:44:20 -07:00
Wesley Wigham d6af322287 Add comment 2020-10-07 12:27:43 -07:00
Wesley Wigham 3df8bc6a03 Rephrase to use binarySearchKey 2020-10-06 12:29:58 -07:00
Alex T 5c55fc0a21 fix(40817): suggest import for default exported alias (#40845) 2020-10-06 09:52:35 -07:00
Alex T 0c7d45a9ed fix: change deprecated FunctionLike type to SignatureDeclaration (#40795) 2020-10-06 07:51:01 -07:00
Alex T 1e49ad8370 fix(40685): fix generating docs for arrow functions (#40728) 2020-10-06 07:50:08 -07:00
Wesley Wigham da57f9876e Improve the performance of requesting completions within a massive array literal 2020-10-05 14:42:10 -07:00
Andrew BranchandNathan Shively-Sanders 6ee4a6b7f0 Skip past module.exports = { Foo } in go-to-defintion on 'Foo' (#40835)
* Add test

* Skip shorthand property assignments of module.exports in go-to-definition

* Skip past shorthand property assignments in module.exports in go-to-definition

* Revert WIP change

* Fix comment typo

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-10-05 11:47:19 -07:00
Andrew Branch 736363b427 Use other files when necessary to determine import style in JS (#40879)
* Use other files when necessary to determine import style in JS

* Fix existing tests
2020-10-05 11:39:20 -07:00
Andrew Branch a301001420 Use correct program when checking for reexports from AutoImportProviderProject (#40843) 2020-09-30 09:32:19 -07:00
Nathan Shively-Sanders f615e229d3 Fix default property assigned prototype (#40836)
* Fix default-property-assignment decls+prototype property decls

The check in getAssignedClassSymbol forgot to allow for default-property
assignment declarations, in part because it wasn't using a utility
function to do so.

* small cleanup

* make allowDeclaration parameter required
2020-09-30 08:36:52 -07:00
Armando Aguirre f645418833 Merge pull request #40783 from armanio123/FixCommentOnStartLine
Fixed bug with toggleLineComment ends in a start line
2020-09-29 11:43:51 -07:00
Alex T 335ed915f1 fix(40609): fix crash for extracting type alias with several type arguments (#40820) 2020-09-28 23:12:15 -07:00
Armando Aguirre 8cf980af8d Fixed bug with toggleLineComment ends in a start line 2020-09-25 19:00:02 -07:00
Alex T 73f5f02e97 fix(40756): disable truncation for inferred type (#40764) 2020-09-25 13:01:08 -07:00
Alex T 8e86b24036 feat(40233): add JS Doc types to smart selection (#40338) 2020-09-25 12:36:04 -07:00
Alex T 78830f3be2 fix(40510): add element access expressions support in convertToOptionalChainExpression (#40524) 2020-09-22 18:17:17 -07:00
Andrew Branch 9eb6424b8f Fix indentation of arrow functions returning parenthesized expressions (#40677)
* Fix indentation of arrow functions returning parenthesized expressions

* Add more test cases
2020-09-22 17:16:09 -07:00
Alex T c5a28fcdec fix(39589): add await before return promise expression (#39649) 2020-09-22 15:34:56 -07:00
Alex T 6c6ddfe5c0 fix(39899): include in NavigationBar default exported call expression arguments (#40412) 2020-09-18 13:06:56 -07:00
Alex T d779a19053 fix(40432): show as keyword in function context (#40481) 2020-09-17 02:15:48 -07:00
Ron Buckton dba042d7d5 Add quick fix to add 'void' to Promise resolved without value (#40558)
* Add codefix to add 'void' to Promise resolved without value

* Add specific error message in checker to reduce quick-fix time in editor
2020-09-14 19:12:33 -07:00
Alex T c493d077a3 copy prologue directives to new file (#40306) 2020-09-14 12:24:32 -07:00
Ryan Cavanaugh ea51fabb7c Don't crash when observing invalid 'export' in object literal (#40295)
Fixes #32870
2020-09-11 17:18:23 -07:00
Alex T d7cd405bb2 feat(14751): show static members at the top of the list for a class like completion (#40428) 2020-09-11 14:48:24 -07:00
db5368dc1d Import the semantic highlighter from typescript-vscode-sh-plugin (#39119)
* Initial import of the vscode semantic highlight code

* Adds the ability to test modern semantic classification via strings instead of numbers

* Adds existing tests

* Port over the semantic classification tests

* Update baselines

* Update src/harness/fourslashImpl.ts

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>

* Handle feedback from #39119

* Consistent formatting in the 2020 classifier

* Update baselines

* Apply suggestions from code review

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>

* Update src/harness/fourslashImpl.ts

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>

* Reafactor after comments

* Use 2020 everywhere

* Handle feedback

* WIP - don't provide a breaking change

* Fix all build errors

* Update baselines

* Update src/services/classifier2020.ts

Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>

* Addresses Ron's feedback

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
2020-09-11 15:10:55 -04:00
Orta TheroxandWesley Wigham cdafb7157b Replaces the default module index resolver with '/index' instead of '' when handling internal routing for dts bundles (#39277)
* Adds support for declaring the bundled name of a dts module export

Co-authored-by: Wesley Wigham <wwigham@gmail.com>

* Adds baselines

* Update the tests

* Try to reduce the scope of the bundledPackageName error

* Use the flag in more baselines

* Get it green

* More tests

* Handle more feedback

* More test cleanup

* Set the moduleResolution for the tsconfigs

Co-authored-by: Wesley Wigham <wwigham@gmail.com>
2020-09-11 08:12:07 -04:00
Orta Therox 0a5f53301f Retains trailing cmments in a logical manner in extract type (#40245) 2020-09-10 14:59:46 -04:00
Nathan Shively-Sanders 156cb4c1f9 Fix see tag quickinfo (#40458)
* Add test

* Treat see tags same as param tags
2020-09-10 08:28:38 -07:00
Anders HejlsbergandErich Gamma 6f0c91c4cb Template literal types and mapped type 'as' clauses (#40336)
* Initial implementation of string template types

* Accept new API baselines

* Accept new baselines

* Unified checking for large cross product union types

* Accept new baselines

* Ensure errors from union type resolution are reported

* Accept new baselines

* Compute constraints for string template types

* Support `as T` clause in mapped types

* Accept new API baselines

* Add missing semicolon

* Add checking of `as T` clauses

* Support casing modifiers in string template types

* Accept new baselines

* Bump keyword maximum length

* fix anders

* Revert "fix anders"

This reverts commit b3178d4618.

* Properly handle 'as T' clause with keyof for mapped type

* Fix lint error

* Single character inferences and anchored end span matching

* Fewer array copy operations in template literal type resolution

* Handle cases where 'as T' maps multiple properties onto one

* Fix lint error

* Store key type instead of type mapper in MappedSymbol

* No constraint on `in T` type when `as N` clause present

* Rename from TemplateType to TemplateLiteralType

* Accept new API baselines

* Add tests

* Accept new baselines

* Address CR feedback

* Accept new API baselines

Co-authored-by: Erich Gamma <egamma@microsoft.com>
2020-09-09 17:23:22 -10:00
Vincent Boivin 96b0832cf6 fix(40322): bad completions for string literal type as indexed access type object (#40424)
* Added fourslash tests to work on the bug

* fix(40322): bad completions for string literal type as indexed access type object

* Added regression tests

* Using nodes instead of text

* Add verification for parenthesized nodes

* Using range check

* Change test markers
2020-09-09 15:26:35 -07:00
ee5f51bc0f Add see tag support (#39760)
* Add see tag parser

* add baseline

* fix symbol resolve

* add more case

* fix unittests

* improve tests and parser

* accept baseline

* Adopt package-lock.json and npm ci

* Add a workflow to update package-lock.json daily

* Git ignore package-lock.json and forcibly update in workflow

* Update bot email address

* Delete extra npm update

* Update package-lock.json

* Add compactDisplay and signDisplay to NumberFormatOptions (#40039)

* Fix typo in (Readonly)Set.keys comment (fixes #40164) (#40176)

* fix(26325): use a unique name for reserved words in 'constructor like' function name (#39684)

* fix(25770): add diagnostic message for the possible mapped type used as an index (#39973)

* fix(31046): add new diagnostic message for incompatible constructor signature (#40073)

* Update package-lock.json

* Update package-lock.json

* Add rename support

* Accpet baseline

* wip

* fix anders

* Revert "fix anders"

This reverts commit b3178d4618.

* Fix call hierarchy item serialization and server tests (#40348)

* Avoid error

* accept baseline

* Add more tests

* Add signature name resolve

Co-authored-by: Andrew Casey <andrew.casey@microsoft.com>
Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
Co-authored-by: Neil Kistner <neil.kistner@gmail.com>
Co-authored-by: cherryblossom000 <31467609+cherryblossom000@users.noreply.github.com>
Co-authored-by: Alexander T <alexander.tarasyuk@outlook.com>
Co-authored-by: Erich Gamma <egamma@microsoft.com>
Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
2020-09-09 10:45:09 -07:00
Alex T 4584d6d470 fix(39676): skip removing unused parameters for functions used as callback references (#40299) 2020-09-09 08:23:53 -07:00
Alex T 6aec7f4676 feat(25770): add Quick Fix to convert LiteralType to MappedType (#40226) 2020-09-08 14:18:53 -07:00
Alex T 6101fbca39 fix(40150): use parameter name for a Promise callback function (#40191) 2020-09-08 13:44:38 -07:00
Andrew Branch f6f2d36ee3 Add optionalReplacementSpan to completions response (#40347)
* Add optionalReplacementRange to completions response

* Get the name right

* Fix unit tests

* Fix comment typo

* Fix comment typo

* Baseline
2020-09-04 13:09:52 -07:00