Commit Graph

4235 Commits

Author SHA1 Message Date
Oleksandr T
e62f960648 fix(47733): omit JSDoc comment template suggestion on node with existing JSDoc (#47748) 2022-03-30 15:36:47 -07:00
Jake Bailey
3c6c2799b6 Ensure that we copy empty NodeArrays during transform (#48490) 2022-03-30 15:33:51 -07:00
Oleksandr T
c639d3afb9 feat(27615): Add missing member fix should work for type literals (#47212) 2022-03-30 12:55:18 -07:00
Gabriela Araujo Britto
f57bdaa097 Add label details to completion entry (#48429)
* add label details to completion entry

* Use label details for obj literal method completions

* add label details support flag

* add label details support to fourslash

* support both label details and non-label details in object literal method snippets

* CR fixes

* fixes after rebasing

* fix tsserver tests
2022-03-30 12:45:56 -07:00
Gabriela Araujo Britto
e25f04a30f Enable method signature completion for object literals (#48168)
* skeleton of new feature

* working prototype

* refactor print and format code into its own function

* minor changes; don't support overloads

* have two completion entries

* get rid of accessor support

* add snippet support

* add formatting

* add trailing comma

* add sourcedisplay

* support auto-imports via completion details

* add user preference option and fix ordering of entries

* cleanup

* don't return code actions for no import fixes

* make sortText lower priority for snippets

* get rid of flag

* use optional member sort text

* update baselines

* don't collect method symbols if insert text is not supported

* remove comment

* return undefined if type is not function type

* only slice if needed

* use union reduction; more test cases

* WIP: modify sort text system

* Improve new sort text system

* add signature and union type check

* re-add flag

* fix tests

* rename sort text helper

* fix test and code for union case

* add new flag to protocol type

* fix spaces

* CR: minor fixes

* CR: more fixes

* CR: restructure main flow

* minor fix
2022-03-29 17:19:02 -07:00
Andrew Branch
7ec7d6d8e0 Fix string literal completions when a partially-typed string fixes inference to a type parameter (#48410)
* Add failing test

* Fix string literal completions when a partially-typed string fixes inference to a type parameter
2022-03-29 09:07:38 -07:00
Andrew Branch
d962091d94 Fix newline inserted in empty block at end of formatting range (#48463)
* Fix newline inserted in empty block at end of formatting range

* Clean up

* Fix refactoring mistake
2022-03-28 13:50:17 -07:00
Wesley Wigham
a5dae37943 Prevent looking up symbol for as const from triggering an error (#48464) 2022-03-28 12:53:36 -07:00
Oleksandr T
0cc3535cae revert #44956 - remove hyphen separator (#48416) 2022-03-25 08:21:57 -07:00
Oleksandr T
49a12dcbbb fix(47081): show completion list in parenthesized object literal arguments (#47104) 2022-03-24 15:30:26 -07:00
Wesley Wigham
b5a3a058f5 Merge diagnosticsProducing and nonDiagnosticsProducing checkers into a single checker supporting lazy diagnostics (#36747)
* Merge diagnosticsProducing and nonDiagnosticsProducing checkers into a single checker supporting lazy diagnostics

* Fix lint
2022-03-23 16:21:06 -07:00
Minh Quy
4ec16b2a6b Fix#48281 - Indentation not respected when executing various refactorings (TypeScript/JavaScript) (#48340)
* fix(48281) - Preserve indentation when adding missing properties

* fix(48281) - Fix object literal indentation like block

* fix(48281) - Indentation for object literal started with curly brace similar to block
2022-03-23 10:40:50 -07:00
Andrew Branch
5bc8179b73 Make AutoImportProvider look in ATA cache (#48329)
* Make AutoImportProvider consider ATA cache

* Delete unnecessary test
2022-03-21 17:02:44 -07:00
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 5770434891.

* 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