Commit Graph

1023 Commits

Author SHA1 Message Date
Ron Buckton
55eff14353 Fix crash in extract type and generate get/set refactors (#52803) 2023-02-16 16:15:54 -05:00
Oleksandr T
733d7aed97 fix(52749): Assertion failure in derived class completion (#52787) 2023-02-15 14:33:39 -08:00
Andrew Branch
48e812aa07 Prefer top-level type-only imports in verbatimModuleSyntax (#52747) 2023-02-14 10:23:08 -08:00
Andrew Branch
99927cad95 Replace all instances of compilerOptions.isolatedModules with function considering verbatimModuleSyntax (#52746) 2023-02-13 16:03:02 -08:00
Andrew Branch
aa658257c9 Fix completion details auto-imports crashes (#52686) 2023-02-10 15:26:09 -08:00
Oleksandr T
1c822c42a4 feat(52097): "Add missing properties" quick fix for calculated string values ... (#52135) 2023-02-08 17:25:39 -08:00
Jake Bailey
2a8436c529 Use eslint-plugin-simple-import-sort (#52090) 2023-02-02 14:36:21 -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
Sheetal Nandi
d76f3612c1 More removals of long deprecated APIs (#52343) 2023-01-20 15:25:06 -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
Jake Bailey
22b362ceac Enable strictFunctionTypes (#49929) 2023-01-17 17:20:51 -08:00
Ron Buckton
9cdba994ac Remove some properties from Identifier (#52170) 2023-01-12 17:20:12 -05:00
Jake Bailey
f1ff0de943 Use native generators/iterables, remove helper cruft (#51921) 2023-01-06 14:40: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
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
Andrew Branch
e0bfac531b Rename module resolution option node to node10 (preserving backward-compatible alias) (#51901)
* Rename `node` to `node10` (preserving alias)

* Revert dogfooding change because of LKG

* Update baselines
2022-12-15 10:07:33 -08:00
Ron Buckton
2993ea8eaa Monomorphic Symbol access (#51880) 2022-12-15 10:44:24 -05: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
Ron Buckton
6d41964fd0 Reduce polymorphism resulting from unstable Node shapes (#51682)
* Move .symbol to Declaration

* simplify some factories

* Move localSymbol to Declaration

* Ensure JSDocContainer types are properly initialized

* Move contextualType from Node to NodeLinks

* Move 'locals' and 'nextContainer' out of Node

* Move 'flowNode' out of 'Node'

* Pre-define endFlowNode/returnFlowNode

* Pre-define some SourceFile properties and a more stable cloneNode

* Don't add excess properties to type nodes in typeToTypeNode

* Refactor wrapSymbolTrackerToReportForContext to improve perf
2022-12-13 15:11:10 -05: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
Lyu, Wei-Da
0c09d2f172 quick fix for a nullable missing callback function (#51743) 2022-12-05 12:23:59 -08:00
Jake Bailey
00dc0b6674 Flip imports to case insensitive sorting (#51579) 2022-11-17 15:35:28 -08:00
Jake Bailey
2d2a4343b8 Reformat imports to be one identifier per line (#51565) 2022-11-17 13:42:18 -08:00
Jake Bailey
9f64a3a58c Remove ts.{Map,Set,ESMap,Iterator} and associated types (#51439) 2022-11-09 15:06:31 -08:00
Jake Bailey
c65142244c Add dts bundling
This adds a "small" d.ts bundler script. This script is very basic,
using Node printing to produce its output. Generally speaking, this is
inadvisable as it completely disregards name shadowing, globals, etc.
However, in our case, we don't care about the globals, and we can opt to
restructure our codebase in order to avoid conflict, which we largely
had to do anyway when we were namespaces and everything was in scope.
2022-11-07 13:35:48 -08:00
Jake Bailey
d12116d8da Fix all internal JSDoc comments
If these are regular comments, then they won't appear in our d.ts files.
But, now we are relying on an external d.ts bundler to produce our final
merged, so they need to be present in the "input" d.ts files, meaning
they have to be JSDoc comments.

These comments only work today because all of our builds load their TS
files from scratch, so they see the actual source files and their
non-JSDoc comments.

The comments also need to be attached to a declaration, not floating,
otherwise they won't be used by api-extractor, so move them if needed.
2022-11-07 13:34:44 -08:00
Jake Bailey
07758c08ab Generated module conversion step - inlineImports
This step converts as many explicit accesses as possible in favor of direct imports from the modules in which things were declared. This restores the code (as much as possible) back to how it looked originally before the explicitify step, e.g. instead of "ts.Node" and "ts.Symbol", we have just "Node" and "Symbol".
2022-11-07 13:33:07 -08:00
Jake Bailey
b6c0538826 Generated module conversion step - stripNamespaces
This step converts each file into an exported module by hoisting the namespace bodies into the global scope and transferring internal markers down onto declarations as needed.

The namespaces are reconstructed as "barrel"-style modules, which are identical to the old namespace objects in structure. These reconstructed namespaces are then imported in the newly module-ified files, making existing expressions like "ts." valid.
2022-11-07 13:32:03 -08:00
Jake Bailey
9a0b85ce2a Generated module conversion step - explicitify
This step makes all implicit namespace accesses explicit, e.g. "Node" turns into "ts.Node".
2022-11-07 13:29:05 -08:00
Jake Bailey
94724a8c2e Generated module conversion step - unindent
This step makes further commits look clearer by unindenting all of the top level namespaces preemptively.
2022-11-07 13:28:13 -08:00
Oleksandr T
fa4b49d541 fix(51374): ts(80004): Quick fix... > Annotate with type from JSDoc :: object types (#51378)
* fix(51374): transform JSDocTypeLiteral

* add additional tests

* add additional tests
2022-11-07 11:35:08 -08:00
Oleksandr T
2bcfed01f3 feat(37440): Provide a quick-fix for non-exported types (#51038)
* feat(37440): add QF to handle missing exports

* change diagnostic message

* add type modifier only if isolatedModules is set or if the export declaration already uses type modifiers
2022-10-13 15:43:49 -07:00
Oleksandr T
cf1b6b7333 feat(51163): show QF to fill in the missing properties for the mapped type. (#51165) 2022-10-13 11:29:18 -07:00
Jack Works
42f9143e11 feat: codefix for for await of (#50623) 2022-09-29 16:13:25 -07:00
Oleksandr T
7a3de819bf fix(49993): skip the quick fix for an expression with an enum type (#50625) 2022-09-21 16:59:17 -07:00
Oleksandr T
e002159ad1 feat(49962): Disallow comparison against NaN (#50626)
* feat(49962): disallow comparison against NaN

* change diagnostic message

* use global NaN symbol for NaN equality comparisons
2022-09-20 13:16:44 -07:00
Jake Bailey
8e5e2e08ea Fix backticks in our JSDoc comments (#50737) 2022-09-12 13:27:49 -07:00
Ron Buckton
a4cabe725b Support for auto-accessor fields from the Stage 3 Decorators proposal (#49705)
* Support for auto-accessor fields

* Add tests, ensure accessors are initialized in ctor

* classFields cleanup and PR feedback
2022-09-12 15:12:11 -04:00
Oleksandr T
4579245f36 fix(50427): allow convert function expressions (#50430) 2022-08-26 15:43:19 -07:00
Oleksandr T
bb3a7aec11 fix(50415): Language server debug failure - Did not expect GetAccessor to have an Identifier in its trivia (#50470)
* fix(50415): clone props for get/set accessors

* add additional tests

* create helpers to create name, body, modifiers, typeName

* cleanup
2022-08-26 14:33:23 -07:00
Ryan Cavanaugh
3557092b14 Rephrase error message to be 100% technically correct (#50471) 2022-08-26 14:22:49 -07:00
Andrew Branch
38076df346 Fix auto import crash due to difference in paths handling (#50419) 2022-08-25 13:02:48 -07:00
Oleksandr T
12eb519b3f fix(50435): Duplicate seeming Code Actions for convert const to let (#50442)
* fix(50435): omit fix all in constToLet QF

* add FixAll action
2022-08-25 13:01:46 -07:00
Oleksandr T
8d7ad8c3ae fix(50375): Errors for missing enum-named properties should attempt to preserve names (#50382)
* fix(50375): preserve enum-named properties

* add AllowComputedPropertyEnums option

* use bit shifting

* rename AllowComputedPropertyEnum -> WriteComputedProps

* mark WriteComputedProps as internal

* mark symbolToNode as internal
2022-08-24 11:54:44 -07:00