* 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>
* Track source and target relationship stack depth seperately, only increase on change in value
* Add baselines for test from #43485
* Bail on unwrapping conditional constraints on the source side when the source conditional is already known to be spooling out of control
* More usage of isDeeplyNestedType to block _specifically_ conditional recursion on only one side
* Negative cases of getNarrowedType that match the exact type should be filtered out, even when generic
* Add test and fix for #44404
* Swap to manually specifying left and right recursion
* Rename Left -> Source, Right -> Target
Co-authored-by: Andrew Branch <andrew@wheream.io>
* Loosen check in getIndexTypeForMappedType to directly map property names when any indexy type is present
* Handle homomorphic mappings better in keyof, add specific relationship rule for relating generic keyof MappedType to handle remapped keys
* Remove trailing whitespace
* Parse type-only import specifiers
* Add type-only export specifiers
* Update transform and emit
* Update checking
* Fix elision when combined with importsNotUsedAsValues=preserve
* Accept baselines
* Add test
* WIP auto imports updates
* First auto-imports test working
* More auto-import tests
* Fix auto imports of type-only exports
* Add test for promoting type-only import
* Sort import/export specifiers by type-onlyness
* Update completions for `import { type |`
* Update other completions tests
* Respect organize imports sorting when promoting type-only to regular while adding a specifier
* Fix comment mistakes
* Update src/services/codefixes/importFixes.ts
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
* Rearrange some order of assignments in parser
* Split huge if statement
* Remove redundant check
* Update new transformer
* Fix import statement completions
* Fix type keyword completions good grief
* Fix last tests
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
* Initial support for module: node12
* Add allowJs and declaration emit enabled tests
* Fix typos
* cts, mts, cjs, mjs, etc extension support
* Fix watch of files whose intepretation changes due to a package.json update
* Minor PR feedback
* Adjust error message
* Initial import/export/self-name support
* Accept new error codes
* TypesVersions support in export/import map conditions
* Fix import suggestion and autoimport default extensions under new resolution modes
* Add tests for import maps non-relative name lookup feature
* Fix isDeclarationFileName for .d.mts and .d.cts
* Preserve new extensions when generating module specifiers
* Fix spurious implict any suggestion caused by file ordering bug and optimize import name format detection by relying on parents being set
* Fix a bunch of incremental bugs that dont repro under fourslash for some reason
* Accept updated baseline
* Always include extensions on completions for cjs/mjs style imports
* String completion relative import suggestions respect the mode of the import when choosing if they provide extensions
* Style feedback
* Change diagnostic case
* Revert "Stop looking at binding patterns for type argument inference (#45719)"
This reverts commit be618b1446.
* Update error baseline for moved lib file declaration
* fix: add override errors for js class members
* fix: test failures of js override error message
* update diagnostic messages
* fix: test errors
* fix: lint errors
* Adds 'Awaited' type alias and updates to Promise.all/race/allSettled/any
* Use Awaited<T> with 'await'
* Clean up overloads
* Further restrict 'Awaited<T>' auto-wrapping for 'await'
* Minor fixes to convertToAsync
* Back out on nested return in inner continuation
* Baseline update
* Verify type argument for call can be used, add a few more early exit shortcuts
* fix for 45006
* treat setters like getters in preceding commit; move test accordingly
* fix test baselines
* changes per code review
in `getContainerFlags`, move cases for get/set accessors
to fallthrough into the block that currently handles MethodDeclaration;
so get/set accessors and method declarations all get the same container flags,
such that during `bindContainer`, `startFlow.node` is assigned to
getters/accessors
(this changes a public api in tsserverlibrary.d.ts and typescript.d.ts
by adding `GetAccessorDeclaration` and `SetAccessorDeclaration` to the type
of `FlowStart.node`)
consolidate predicates checking whether a node is either a get or set
accessor, into `isObjectLiteralOrClassExpressionMethodOrAccessor`
(formerly `isObjectLiteralOrClassExpressionMethod`)
annotate updated test with `@target: es2020`
* fix `isObjectLiteralOrClassExpressionMethodOrAccessor`
require that Getter/Setters are parented by an ObjectLiteralExpression or ClassExpression
* Simple first version
Doesn't cover or test any complicated variations.
* Lots of cases work
Destructuring does not. But
- skipping node_modules and lib.* does.
- call expressions does
- property access, including with private identifiers, does
* Support variable declarations, property assignments, destructuring
As long as it's not nested
* More cleanup
* skip all d.ts, not just node_modules/lib
* Offer a codefix for a lot more cases
* remove incorrect tuple check
* Use getSymbolId instead of converting to string
Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
* add test + switch to tracking number symbol ids
* Address PR comments
* Exclude tuples from suggestion
* Better way to get error node
Plus add a check that errorNode is an argument to the call, not the
call's expression.
* fix semicolon lint
* fix another crash
* Simplify: add undefined to all optional propertie
whether or not somebody tried to assign undefined to them in the
erroneous assignment
* remove fix-all
Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>