Commit Graph

4431 Commits

Author SHA1 Message Date
Andrew Branch
60edd0685f Reject auto-imports of relative paths through node_modules in bundler resolution (#52536) 2023-01-31 13:02:59 -08:00
Andrew Branch
5e8bf480e4 Fix auto-imports with --moduleResolution bundler and customConditions (#52423) 2023-01-26 09:44:07 -08:00
Oleksandr T
43ecac801b fix(52386): JSDoc code fixes for arrow-function initialized const duplicates comment (#52390) 2023-01-24 23:42:57 -08:00
Oleksandr T
9ee093c094 feat(52366): @prop is not provided as a valid JSDoc tag in autocompletion (#52384) 2023-01-24 02:00:23 -08:00
Jake Bailey
10941888dc Plumb formatting to getDocCommentTemplateAtPosition (#52349)
Fixes https://github.com/microsoft/TypeScript/issues/52348
2023-01-23 15:31:58 -08:00
Ryan Cavanaugh
ff92ab0ac9 Change default newLine, forceConsistentCasingInFileNames (#52298)
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
2023-01-20 17:20:26 -08:00
Oleksandr T
1d81c1dfef fix(51521): Using a of property declared after an initializing constructor triggers an assertion failure in JS (#51524)
Fixes https://github.com/microsoft/TypeScript/issues/51521
2023-01-20 14:43:23 -08:00
Andrew Branch
19d2d9ec01 Don’t let unsorted import groups eagerly derail sort detection (#52332) 2023-01-20 11:10:41 -08:00
Andrew Branch
cfe1842adf Add verbatimModuleSyntax, deprecate importsNotUsedAsValues and preserveValueImports (#52203) 2023-01-19 16:56:30 -08:00
Oleksandr T
6f338b9936 fix(52274): Suggestion code action adds another JSDoc (#52276) 2023-01-19 16:41:26 -08:00
Ron Buckton
5b18979697 Implement the Stage 3 Decorators Proposal (#50820) 2023-01-19 17:54:12 -05:00
Ron Buckton
20182cf848 Organize imports collation (#52115) 2023-01-19 17:53:51 -05:00
Nathan Shively-Sanders
abd6cb446f Improve quickinfo/signature/completions baselines (#52308) 2023-01-19 14:39:14 -08:00
Oleksandr T
8094007a1d fix(52277): switch/case completions fail when has a negative literal type (#52278) 2023-01-17 14:10:29 -08:00
Oleksandr T
9c9d4b029d feat(51086): satisfies support in JSDoc (#51753) 2023-01-17 10:22:22 -08:00
Oleksandr T
577cc1bd8a fix(52233): Ambient modules declared with patterns are offered in path completions (#52246) 2023-01-17 09:41:16 -08:00
Gabriela Araujo Britto
67a3846fbf Fix replacementSpan for class member snippet completion entries (#52231) 2023-01-16 10:32:24 -08:00
Oleksandr T
86ccd20e53 fix(52212): No member completions, and irrelevant value completions, when class property initializer has no semicolon (#52213) 2023-01-13 14:23:36 -08:00
Oleksandr T
6860373c1a fix(52177): Wrong space in type assertions when using array (#52184) 2023-01-11 14:59:22 -08:00
Mateusz Burzyński
3da4886c76 Fixed an issue with quickInfo crashing on a function property returned from generic function (#49049) 2023-01-10 16:05:01 -08:00
Wesley Wigham
89e928e8b4 Add --allowArbitraryExtensions, a flag for allowing arbitrary extensions on import paths (#51435) 2023-01-09 17:12:42 -08:00
Oleksandr T
394a777fdd fix(51963): Invalid property read for find-all-references when exporting non-existent binding (#52006) 2023-01-09 15:29:33 -08:00
Mateusz Burzyński
f326cbfb2e Add a test for optional members completions within an object within an index signature constraint (#52149) 2023-01-09 11:06:07 -08:00
Vitaly
4b69e1342e Basic JSX attribute snippet fixes (#51855)
Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
2023-01-09 09:13:27 -08:00
Oleksandr T
c57fea2a0d fix(52050): The space before satisfies after an array expression is removed when auto-formatting the statements (#52053) 2023-01-05 13:30:11 -08:00
Gabriela Araujo Britto
aae3115838 Call getTypeOfSymbol in getNarrowedTypeOfSymbol to avoid running into circularities when computing types (#51914) 2023-01-05 13:12:56 -08:00
Oleksandr T
44152bc22e fix(29648): Error message related to JSDoc for non-JSDoc syntax error (#50793)
* fix(29648): improve diagnostics of non-JSDoc syntax errors

* fix lint errors

* update tests

* change diagnostic type suggestion. fix QF for jsdoc nullable type

* move error handling from the parser to the checker

* change diagnostic message. remove speculative parsing

* update baseline
2022-12-29 16:50:57 -08:00
Andreas Buob
8b6f8730c1 fix(51223): Go-to-definition for yield and await keyword; jump to respective function definition (#51838) 2022-12-20 13:29:59 -08:00
Oleksandr T
6f4d340458 fix(51716): find all references in imported JSDoc types (#51729) 2022-12-20 13:16:17 -08:00
Mateusz Burzyński
cf68a12d69 Improve string literal completions for property values when a partially-typed string fixes inference to a type parameter (#51770) 2022-12-20 13:08:55 -08:00
Gabriela Araujo Britto
0f5e037e1d pass isSingle quote preference when building string literal (#51968) 2022-12-19 15:39:39 -08:00
Ron Buckton
eb1e257072 Support outlining in multiline import/export decls (#51937) 2022-12-19 15:22:43 -08:00
Josh Goldberg
2484390af8 Added override keyword to codefix implemented abstract methods (#51033)
* Added override keyword to codefixed implemented abstract methods

* Only when noImplicitOverrides is true, and always check abstract modifier

* Added test on abstract/override already being there

* Added back a few test cases

* Check declaration modifier, not class modifier
2022-12-16 11:59:21 -08:00
Oleksandr T
193a8a74c8 skip optional parameters in js files (#51924) 2022-12-16 11:51:41 -08:00
Oleksandr T
645b3ddb06 fix(51920): skip TypeScript types in js files (#51922) 2022-12-16 10:35:35 -08:00
Tomasz Lenarcik
e4816ed44c JSDoc overload tag (#51234)
* Add support for JSDocOverloadTag

* Use overload tag to determine function type

* Update baselines

* Add new tests along with baselines

* Add tests for all @overload tags in one comment

* Add tests for find-all-ref and rename operations

* Add tests for alternative uses of @overload tag

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2022-12-13 15:10:40 -08:00
Andrew Branch
4076ff8fd6 Add option for organize imports case sensitivity (#51733)
* Add ignore case option to organizeImports

* Adopt in auto-imports, use same case-insensitive comparison as eslint

* Fix build/lint

* Mark functions internal

* Update affected auto import test

* Update API baseline

* Update protocol

* Update API baseline

* Short-circuit comparisons that have already failed
2022-12-13 14:37:29 -08:00
Andrew Branch
a5dde88dce --moduleResolution bundler (formerly known as hybrid) (#51669)
* WIP

* Add extension error back unless noEmit is set

* Add non-relative tests

* Add error for importing from declaration file

* Update unit test

* Add explicit flag for importing from .ts extensions

* Add module specifier resolution changes

* Add auto-import tests

* Disallow relative imports into node_modules

* Ensure auto-imports don’t suggest ./node_modules;

* Test a non-portable declaration emit issue

* Test auto-importing TSX file

* Update path completions

* Fix lint due to merge

* Remove minimal-specific stuff

* Remove minimal tests

* Update unit tests

* Add options

* Add customConditions option

* Add first tests

* CJS constructs are not allowed

* Add another test

* Fix extension adding/replacing priority

* Update test to reflect the choice not to block on unrecognized extensions

* Add auto-imports and string completions tests

* Revamp string completions ending preferences

* Comment test

* Auto-imports of declaration files cannot use .ts extension

* Have declaration file auto imports default to extensionless instead

* Add test for custom conditions

* Fix indentation

* Add baseline showing resolvePackageJsonImports/Exports compatibility

* Fix test and prevent CJS require from resolving

* Update unit test baselines

* Fix bad merge conflict resolution

* Make resolvedUsingTsExtension optional

* Update missed baselines

* Revert now-unnecessary API implementation changes

* Clean up

* Update baselines to es5 emit

* Rename to `bundler`
2022-12-13 13:35:16 -08:00
Gabriela Araujo Britto
ad354c2d75 Don't include already-covered cases in switch completions (#51790)
* WIP: filter existing values in case completions

* filter existing enum symbols

* add comment

* fix lint errors

* update baselines

* add comment
2022-12-13 13:01:52 -08:00
Oleksandr T
790c03d7b0 fix(47954): Auto implementation of interface with a constructor prop causes error (#50709)
* fix(47954): convert constructor property to computed name

* handle more nodes with constructor name
2022-12-12 15:28:03 -08:00
Oleksandr T
8f2a38f44b fix(50117): Using @extends in JavaScript + JSDoc removes method documentations (#50256)
* fix(50117): show jsdoc from an inherited members

* show jsdoc from inherited members from class expressions
2022-12-12 15:22:03 -08:00
Oleksandr T
d54f52e0de fix(50089): JSDoc/TSDoc @link with custom display text incorrectly shows vertical bar (#50106)
* fix(50089): omit | from jsdoc linkTag text

* change finding for the end pos of a link
2022-12-12 15:16:29 -08:00
Oleksandr T
355991c806 feat(49323): Render JSDoc @throws {type} as a link (#49891)
* feat(49323): add support throws jsdoc tag

* change "name" to "typeExpression". parse "exception" as a synonym for "throws"

* include typeExpression from the throws tag in the quick info

* add JSDocThrowsTag to ForEachChildNodes
2022-12-12 14:44:38 -08:00
Oleksandr T
1f32fef5a2 fix(51077): skip insertText for jsx attribute with existing initializer (#51093) 2022-12-09 08:38:08 -08:00
George Manning
65bf850a20 Fix #51437 Duplicate "Duplicate identifier" errors (#51594)
* retroactive approach to remove duplicate diagnostics

* use code instead of messageText, update test

* use existing de-dupe function

* rename test and baselines

* add fourslash test for better assertion of fix

* review feedback: move deduplicate to getDiagnosticsHelper

* accept baseline with sorted diagnostics

* remove newline
2022-12-08 19:21:41 -08:00
Oleksandr T
e087992134 feat(47977): show completion in jsdoc extends/implements tags (#51028) 2022-12-08 17:10:00 -08:00
Oleksandr T
8f2ee38b52 fix(50888): Organize Imports may delete preceding comments when all members of all import statements are unused (#50983)
* fix(50888): preserve preceding comments of the deleted import

* update tests
2022-12-08 17:05:12 -08:00
Ryan Cavanaugh
a3dbe7dc70 Update default target from ES3 to ES5 (#51731)
* Change the default emit target to ES5

* Add baseline update

* Remove tests with a hardcoded sourcemap in it

* Update hardcoded tests

* Merge with main

* Restore tests
2022-12-08 16:43:47 -08:00
Andrew Branch
dc3daa6644 Fix namespace import update bug, simplify, comment, and rename (#51797) 2022-12-06 16:38:33 -08:00
Gabriela Araujo Britto
a1536358f7 fix & test (#51792) 2022-12-06 16:18:01 -08:00