4222 Commits

Author SHA1 Message Date
Andrew Branch
df1faa09b8
Add isolatedModules error for ambiguous imports referenced in decorator metadata (#42915)
* Add isolatedModules error for ambiguous imports referenced in decorator metadata

* Improve test and accept baselines

* Error only for es2015+

* Add namespace import to error message as workaround

* Add codefix

* Fix merge fallout
2022-03-17 12:00:23 -07:00
Minh Quy
b996287e00
fix(48191): Duplicates comments on "Add definite assignment assertion to property" (#48299)
* Suppress leading and trailing comments for adding missing definite assignment assertion action

* Suppress leading and trailing comments for adding missing initalizer action

* Test for initializer property action
2022-03-17 09:57:10 -07:00
Gabriela Araujo Britto
cf8ed8fec1
Change sortText for class member completions (#48196)
* change sortText for class member completions

* update test

* create new sort text member for class snippets

* change values of sort text enum
2022-03-16 16:04:08 -07:00
Oleksandr T
f12922c8f7
fix(48277): show parameter type inlay hints after ? operator (#48283) 2022-03-16 11:38:40 -07:00
Jesse Trinity
111ca92646
Fix parser regression for bad related diagnostic on missing matching brackets (#44158)
* Revert "Revert #43460 and #40884 (#44175)"

This reverts commit 57704348914d046e6db8907f6e44e7937b3bcb5b.

* fix missing opening brace match error

* refactor parseExpectedMatchingBrackets

* use getNodePos

* accept baselines

* delete mistakenly added files

* Revert getNodePos addition

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2022-03-15 17:29:41 -07:00
Wesley Wigham
3f63804878
Make direct assignments to cjs exports considered literal contexts (#39816)
* Make direct assignments to cjs exports considered literal contexts

* Style feedback from PR

* Trailing whitespaaaaace
2022-03-09 13:27:39 -08:00
Jake Bailey
d8b21a8d6c
Don't crash on non-literal computed property names during getPropertyAssignment (#48079) 2022-03-07 14:18:55 -08:00
Oleksandr T
5f9f9e3752
fix(44477): emit full path to access expressions in comments (#44545)
Co-authored-by: Wesley Wigham <wewigham@microsoft.com>
2022-03-04 11:22:46 -08:00
Jake Bailey
4abad556be
Prevent crash on code fixes on default keyword (#48028) 2022-03-04 10:43:04 -08:00
Gabriela Araujo Britto
e64f04bd8c
Fix modifier order for class member completions (#48066)
* fix modifier order & tests

* remove empty replacement span from tests
2022-03-01 10:05:24 -08:00
Jake Bailey
e4fe50cca4
Fix incorrect parser error assumption in semicolon handling leading to incremental parser brokenness (#48067) 2022-02-28 17:05:32 -08:00
Zzzen
41b981c998
fix(47853): Convert to template string issue (#47976) 2022-02-28 10:40:48 -08:00
Zzzen
dda65830de
go-to-type-definition, and find-all-refs should work for import.meta (#44364)
* go-to-type-definition, and find-all-refs should work for import.meta

* search `meta` instead of `import.meta`

* remove `definition`

* fix compilation error

* update baseline

* revert definition
2022-02-25 09:02:06 -08:00
Oleksandr T
aa920c00f2
fix(47296): add outlining spans for parenthesized expressions (#47307) 2022-02-22 12:12:12 -08:00
Nathan Shively-Sanders
5150682a58
Only suggest @param codefixes in TS (#47959)
* Only issue @param suggestions with codefixes in TS

Previously, there were 2 JS errors that were issued as suggestions in TS
files. But there was no codefix for these errors, and the errors were
incorrect in TS.

This PR only issues the JS-specific errors on JS files.

* Minimise test
2022-02-18 15:58:09 -08:00
Oleksandr T
b0b8cdafc9
feat(44956): remove hyphen separator (#47777) 2022-02-18 13:41:36 -08:00
Oleksandr T
51d34466e7
feat(47281): use unknown type instead of any (#47308) 2022-02-17 13:54:02 -08:00
Oleksandr T
1c06ef38b8
fix(47391): omit | token from jsdoc linkTag text (#47575) 2022-02-17 11:35:09 -08:00
Oleksandr T
5b947e6526
feat(47619): add support for extracting jsx string literal attribute to a constant (#47624) 2022-02-17 11:30:52 -08:00
Oleksandr T
03a4df7a57
fix(47820): forbid extraction jsdoc (#47830) 2022-02-16 16:38:11 -08:00
Anders Hejlsberg
5afbfbcbd0
Instantiation expressions (#47607)
* Permit type arguments in references to generic functions

* Accept new baselines

* Delete pointless fourslash test

* Fix lint issue

* Finalize implementation

* Add tests

* Accept new baselines

* Properly handle instantiation of instantiation expression types

* Accept new API baselines

* Fix lint error

* Add more tests

* Properly handle unions/intersections of generic types

* Add more tests

* More permissive parsing of type arguments in member expressions

* Update tests

* Accept new baselines
2022-02-16 13:27:16 -08:00
Oleksandr T
a0bab5de5c
fix(47256): show deprecated on index signatures (#47400) 2022-02-15 17:13:04 -08:00
Oleksandr T
39fe0318e0
feat(47223): show completion in jsdoc template tag (#47317) 2022-02-15 16:59:37 -08:00
Wesley Wigham
67172e41c2
Triple-slash reference type directives can override the import mode used for their resolution (#47732)
* Triple-slash reference type directives can override the import mode used for their resolution

They now use the file's default mode by default, rather than always using commonjs. The new arguments to the
reference directive look like:

```ts
///<reference types="pkg" resolution-mode="require" />
```

or

```ts
///<reference types="pkg" resolution-mode="import" />
```

* Omit redundant import modes in emitter

* Add test for #47806

* Add server test for triple-slash reference mode overrides

* Move FileReference mode into helper

* Update tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride3.ts

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

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2022-02-15 13:53:11 -08:00
Oleksandr T
1b1530ae52
fix(47713): allow JSDoc tags on CaseClause nodes (#47741) 2022-02-15 13:27:54 -08:00
Felipe Armoni
d13af64bde
Fix 47746 - Missing properties quickfix does not handle generic parameters (#47790)
* Added test

* Added extra test case
2022-02-15 13:09:01 -08:00
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