* Clean up createMap
* Delete dead createMapFromTemplate
* Clean up assertDefined
* Delete dead assertEachDefined
* Delete dead createUnderscoreEscapedMap
* Delete dead hasEntries
* Delete dead ReadonlyNodeSet, NodeSet, ReadonlyNodeMap, NodeMap
* Use updated SyntaxKind names
* Update API baselines
* CFA for dependent variables destructured from discriminated union
* Accept new baselines
* Add tests
* Limit calls to isSymbolAssigned
* Fix wrong operator
* 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>
* Simplify relationship check for conditional type on target side
* Accept new baselines
* Better support for non-distribution-dependent types
* Accept new API baselines
* Accept new baselines
* Error on mapped types with properties
1. Error on properties of type literals with computed properties whose name is a
binary expression with `in`, because that's a good sign of a mapped
type.
2. Parse following properties on mapped types, and error on them.
3. Stop checking computed property names in (1) to avoid producing
errors based on misinterpreting mapped type syntax as an expression.
* add comment in types.ts
* Update API again
* Check interfaces and classes too
* Add missed check in updateMappedTypeNode
* 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
* 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
* Make getSourceOfProjectReferenceRedirect take a Path
* Add useCaseSensitiveFileNames to ModuleResolutionHost
...so that path comparisons can use it during module resolution.
* Re-enable realpathSync.native for case-insensitive file systems
* 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>
* Fix check in hasNonBindingPatternContextualTypeWithNoGenericTypes
* Add regression tests
* Accept new baselines
* Compute both ObjectFlags.IsGenericXXXType flags in one go
* don't track computed name if symbol has no declaration
* add compiler test
* add non serializable property declaration emit error
* don't track computed name if symbol has no declaration
* fix small stuff
* rebase: add non serializable property declaration emit error
* use symbolToString instead of symbolName
* Enable module specifiers for all auto imports
* Use isIncomplete
* isIncomplete continuation
* Lots of fixes
* Merged/transient symbol fixes, resolve all ambient module specifiers up front, pull as many as we want from cache
* Fix existing tests
* Start testing
* Add more tests
* Set cache attempt limit, update API baseline
* Fix a few tests
* Fix contextToken
* Split getModuleSpecifiers
* Unexport function
* Clean up importFixes
* Clean up completions
* Delete transient symbol assertion - fixing later
* Class static block (#9)
* Add types factory and parser
* Add some case
* Make class static block as a container
* Update cases
* Add visitor
* Add emitter and more compile target
* Check boundary of break and continue
* Add basic transformer
* Fix emit behavior
* Add more tests
* Add friend tests
* Update baseline
* Fix cr issues
* Accept baseline
* Add decorator and modifier check
* Add functional boundary check
* Fix conflict
* Fix computed prop name within context
* Add more tests
* Update baseline
* Avoid invalid test baseline
* Support use before initialize check
* wip
* Fix class static block context
* Fix checks
* Fix missing case
* Improve assert message
* Accept baseline
* Avoid new context
* Update diagnostic message
* Fix name collision
* Fix targets
* Avoid unnecessary files
* Add more case
* Add more test cases
* Fix strict mode function declaration
* Avoid private fields initializer if no private identifier references
* Avoid private fields and add more test case
* Add more case
* Add tests and support for related services functionality
* Fix this reference in static block
* Split parser diagnostic and binder diagnostic
Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>
* Add signature arguments label support
* Support rest parameters and destruction
* make lint
* Fix tuple rest parameters
* Adjust name styles
* Rename to inline hints
* Partition inline hints
* Adjust range pred
* Add function expression like hints
* Support configure inline hints
* Display hints in single line
* Add test suits and tests
* Add range tests
* Support more hints
* Add more options
* Fix logical
* Add more cases
* Support call chains
* Rename options
* Match lastest protocol
* Update protocol changes
* Support context value and hover message
* Revert "Support context value and hover message"
This reverts commit 37a7089633.
* Revert "Update protocol changes"
This reverts commit e5ca31bc30.
* Add hover message
* Accept baseline
* Update src/services/inlineHints.ts
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
* Update src/services/inlineHints.ts
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
* Cache across the program
* Fix possible undefined
* Update protocol changes
* Fix missing property
* Make lint happy
* Avoid call chain hints
* I'm bad
* Add whitespace before type
* Add more tests
* Should care about jsdoc
* Support complex rest parameter
* Avoid module symbol hints
* Care about leading comments
* Fix CR issues
* Avoid changes
* Simplify comments contains
* Fix CR issues
* Accept baseline
* Check parameter name before create regex
* Rename option
* Avoid makers
* Skip parens for argument
* Fix CR issues
* Fix enums
* Accept baseline
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
* Switch index signature storage to 'indexInfos: IndexInfo[]' property
* Accept new baselines
* Remove another usage of IndexKind enum
* Update getIndexedAccessType and resolveMappedTypeMembers
* Accept new baselines
* Update grammar checking for index signatures
* Accept new baselines
* Consider all index signatures in mapped types and union types
* Accept new baselines
* Update getIndexType
* Accept new baselines
* Intersect multiple applicable index signatures
* Use getApplicableIndexInfo instead of hardwired string/number handling
* Update index signature relationship checking
* Report type for which index signature is missing
* Report type for which index signature is missing
* Accept new baselines
* Make 'number' index signatures consistently apply to numeric strings
* Accept new baselines
* Update fourslash test
* Revise index constraint checking
* Accept new baselines
* Update error messages
* Accept new baselines
* Update type inference from index signatures
* Update isKnownProperty
* Update contextual typing based on index signatures
* Accept new baselines
* Support union types in index signature declarations
* Accept new baselines
* Check duplicate index signatures / remove redundant template literals from unions with string
* Accept new baselines
* Include key type in diagnostic / check symbol-named properties
* Accept new baselines
* Minor fix
* Add tests
* Accept new baselines
* Add optimized findApplicableIndexInfoForName
* Accept new baselines
* Another place we don't need to obtain literal type for property name
* Accept new baselines
* Don't create literal types that are going to be discarded
* Individual maps for string, number, bigint, and enum literal types
* Remove ineffective optimizations
* Accept new baselines
* Permit intersections as key types in index signatures
* Index expression in element access is template literal context
* Add tests
* Accept new baselines
* Symbol index signatures from object literals with computed symbol properties
* Accept new baselines
* Add more tests
* Accept new baselines
* Implement Go To Definition for all applicable index signatures
* Add fourslash test
* Accept new API baselines