Commit Graph

4152 Commits

Author SHA1 Message Date
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
Oleksandr T
022542548e fix(47043): as const cast wrong colour when using typescript 4.5.2 (#47066) 2021-12-08 10:15:58 -08:00
Oleksandr T
5f372d9d7e fix(46606): show completion in jsdoc property tag (#46657) 2021-12-07 15:28:41 -08:00
Oleksandr T
4761ba6285 fix(46998): Hover on as const shows type const = /*unresolved*/ any (#47000) 2021-12-06 14:41:46 -08:00
Andrew Branch
2ce05a8292 Completions sorting overhaul (#46703)
* Sort resolved auto-import completions by number of directory separators

* Sort completions in services layer

* Finish tests

* Fix more tests

* Respect SortText in completions

* Update tests to use `unsorted` assertion
2021-12-03 14:54:51 -08:00
Oleksandr T
407edc95c0 fix(46563): show completions at this type (#46581) 2021-12-03 14:29:45 -08:00
Oleksandr T
c5d9200ec6 feat(46986): offer QF for using await outside of async context (#46994) 2021-12-03 12:36:19 -08:00
LowR
bedc8d4124 fix(46195): handle numeric separators and larger integers correctly in codefix for large integers (#46389)
* fix(46195): handle numeric separators and larger integers correctly

* Use `indexOf()` instead of `includes()`
2021-12-02 16:01:43 -08:00
Andrew Branch
68bf5a519a Fix formatting the end of a selection (#46875)
* Fix formatting edits at end of range

* Adjust test

* Revert API baseline changes
2021-11-29 09:27:21 -08:00
Oleksandr T
6143237376 fix(46366): handle enum string access as enumMemberName (#46431) 2021-11-18 15:50:32 -08:00
Zzzen
de4ba0f208 enable go-to-type-definition on type nodes (#46714)
* enable go-to-type-definition on type nodes

* only go when symbol has no value meaning

* Update formatting of src/services/goToDefinition.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>
2021-11-18 08:55:54 -08:00
Andrew Branch
f11f14baba Fix broken module resolution after large/rapid edits in nodenext (#46818)
* Fix broken module resolution after edits in nodenext

* Move field copying to a better place I guess
2021-11-17 13:04:43 -08:00
Andrew Branch
009dd487a6 Update symlink cache from AutoImportProvider resolution even if host project already contains the file via its realpath (#46830) 2021-11-16 16:39:10 -08:00
Kevin Tan
fcdbc932bf implement code fix for override of js files (#45780)
* feat: code fix for override in js files

Co-Authored-By: Wenlu Wang <kingwenlu@gmail.com>

* fix comments

Co-Authored-By: Wenlu Wang <kingwenlu@gmail.com>

* remove tryMergeJsdocTags

* fix: bring the two methods back as functions

* revert emitter changes

* fix comments

* fix: test failures

Co-authored-by: Wenlu Wang <kingwenlu@gmail.com>
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2021-11-16 08:01:43 -08:00
Armando Aguirre
7b86a65f22 Removed replacement from jsx completions (#46767)
* Removed replacement from jsx completions

* Fixed tests
2021-11-10 18:18:15 -08:00
Oleksandr T
b12d5c5dc5 fix(46605): show completions in object literal parameters (#46743) 2021-11-09 14:50:26 -08:00
Gabriela Araujo Britto
e5a6ae397d Fix extra newline in class member snippet completions (#46737)
* fix extra newline

* fix test
2021-11-09 12:03:07 -08:00
Oleksandr T
a05d851dc3 fix(45907): don't use static member name to inherit JSDocs from instance members (#46274) 2021-11-08 15:05:08 -08:00
Oleksandr T
0a628ff0c9 fix(44059): omit duplicate types (#45739) 2021-11-05 15:36:08 -07:00
Oleksandr T
2d4b243195 fix(33325): allow extract refactoring on selected statement without trailing semicolon (#45765) 2021-11-05 10:00:31 -07:00
Oleksandr T
4fca1e1fcd fix(46666): add outlining spans for comments preceding call expressions (#46682) 2021-11-04 12:43:01 -07:00
Oleksandr T
ff75b8a180 fix(46615): remove useless assertion. change error suggestion for rest params (#46628) 2021-11-03 14:11:39 -07:00
Oleksandr T
7264cf7db5 fix(46589): omit ? in method signature completion for optional methods (#46594) 2021-11-03 12:56:17 -07:00
Oleksandr T
5142e37f2d fix(43292): forbid highlighting multiline template strings (#46531) 2021-11-01 14:21:38 -07:00
Daniel Rosenwasser
6d33d8797b Check for type parameters on original type when getting type argument completions (#46614)
* Add failing test.

* Check for type parameters on the original type when asking for the type argument constraint.

* Update tests/cases/fourslash/stringLiteralTypeCompletionsInTypeArgForNonGeneric1.ts
2021-11-01 11:41:43 -07:00
Gabriela Araujo Britto
6b1e8f7baf remove placeholders in class member snippets (#46598) 2021-10-29 16:55:59 -07:00
Andrew Branch
7742cf2180 Set hasAddedOrRemovedSymlinks when discovering an existing file by its link (#46569)
* Set hasAddedOrRemovedSymlinks when discovering an existing file by its link

* Make it optional
2021-10-29 15:47:48 -07:00
Andrew Branch
eeaa595196 Enable auto imports in member snippet completions (#46592) 2021-10-29 14:43:32 -07:00
Gabriela Araujo Britto
fd620c93f6 Add method signature completions (#46370)
* prototype creation for method override completion snippet

* WIP: start using codefix `addNewNodeForMemberSymbol` to create method decl node

* update type of addNewNodeForMemberSymbol

* add more tests and support more cases

* add more tests and fix some details

* wip: more fixes and tests

* expose check override modifier in checker

* fix test

* WIP: add snippet support

* WIP: snippet support on emitter, adding snippets in completions

* make add snippets work with overloads (not synced)

* fix snippet adding

* rebase

* WIP: try to add snippet escaping in emitter

* support escaping in snippets

* small fixes; fixed tests

* more tests and fixes

* fix new tests

* fix modifier inheritance for overloads

* merge conflict fixes; remove comments

* throw error if setOptions is called but not implemented

* fix newline handling

* fix weird stuff

* fix tests

* fix more tests

* Fix unbound host.getNewLine

* fix isParameterDeclaration changes

* rename diagnostic to status and remove snippets from public api

* rename emitter functions + fix indentation

* check completion kind before calling isclasslikemembercompletion

* fix missing type parameters

* Revert "fix missing type parameters"

This reverts commit 7bdeaa86da.

* add isAmbient flag to addNewNodeForMemberSymbol

* add test for abstract overloads

* refactor snippet escaping support

* add user preference flag for enabling class member snippets

* update API baseline

* update tabstop order

Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
2021-10-28 16:05:36 -07:00
Adam Burgess
61f5ceb832 Fix isNewIdentifierLocation after generator (#46491) 2021-10-24 23:49:31 -07:00
Andrew Branch
907fc72db4 Fix auto import crash on weird JS aliasing (#46490)
* Fix auto import crash on weird JS aliasing

* Comment up the weird test

* Fix setting members on union/intersection type, happens later
2021-10-22 16:09:32 -07:00
Andrew Branch
de1ac8191e Fix isNewIdentifierLocation after async (#46485) 2021-10-22 12:28:04 -07:00
Oleksandr T
bd12ae2454 fix(46466): add missing async keyword before type parameters (#46467) 2021-10-21 15:56:45 -07:00
Andrew Branch
22f37cda85 Fix ordering of module specifiers based on package.json presence (#46437)
* Add failing test

* Fix ordering of module specifiers based on package.json presence
2021-10-21 11:43:57 -07:00
Nathan Shively-Sanders
f2e5947935 @link parses trailing <...> as part of linkName (#46450)
Similar to #46428.

Fixes #44818
2021-10-20 17:01:01 -07:00
Nathan Shively-Sanders
98b4ac2cde @link: format trailing () as part of linkName (#46428)
Parsing separates the identifier part of the link tag from its text, but
the editor should present an identifier followed by `()` as a single
identifier since people use that syntax as a function sigil.

I prefer `#'` personally, you know, xkcd 297, nudge nudge.
2021-10-20 08:36:40 -07:00
Sidharth Vinod
dfb40549fc fix: ES6 Modules => ES Modules in error messages (#46378)
* fix: ES6 Modules => ES Modules in error messages

* chore: Rename test file names

* chore: Rename function names
2021-10-15 14:51:14 -07:00
Andrew Branch
b1f39a705e Fix React auto-import blocking component imports in --preserve (#46368) 2021-10-15 09:31:47 -07:00
Wesley Wigham
2c7b13b830 Fix explainFiles on files under nodenext with types references (#46367)
* Fix explainFiles on files under nodenext with types references

* Fix explainFiles crash on module nodenext
2021-10-14 17:00:55 -07:00
Sidharth Vinod
5185ef55e3 fix(suggestion): Remove 80001 from cjs/cts files. (#46270)
* fix(suggestion): Remove 80001 from cjs/cts files.

* tests: Cover more cases in a single file.

* tests: Cover more cases in a single file.
2021-10-14 09:55:59 -07:00
Andrew Branch
64b8172f06 Auto-imports: fix some exports being incorrectly stored as re-exports of others due to key conflict (#45792)
* Ensure symbol key unique when target is a local symbol exported elsewhere

* Add test

* Support targets without declarations

* Best key yet

* A-ha moment

* Clean up types

* Update API

* Update unit test
2021-10-08 15:20:12 -07:00
Nathan Shively-Sanders
8c270757b2 In plain JS files, only suggestion did-you-mean errors (#46151)
They will have code fixes, and are tuned for high precision. Others are
not.
2021-10-07 08:41:06 -07:00
chenjigeng
d60747f043 Feat/quick fix for types (#42126)
* feat: add quick fix for types

* feat: add test case for quick fix of types

* feat: add did-you-mean error when Cannot_find_name_0 and Cannot_find_namespace_0

* feat: add Cannot_find_namespace_0_Did_you_mean_1 error and only suggest when resolve type

* feat: update baselines

* feat: update baselines

* feat: update baselines

* chore: fix style problem

* Always suggest spelling corrections

* suggest primitives instead of their wrappers

* Add primitives to suggestions

Instead of altering wrappers to look like primitives.

* add semicolons

* revert unneeded change

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2021-10-05 08:14:16 -07:00
Andrew Branch
96f259ddcc Minimal fix for auto-importing node_modules in node12/nodenext (#46148) 2021-09-30 13:42:06 -07:00
Oleksandr T
8a2f5b2a6b fix(45999): show parameter inlay hints before initializer (#46040) 2021-09-29 09:28:23 -07:00