Commit Graph

4196 Commits

Author SHA1 Message Date
Oleksandr T
73506f3512 fix(46803): remove unused react imports with enabled react-jsxdev, react-jsx (#47247) 2022-02-11 11:13:26 -08:00
Wesley Wigham
4c80036b7d Enable path completions for node12/nodenext (#47836)
* Enable path completions for node12/nodenext

* Explicitly pull path completions from export maps when available

* Explicitly handle pattern exports by stopping up to the star
2022-02-11 10:54:04 -08:00
Andrew Branch
954d0442eb Avoid auto-importing from barrel re-exporting index files that are likely to make an import cycle (#47516)
* Avoid auto-importing from barrel re-exporting index files that are likely to make an import cycle

* Finish fixing merge conflict
2022-02-10 15:05:08 -08:00
Oleksandr T
b456702755 feat(11378): check param names in JSDoc (#47257) 2022-02-10 10:02:07 -08:00
Oleksandr T
c06849ad16 fix(47787): show QF to delete parameter in getter (#47797) 2022-02-08 13:39:54 -08:00
Oleksandr T
17b97ccc43 fix(47788): forbid convertToMappedObjectType QF in invalid index signatures (#47798) 2022-02-08 11:36:45 -08:00
Oleksandr T
867470ca26 fix(47783): show globals completion in case keyword outside of switch statement (#47786) 2022-02-07 14:08:35 -08:00
Oleksandr T
afeacf41bd fix(47782): forbid super() extraction outside this container (#47784) 2022-02-07 13:26:39 -08:00
Andrew Branch
9c3b41d3cc Refactor named imports to default instead of namespace when esModuleInterop is on and module is an export= (#47744) 2022-02-04 17:11:25 -08:00
Oleksandr T
8ddead50eb fix(32941): include Template tag constraint to QuickInfo response (#47567) 2022-02-04 16:12:23 -08:00
Oleksandr T
ceee975052 fix(45917): show completions in string literal followed by a comma (#46970) 2022-02-04 12:15:02 -08:00
Oleksandr T
0d5abd8a15 feat(27601): include JSDoc comments for destructuring arguments (#46886) 2022-02-03 11:27:40 -08:00
Oliver Joseph Ash
b7d011777e "Convert parameters to destructured object": enable for functions with just one parameter (#46945)
* "Convert parameters to destructured object": enable for functions with just one parameter

Fixes https://github.com/microsoft/TypeScript/issues/41753

* Add test
2022-02-03 10:13:05 -08:00
Nathan Shively-Sanders
c4fd0028f5 Fix @link https:// formatting (#47705)
* Fix @link https:// formatting

Also improve .d.ts formatting of `@link`,`@linkcode`,`@linkplain`.

Fixes #46734

1. Previously, `@link` incorrectly put a space between "https" and "://"
when formatting jsdoc for editors. Now it does not.
2. When fixing the same output for .d.ts, I discovered that all `@link` tags
were formatted as `@link`, even if they were `@linkcode` or
`@linkplain`. I fixed that too.

* semicolon lint
2022-02-02 14:00:08 -08:00
Oleksandr T
854cec7387 fix(47670): remove import alias that uses the same name (#47676) 2022-02-02 10:45:18 -08:00
Zzzen
880e2c0783 support quickinfo and go-to-definition on typeof this (#47085)
* support quickinfo and go-to-definition on `typeof this`

* update baseline

* move code to checkIdentifier
2022-02-01 16:16:01 -08:00
Nathan Shively-Sanders
1ebdcc6fb8 Fix inlay hint crash for jsdoc function type syntax (#47684)
* Fix inlay hint crash for jsdoc function type syntax

Parameters in JSDoc function types do not have names. The type does not
reflect this. This PR fixes the crash; I'll see how much churn it causes
to fix the type as well.

Fixes #47606

* make inlay hints test smaller
2022-02-01 10:11:39 -08:00
Oleksandr T
2d501b1d98 fix(47582): skip extraction if the type node is in the range of the type parameter declaration (#47596) 2022-01-28 12:19:48 -08:00
Gabriela Araujo Britto
90280518ae Add assert keyword in completions (#47644)
* add contextual keyword assert in completions

* clean up
2022-01-27 16:17:43 -08:00
Andrew Branch
4d298591db Fix duplicate completions from two different copies of a node_modules package (#47584)
* Fix duplicate completions from two different copies of a node_modules package

* Fix logic for scoped packages

* Fix errors from merge

* Less gross way to reconcile these two conflicting PRs
2022-01-27 14:35:36 -08:00
Andrew Branch
e9092f3723 Proposal: simplify auto import descriptions (#47631)
* Simplify import fix descriptions

* Update tests

* Fix new test
2022-01-27 10:21:08 -08:00
Andrew Branch
5813a3541c Allow moduleSymbolToValidIdentifier to be uppercase for JSX tags (#47625)
* Allow moduleSymbolToValidIdentifier to be uppercase for JSX tags

* Cleaner way of getting the uppercase name when needed

* Fix build errors, get rid of basically unnecessary ScriptTarget

* More accurate name for parameter

* Rename other parameter too

* Fix failing test
2022-01-26 16:12:40 -08:00
Andrew Branch
0d3ff0cce8 Add codefix and completions for promoting existing type-only imports to non-type-only (#47552)
* Import fix

* Wire up completions, add sorting to fix

* Fix overlapping changes when there’s only one import specifier

* Update API baseline

* Add sorting and filtering back to UMD fix
2022-01-26 15:07:41 -08:00
Jake Bailey
3718182a13 Don't block completion after end of type parameters in JSX elements (#47501) 2022-01-26 14:45:21 -08:00
Oleksandr T
20b5523830 feat(42684): allow deprecated JSDoc tag to be used on aliased nodes (#47293) 2022-01-25 15:49:33 -08:00
Song Gao
0673f0288c Fix JsDocTags inheritage and setter/getter quickInfo (#46801)
* tmp

* fix jsdoc inheritage for property and setter/getter

* fix test

* fix test

* fix mirrors

* add more tests

* add tests of jsdoc for intance of class
2022-01-25 15:43:12 -08:00
Oleksandr T
5e38082a9e fix(47165): ignore spaces in goToDefinition imports (#47541) 2022-01-21 10:09:10 -08:00
Oleksandr T
e9453f411a fix(47524): skip assertion on checking this in fixImplicitThis QF (#47527) 2022-01-20 14:58:28 -08:00
Armando Aguirre
ab4d3198ed Fixed Go To Definition using jsconfig (#47434)
* Fixed Go To Definition using jsconfig

* Fixed formatting
2022-01-20 14:45:29 -08:00
Wesley Wigham
bae0f50818 Fix import assertion occurrences crash and make import assertion parsing more generous (#47535) 2022-01-20 14:08:47 -08:00
Daniel Rosenwasser
ad5ca673e6 Avoid crash for import code fixes with dotted require (#47433)
* Add failing test.

* Update failing test.

* Finalized failing test case.

* Separate our usages of utilities that expect variables initialized to require(...) and require(...).foo.

* Renamed types and utilities, removed accidental indentation.

* Renamed both utilitiy functions uniformly.
2022-01-19 15:05:01 -08:00
Jake Bailey
049d4e049f Modify debug assertion to avoid crashing on SyntaxList (#47500) 2022-01-19 13:37:55 -08:00
Oleksandr T
c44fd466a7 fix(47451): Implicit 'any' quick fix text grabs text from wrong file (#47493) 2022-01-18 20:59:26 -08:00
Jake Bailey
2635102f7b Deprecate ScriptElementKind.jsxAttribute (#47414) 2022-01-18 13:53:51 -08:00
Oleksandr T
8153475ca5 fix(47438): show auto-complete for this inside class static blocks (#47460) 2022-01-18 12:40:00 -08:00
Oleksandr T
febfd442cd fix(47417): allow undefined type to be added to JSDoc types (#47449) 2022-01-16 13:44:07 -08:00
Andrew Branch
28c2084aca Deprioritize import paths made up of only dots and slashes (#47432)
* Deprioritize import paths made up of only dots and slashes

* Fix test

* Hoist regex

* Yaaaay RegExp state
2022-01-14 10:33:05 -08:00
Jake Bailey
16bbddbd22 Rewrite logic for JSX attribute completion detection (#47412) 2022-01-14 09:56:57 -08:00
Jake Bailey
70097c4908 Fix type error in fourslash.ts (#47430) 2022-01-13 16:51:02 -08:00
Oleksandr T
42ea5ec3d8 fix(47415): don't show addConvertToUnknownForNonOverlappingTypes QF in JS (#47424) 2022-01-13 11:17:36 -08:00
Daniel Rosenwasser
461fb65623 Fix for crash for auto import completions with a rooted rootDirs entry (#47411)
* Add failing test case.

* Guard against undefined relative path.
2022-01-12 13:45:06 -08:00
Daniel Rosenwasser
14f33d5c4b Fix for crash in navbar with double ambient modules (#47395)
* Add failing test.

* Guard against undefined module bodies in navbar/navtree.
2022-01-11 18:14:22 -08:00
Andrew Branch
0f1496f354 Process package.json exports with auto-import provider (#47092)
* Have auto-import provider pull in `exports`

* Revert filtering of node_modules relative paths, to do in separate PR

* Do @types and JS prioritization correctly

* Cache entrypoints on PackageJsonInfo

* Add one more test

* Delete unused function

* Fix other tests - dependencies need package.json files

* Do two passes of exports resolution

* Fix missed refactor

* Apply suggestions from code review

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

* Uncomment rest of test

* Handle array targets

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2022-01-11 11:10:35 -08:00
Oleksandr T
6fc0584dd5 fix(46402): create valid property keys/jsx attribute names (#46716) 2022-01-07 11:46:26 -08:00
Gabriela Araujo Britto
404a7d602d Gabritto/semicolons (#46832)
* call formatter in completions

* fixes

* add test

* update api baselines

* fix createModifiersFromModifierFlag to not return empty array
2022-01-04 11:50:49 -08:00
Oleksandr T
c282771d59 fix(47004): ignore arguments name in PropertyAssignment (#47054) 2021-12-16 13:05:48 -08:00
LowR
7e0e8671fa fix(47134): show all meanings for type-only imports and exports (#47138) 2021-12-14 10:58:21 -08:00
Hiroshi Ogawa
8974fead2d fix(47062): support generic arrow function with default type parameter in tsx (#47112)
* fix(47062): support generic arrow function with default type parameter in tsx

* test: update test "completionListIsGlobalCompletion"
2021-12-14 09:02:36 -08:00
Andrew Branch
430599722e Fix extract type crash (#47136) 2021-12-13 10:39:34 -08:00
Song Gao
e2c89af335 use default type parameter rather than unknown when show quick help (#46792)
* use default type parameter rather than `unknown` when show quick help

* prefer default type parameter than constraint for quick info
2021-12-08 17:02:22 -08:00