* Add cache invalidation for node_modules, config, and preferences changes
* Share watches with closed script info
* Update API baseline
* Small adjustments for fewer object allocations
* Document overloaded return value
* Update baselines
* Store isAutoImportable separately from modulePaths
* Add back missing return
* Return wrapped watcher instead of underlying one
* Make user preferences part of the cache key instead of implicitly clearing in editor services
* Fix missed merge conflict
* Fix discovery of more pnpm symlinks
* Add some tests
* Never show pnpm paths in auto imports, even if there’s no other path
* Import statement completions can return none
* Fix tests
* Add failing test showing poor symlink cache reuse
* Fix test, fails for right reasons now
* Preserve cache built up during program creation, then fill in with program resolutions
* Remove obsolete comment
* Remove obsolete type assertion
* Revert fully filtering out ignored paths
* Add test case for 'useUnknownInCatchVariables'.
* Add new 'useUnknownInCatchVariables' flag.
* Accepted baselines.
* Add test for catch variable explicitly typed as 'any'.
* Accepted baselines.
* Move option under 'strict'.
* Accepted baselines.
* 'useUnknownInCatchVariables' is strict in command line help.
* Cache parsed path mapping patterns
If a project has many of them (e.g. 1800), parsing the patterns
repeatedly can take up a lot of time.
* Move cache to ConfigFileSpecs
* Inline constants
* Simplify cache access
* Add @linkcode and @linkplain tags
They are just like @link tags but request fixed-width and normal
presentation, respectively.
Fixes#43935
* revert JSDocComment -> JSDoc SyntaxKind rename
* update API baselines
* fix lint
* Everything mostly works
A couple of mixed, nested references don't work yet.
The scanner+parser interaction is wrong, the parser consumes one too
many spaces, and the checker+services code needs a little cleanup.
* Cleanup
1. I decided that correctly parsing a#b.c, an entity name containing an
instance reference, is not worth the work.
2. I made the scanner, at least the jsdoc part, emit a # token, and
provided a reScanPrivateIdentifier in order to convert #a to # a.
3. I cleaned up the code in the checker.
2. Unrelated: I added a missing space in linkPart display.
* Cleanup lint + var naming
* investigate+clean up a couple of TODOs
* Fix lint in utilities.ts
* change name to JSDocMemberName
* address PR comments
* Cache accessibe symbol chains, type parameter name generation
* Move signature declaration helper length approximation to start of function
* Add node result caching internal to `typeToTypeNodeHelper`
* Suggestion from PR
* Fix package.json auto imports for pnpm without project references
* Make property optional
* Revert unnecessary unnittest change
* Set symlinked files when setting symlinked directories
* Update `typeDirectiveIsEqualTo`
* Consider symlinks found during type reference directive resolution into `discoverProbableSymlinks`
* Rename `originalFileName` to `originalPath`, make internal
* Allow `override` as parameter property
* Update other baseline
* Add test for override on normal parameter
* Copy typo fix
* Update baselines
* Update API baseline
* Relate non-augmenting array subtypes without resorting to structural comparison
* Fix lint
* Generalize performance enhancement
* Cache results, feed through via getNormalizedType to remove error intermediates
* Use newly freed up object flags to limit member setting, fix crash with those object flags
* Move flags because there is no TypeFlags.Reference 🤦
* Completion list for type literals in type arguments
* Add tests
* Refactor for better readability
* - Support non-identifier keys
- Move main logic onto tryGetGlobalSymbols function
* Add jsdoc to if statements
This should only happen in JS files, however, and there needs to be some
conditional handling of jsdoc on statements that can't have jsdoc in TS
files.
* Finish change
* Add test
* Specified diagnostic for CLI flags missing a required --build
* Switched to an alternateMode member
* Added --build-incompatible flags too
* Small fixups to remove a hardcoding
* Switched to ||= factories
* Not a function
* I think I get it now
* Allow redeclaring CommonJS alias with initial undefined
This allows us to read our own output, plus the times when people
manually write exactly the same pattern.
Fixes#40555
* Use control flow to type commonjs exports
1. Could probably use a *lot* more tests.
2. getTypeOfAlias redoes some work from resolveAlias because it needs to
not resolve the alias completely, just to its export.
* fix lint, improve jsdoc
* Add tests, improve+fix control flow
1. Update the module.exports test to match the exports ones.
2. Add a test of evolving commonjs type.
3. Add a test of assignment as last statement.
(1) exposed a bug that required a better synthetic reference. (3)
exposed a bug that was most easily fixed by giving source files a
`endFlowNode` like functions and setting it in the binder.
* fix lint
* WIP
* WIP
* Get completion details working
* Start unifying eager and lazy auto imports
* Fix export=
* Fix completion details for totally misspelled names
* Almost fixed duplication...
* Fix remaining completion tests
* Refactor to support multiple origins for same symbol
* Make import fixes make slightly more sense
* Add cache back in
* Set insertText based on import kind
* Update API baselines
* Add semicolons, snippet support, and sourceDisplay
* Add some tests
* Update baselines
* Fix pattern ambient modules appearing in auto imports
* Fix tests
* Remove commented code
* Switch to valueDeclaration for getting module source file
* Small optimizations
* Cache module specifiers / importableness and export map separately
* Fix and test cache invalidation logic
* Update API baselines
* Add separate user preference for snippet-formatted completions
* Require first character to match when resolving module specifiers
* Fix AutoImportProvider export map cache invalidation
* Really fix auto import provider export map invalidation
* Update test added in master
* Use logical or assignment
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
* Simply conditional by reversing
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
* When file is deleted need to marked correctly in the project as removed file
* Simplify hasAddedOrRemovedSymlinks with cherry-picked fix
* Ensure replacement range is on one line
* Update baselines
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
* Test for not watchiong referenced projects fileNames and invalidating it
* Add watching wild card directories and caching parsed command line for projects so that its shared
* Handle config file watching and commandline cache together
* Watch extended files for commndline cache instead of project
* Use extended config cache now that we are watching extended config files
* Structure for getParsedCommandLine from the LS
* Adding some more skeleton with todos
* getParsedCommandLine on WatchCompilerHost
* Tests for Watch, LS scenarios
* Handle getParsedCommandLine so we are looking at all things for referenced
* Cleanup and commenting
* Test for transitive references with tsc-watch
* Cache parsed command line even if host implements getParsedCommandLine
* Cleanup
* Cleanup
* Some tests to verify exclude from referenced project doesnt trigger the update
* Baseline when program is same
* Test for incremental scenario
* Tests for output from referenced project
* Comments
* Added support for private identifier methods.
* Added tests for private methods.
* Added check to only not allow private name method signatures in anything except classes.
Changes objects literal checking to not bail on first private name found in object literal.
* Added private accessors tests
* Transform private methods
Signed-off-by: Kubilay Kahveci <kahvecikubilay@gmail.com>
* Rename shouldTransformPrivateFields
Signed-off-by: Kubilay Kahveci <kahvecikubilay@gmail.com>
* Accept baseline
Signed-off-by: Kubilay Kahveci <kahvecikubilay@gmail.com>
* Use a single WeakSet for brand-check
Signed-off-by: Kubilay Kahveci <kahvecikubilay@gmail.com>
* Accept baseline
Signed-off-by: Kubilay Kahveci <kahvecikubilay@gmail.com>
* Add a test for using private methods in static field initializers
Signed-off-by: Kubilay Kahveci <kahvecikubilay@gmail.com>
* Add breaking checker test
Private methods inside class expressions should not error.
Signed-off-by: Kubilay Kahveci <kahvecikubilay@gmail.com>
* Add to instances once per-instance
Signed-off-by: Kubilay Kahveci <kahvecikubilay@gmail.com>
* Accept baseline
Signed-off-by: Kubilay Kahveci <kahvecikubilay@gmail.com>
* fix: evaluate receiver and rhs expressions before throwing on readonly assignment
Signed-off-by: Kubilay Kahveci <kahvecikubilay@gmail.com>
* Add a test for evaluating rhs before readonly assignment
Signed-off-by: Kubilay Kahveci <kahvecikubilay@gmail.com>
* Transpile private accessors
Signed-off-by: Kubilay Kahveci <kahvecikubilay@gmail.com>
* Accept baseline
Signed-off-by: Kubilay Kahveci <kahvecikubilay@gmail.com>
* fix: handle readonly/writeonly accessors
Signed-off-by: Kubilay Kahveci <kahvecikubilay@gmail.com>
* accept baseline
Signed-off-by: Kubilay Kahveci <kahvecikubilay@gmail.com>
* add a test for private setter without a getter
Signed-off-by: Kubilay Kahveci <kahvecikubilay@gmail.com>
* fix: getAllUnscopedEmitHelpers
Signed-off-by: Kubilay Kahveci <kahvecikubilay@gmail.com>
* fix: better handling of duplicate names
Signed-off-by: Kubilay Kahveci <kahvecikubilay@gmail.com>
* Fixed wrong error message for private methods in class expressions.
* change error message
Signed-off-by: Kubilay Kahveci <kahvecikubilay@gmail.com>
* add a test for async private methods with a higher target
Signed-off-by: Kubilay Kahveci <kahvecikubilay@gmail.com>
* fix: setter assignment returns rhs value
Signed-off-by: Kubilay Kahveci <kahvecikubilay@gmail.com>
* add a test for setter assignment return value
Signed-off-by: Kubilay Kahveci <kahvecikubilay@gmail.com>
* fix: handle duplicate accessors
Signed-off-by: Kubilay Kahveci <kahvecikubilay@gmail.com>
* add tests for duplicate accessors
Signed-off-by: Kubilay Kahveci <kahvecikubilay@gmail.com>
* docs: add missing parameter docs
Signed-off-by: Kubilay Kahveci <kahvecikubilay@gmail.com>
* Fixed failing test.
* baseline-accept: ordering changes
Signed-off-by: Kubilay Kahveci <kahvecikubilay@gmail.com>
* fix: attach weakSetName to property declaration
Signed-off-by: Kubilay Kahveci <kahvecikubilay@gmail.com>
* add a test for nested private methods
Signed-off-by: Kubilay Kahveci <kahvecikubilay@gmail.com>
* add a test with any
Signed-off-by: Kubilay Kahveci <kahvecikubilay@gmail.com>
* Added support for static private fields accessors and methods.
* Added error message for private identifiers used with static decorators. There is no spec to go with this behavior as of yet.
* Fixed emit static bug that used private names outside of classes for initialization in esnext. Fixed issue where nested privates produce incorrect brand check.
* Added tests for private static fields methods and accessors.
* Fixed error messages and tests after merge.
* Accept new baseline.
* Improved duplicate identifier checks for static private class elements.
* Added error when using initializers with private static fields when useDefineForClassFields is not specified and target is esnext.
* Fixed code review issues.
* Removed semantically wrong emit on `useDefineForClassFields:true` with `target:esnext`
* Changed emit for uninitialized private static fields.
* Added runtime error in helper if a static private field is accessed before it was declared.
* Fixed code review comments for private identifier static class elements.
* add debug.assertNever for unknown node type (#53)
* Fixed code review issues.
* Fixed code review issues for private class elements.
* Fixes class shadowing when checking access to a private static class element.
* fix private methods/accessors in class expr inside a loop
* collapse switch case
* fix class name
* simplify getPrivateMethodsAndAccessors
* remove findPreviousAccessorInfo
* lazily create weakSetName identifier
* do not allocate a node if not needed in visitMehodDeclaration (#55)
* Removed all the emit helpers for private identifier methods accessors and modified the existing helpers for get and set fields to do the same job.
* Simplified emit for private identifier class elements.
* do not clone the receiver (#57)
* leave bad code in for #constructor and duplicate private names (#58)
* Added check for WeakSet collision.
* Added error for using a set only accessor.
* update keyof tests and ?? (#62)
* replace ?? with ||
* update keyof tests
* fix emit helpers comments
* produce an error if private field helpers are not up to date
* add tests
* fix setter-only compound assignment
* fix tests
* fix duplicated trailing comments (#64)
* clear receiver pos and setTextRange on helper calls
Co-authored-by: Kubilay Kahveci <kahvecikubilay@gmail.com>
* Extra tests in preparation for lazy signature making sure the original intent of test is maintained
* Whenver we cant use state delay signature calculation and use source file version as signature
* Incremental correctness checks
* Retain old behavior in compile on save by disabling use of file version as signature in when state is not reused
* Revert "Revert "Editor support for link tag (#41877)" (#43302)"
This reverts commit 451d4354b9.
* Fix parsing @link at end of comment
* Parse comments as string when no @link occurs
* fix lint
* Initial scribbles
* Compiles but provides spans instead of location pairs
Probably need to fork the services/server types and provide a conversion
with Session.toFileSpan. Not sure where to put the conversion.
* Switch to DocumentSpan
In theory this is already better supported, but not sure practise bears
that out.
* Builds w/protocol types + conversions
* cleanup:better names and scrub TODOs
* fix test harness too
* Misc
1. Simplify protocol after talking to @mjbvz.
2. Add more tests.
3. Initial notes about where to add parsing.
* Parse and store links in the compiler
The text of the link is still stored in the comment text, but that's now
kept in an object instead of just a string. Each link has the parse for
the entity reference, if there is one.
Needs lots more tests -- this just makes all the existing jsdoc tests
pass.
* more tests and some fixes
* Fix other failing tests
* fix bad merge
* polish parser
* improve names and array types
* slight tweaks
* remove some done TODOs
* more tests + resulting fixes
* add+fix cross-module tests
* Support `@see {@link`
Plus find-all-refs support equivalent to @see's.
* add server test
* Make comments actually part of the AST
* Add span for link.name in language service/protocol
* Make checker optional in getJSDocTags
Also change to JSDocCommentText from JSDocCommentComment
* Use getTokenValue instead of getTokenText
Measure twice, slice once
* Add missing support for top-level links
The language service and protocol were missing support for top-level
links. This commit adds that plumbing.
* add string back to comment type in node constructors
* Full parse of link tags and jsdoc comment text
- Doesn't pass fourslash yet, I'm going to switch to baselines for
failures there.
- Still needs some work on the protocol to convert file+offset to
file+line+offset.
* fix lint
* Fix missing newlines in inferFromUsage codefix
* Parse jsdoc comments as text node/link array
And switch to line+character offsets in the protocol
* Fix fourslash tests
Mostly ones that can't be baselined, but I switched a couple more over
to baselines
* Improve types and documentation
* Test+fix @link emit, scrub other TODOs
* update API baselines
* test that goto-def works with @link
* Split link displaypart into 3
One for link prefix and suffix, one for link name, and one for link
text.
* update baselines
* Provide JSDocTagInfo.text: string to full clients by default
Instead of upgrading them to displayparts.
* Real server tests
* Disambiguate {@link} and @param x {type}
They are ambiguous; previously the parser preferred the type
interpretation, but will now look ahead and parse links instead when the
prefix is `{@link`.
* Add explanatory comment in test
* fix location in richResponse in protocol
* update API baseline
* Address PR comments
1. Add a cross-file goto-def test.
2. Switch from per-message args to UserPreference.
* use arraysEqual from core
* Fix property name bindings for class expr in loops
* Fix block-scope capturing with prop initializers
Co-authored-by: Joey Watts <joey.watts.96@gmail.com>
* About halfway through the checker
I'm going to merge with master to avoid clashing with the declaration
fix.
* Add undefined to Symbol.valueDeclaration
Also add undefined to a number of utility functions that have always
accepted it, but never added it to their type.
* Fix lint from code review
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
* remove obsoleted fix from inferFromUsage
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
* Add undefined to Symbol.declarations' type
Symbol.declarations now has type `Declaration[] | undefined`.
I made a mistake somewhere in the checker related to JS checking, so
there are quite a few test failures right now.
* undo clever change to getDeclaringConstructor
* Address PR comments
1. More early-returns.
2. More line breaks.
* Add 'data' property to completion entry for better cooperation between completions and completion details
* Add doc comment
* Update API baselines
* Add server test
* Test session’s Full result
* Fix tests
* stableSort to fix server fourslash test
* Explicit verification of data parameter
* No array literal subtype reduction when contextual type is present
* Accept new baselines
* Fast path in relations and filtering of pure discriminated union types
* Create maps for mixed unions, but not for small or primitive only unions
* Create many-to-many mapping with certain limits, also use in CFA
* Use constituent maps in CFA for switch statements, cleanup, add comments
* Revert change to apparent contextual type / better criteria for map eligibility
* Deduplicate array literal element types
* Accept new baselines
* Filter in false case only when discriminant property has unit type
* Only subtype reduce unions with less than 100 distinct types
* Accept new baselines
* Caching and quick discriminant checks in subtype reduction
* Accept new baselines
* Remove deduplication logic now that subtype reduction was optimized
* Refactor emit substitution into transform
* Add reusable state machine for binary expressions
* Allow emitBinary to use state machine for comments/sourcemaps
* Switch core trampoline state back to arrays
* Switch binder to parallel stacks, temporarily partially revert emitBinary
* Add link to benchmark when posting perf results
* Ensure work stacks are per-execution
* Reenable comments and sourcemaps
* Eliminate well-known symbols in the checker: 2021 edition
* Actually update the lib text to say unique symbol, too (this is unneeded with compat code in place, but this makes goto-def make more sense)
* Add test showing mismatched symbol constructor type interop
* Add more test cases for some other related issues this fixes
* Revert computed name change
* Style comments
* When noImplicitAny is set, combine multiple contextual overloads into a single signature, rather than producing `any` and an error
* Amalgamate intersection composite signature return types as intersections, rather than the prior exclusively union behavior
* Add another example from an issue, albeit slightly modified
* Fix newlines, add test from DT
* Interior remodelling
* Change variable name AllowQualifedNameInPlaceOfIdentifier to AllowQualifiedNameInPlaceOfIdentifier
* Change deleting AllowQualifedNameInPlaceOfIdentifier to deprecating it instead.
* Fix failing tests
* Replace old value
* New aliases for type alias instantiations
* New aliases for conditional, mapped, and anonymous object type instantiations
* Accept new baselines
* Fix issues with re-aliasing
* Accept new baselines
* Create separate types for equivalent aliased unions
* Accept new baselines
* Preserve original types for union types
* Accept new baselines
* Preserve intersection origin for union types
* Accept new baselines
* Accept new baselines
* Preserve aliases during relationship checks
* Accept new baselines
* Preserve aliases for intersection and indexed access types
* Accept new baselines
* Compute intersection-of-unions cross product without recursion
* Accept new baselines
* Use denormalized type objects for origin / support 'keyof' origins
* Accept new baselines
* Fix fourslash test
* Recursively extract named union types
* Accept new baselines
* Map on union origin in mapType to better preserve aliases and origins
* Remove redundant call
* Accept new baselines
* Revert back to declared type when branches produce equivalent union
* Accept new baselines
* Don't include denormal origin types in regular type statistics
* Fix issue with unions not being marked primitive-only
* Allow new alias to be associated with type alias instantiation
* Accept new baselines
* Revert "Accept new baselines"
This reverts commit 4507270cc1.
* Revert "Allow new alias to be associated with type alias instantiation"
This reverts commit 2c2d06dfe1.
* Test case where the wrong path is emitted
* If import is used in the file, prefer that import specifier over calculating new one
Fixes#39117
* Update Baselines and/or Applied Lint Fixes
* When non-relative path is used as user preference, ignore relative paths even if they are from the existing file
* Fix test
* Add comment
Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
* Add support for abstract constructor types
* Add backwards-compatible overloads for creating/updating constructor types
* Reverting use of 'abstract' in lib/es5.d.ts due to eslint issues
* Update baseline due to reverting lib
* Add error for failing to mark an mixin class as abstract
* Fix declaration/quick info for abstract construct signatures
* Support starting and middle rest elements in tuples
* Accept new baselines
* Include all rest arguments in error span
* Accept new baselines
* Fix tests
* Add new tests
* Fix lint errors
* Infer template literal types for template literal expressions
* Update test
* Update another test
* Accept new baselines
* Minor fixes
* Add tests
* Accept new baselines
* Make new TypeFlags internal
* Accept new API baselines
* Ensure template literals assignable to String, Object, {}, etc.
* Add tests
* --explainFiles currently hardcoded
* Move configFileSpecs to configFile so it can be used in program later
* Explain root file inclusion reason and explain include files in the log
* Baseline explainFiles
* Fix incorrectly reporting of file list two times in --b mode
* Fix unnecessary new lines in output represented incorretly in the baseline
* More tests
* More cleaning up
* Keep listing files in same order as list files, just add explaination
* Fix double listing of file names when the program has errors
* Make diagnostic chains for file include reason
* Add explaination for the file include to diagnostics for program
* Harness ls incorrectly adding tsconfig as the root file
* Fix incorrect use of path for calculating absolute path
* Fix the root file in fourslash
* Test project service options merge
* Add config file name to matched by include explaination
* Add test for when the file changes and program is reused completely but related file information is reattached to correct location
* Handle file preprocessing diagnostics updates when program is reused and related information location changes
* Moved types to types.ts
* Refactoring and cleanup
* More cleanup
* More refatoring
* Handle synthetic imports
* Baselines after merge
* Allow type-only ImportEqualsDeclarations
* Suppress CJS-in-ESM error when type-only
* Add grammar error on import type in import alias
* Update API baselines
* Fix importsNotUsedAsValues with ImportEqualsDeclarations
* Make bad error talk words more good for Daniel. Fixes#41603
* One more error message baseline update
* Update transformer and emitter
* Parse excludeDirectories and excludeFiles
* Use watch factory in typings installer
* Some refactoring for watchFactory
* Create Noop watcher if file or directory being watched is excluded
* Baselines without using exclude watch options
* Baselines including exclude option
* Handle exclude options in the system watches
* Add test without exclude option for recursive directory watching
* Test baselines with exclude option
* Always set sysLog
* Test for exclude option in server
* Add exclude options in the config file and fix the test
* Fix host configuration for server
* Handle host configuration for watch options
* Fix sysLog time log so baselines can be clean
* Handle reloadProjects to reload the project from scratch
* Ensure that file updates are reflected
* Feedback
* Feedback
* Add tests
* Dont look at object or function type when looking for members of `export=` type to be resolved by named imports
Fixes#37165
* Create separate cache when skipping function and object property augmentation
* Lookup in both cache if not skipObjectFunctionPropertyAugment
* Don't record Ternary.Maybe results in cache during recursive variance measurement
* Add regression test
* Accept new baselines
* Use Ternary.Unknown to signal variance recursion
* Add comments
* Fix comment
* Some refactoring of forEachResolvedProjectReference
* More refactoring
* Test before the change
* When loading project tree, load projects that directly or indirectly reference the projects we are looking for
* Optimize finding project in solution scenario by directly finding possible default project through projectReferenceRedirect
This helps in avoiding loading indirect projects when solution indirectly referenced default project
* Move anonymous type instantiation cache from AST node to root type
* Use "root" type reference as cache location for deferred type references
* Add test
Co-authored-by: Andrew Branch <andrew@wheream.io>
* Add test that fails
* Handle noEmit on semantic builder's emit as well
* Add test for tsbuildinfo text verification
* Fix noEmit handling for tsbuildinfo emit with SemanticDiagnosticBuilder
* Add test for noEmitOnError with SemanticDiagnosticsBuilder
* Fix tsbuildinfo emit with SemanticDiagnosticsBuilder on noEmitOnError
* Update src/compiler/builder.ts
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* Update src/compiler/builder.ts
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* Fix noUncheckedIndexedAccess for tuple rest elements
* Defer inclusion of undefined for generic indexed access types
* Create separate IndexedAccessTypes depending on whether --noUncheckedIndexedAccess applies
* Undo accidental export
* Parenthesize for clearer precedence
* Fix default-property-assignment decls+prototype property decls
The check in getAssignedClassSymbol forgot to allow for default-property
assignment declarations, in part because it wasn't using a utility
function to do so.
* small cleanup
* make allowDeclaration parameter required
* Allow pattern literal types like `http://${string}` to exist and be reasoned about
* Allow bigint, number, null, and undefined in template holes
* Add test of the trivia case
* Handle `any` in template holes, add assignability rules for template -> template relations
* Explicitly test concatenated patterns
* PR Feedback
* Merge identical object types when discriminating contextual types
Co-authored-by: Orta <ortam@microsoft.com>
* Allow identical discriminants when discriminating, rather than trying to unify identical union members
* Fix lint
Co-authored-by: Orta <ortam@microsoft.com>
* Initial implementation + tests
* linty
* Support destructuring declarations and assignments
* lint
* Fix destructuring assignment and element access into known properties
* Update baselines
* Rename flag to unUncheckedIndexedAccess
* Add test for unique symbol indexing
* Fix flag order in baselines
Co-authored-by: Andrew Branch <andrew@wheream.io>
* Adds support for declaring the bundled name of a dts module export
Co-authored-by: Wesley Wigham <wwigham@gmail.com>
* Adds baselines
* Update the tests
* Try to reduce the scope of the bundledPackageName error
* Use the flag in more baselines
* Get it green
* More tests
* Handle more feedback
* More test cleanup
* Set the moduleResolution for the tsconfigs
Co-authored-by: Wesley Wigham <wwigham@gmail.com>
* Alias for `module.exports.x = x`
This fixes#40155 in a surprisingly small amount of code.
* Treat any aliasable expression as an alias
* test internal references to exported class
* Initial implementation of string template types
* Accept new API baselines
* Accept new baselines
* Unified checking for large cross product union types
* Accept new baselines
* Ensure errors from union type resolution are reported
* Accept new baselines
* Compute constraints for string template types
* Support `as T` clause in mapped types
* Accept new API baselines
* Add missing semicolon
* Add checking of `as T` clauses
* Support casing modifiers in string template types
* Accept new baselines
* Bump keyword maximum length
* fix anders
* Revert "fix anders"
This reverts commit b3178d4618.
* Properly handle 'as T' clause with keyof for mapped type
* Fix lint error
* Single character inferences and anchored end span matching
* Fewer array copy operations in template literal type resolution
* Handle cases where 'as T' maps multiple properties onto one
* Fix lint error
* Store key type instead of type mapper in MappedSymbol
* No constraint on `in T` type when `as N` clause present
* Rename from TemplateType to TemplateLiteralType
* Accept new API baselines
* Add tests
* Accept new baselines
* Address CR feedback
* Accept new API baselines
Co-authored-by: Erich Gamma <egamma@microsoft.com>
* Add see tag parser
* add baseline
* fix symbol resolve
* add more case
* fix unittests
* improve tests and parser
* accept baseline
* Adopt package-lock.json and npm ci
* Add a workflow to update package-lock.json daily
* Git ignore package-lock.json and forcibly update in workflow
* Update bot email address
* Delete extra npm update
* Update package-lock.json
* Add compactDisplay and signDisplay to NumberFormatOptions (#40039)
* Fix typo in (Readonly)Set.keys comment (fixes#40164) (#40176)
* fix(26325): use a unique name for reserved words in 'constructor like' function name (#39684)
* fix(25770): add diagnostic message for the possible mapped type used as an index (#39973)
* fix(31046): add new diagnostic message for incompatible constructor signature (#40073)
* Update package-lock.json
* Update package-lock.json
* Add rename support
* Accpet baseline
* wip
* fix anders
* Revert "fix anders"
This reverts commit b3178d4618.
* Fix call hierarchy item serialization and server tests (#40348)
* Avoid error
* accept baseline
* Add more tests
* Add signature name resolve
Co-authored-by: Andrew Casey <andrew.casey@microsoft.com>
Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
Co-authored-by: Neil Kistner <neil.kistner@gmail.com>
Co-authored-by: cherryblossom000 <31467609+cherryblossom000@users.noreply.github.com>
Co-authored-by: Alexander T <alexander.tarasyuk@outlook.com>
Co-authored-by: Erich Gamma <egamma@microsoft.com>
Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
* Don’t offer to extract export assignment
* Terminate unterminated literals when extracting them
* Add test with regular expression ending in backslash
* Add test for string literal ending in backslash
* Remove unused parameter default
* First attempt at aliases for require
* test+initial support for const x=require
* 1st round of baseline improvements
* 2nd round of baseline updates
* support property access after require
* check @type tag on require
* forbid expando missing namespaces on aliases
taken from #39558 as soon as it was created
* accept error baselines that are good, actually
* Scribbling on d.ts emit code
* use getSpecifierForModuleSymbol
* hideous hack for module.exports of aliases
* Fix module.exports.x --> export list emit
* fix isLocalImport predicate
* require only creates aliases in JS
* re-handle json imports
* update fourslash baseline
* Cleanup in the checker
1. Simplify alias resolution.
2. Simplify variable-like checking.
3. Make binding skip require calls with type tags -- they fall back to
the old require-call code and then check from there.
I haven't started on the declaration emit code since I don't know what
is going on there nearly as well.
* Function for getting module name from require call
* First round of cleanup plus a new test
Found one missing feature, not sure it's worth adding.
* more small cleanup
* more cleanup, including lint
* use trackSymbol, not serializeTypeForDeclaration
* Code review comments, plus remove unneeded code
Ad-hoc type reference resolution for `require` isn't needed anymore.
* find all refs works
* remove old ad-hoc code
* make it clear that old behaviour is not that correct
* update api baselines
* remove outdated comment
* PR feedback
1. Fix indentation
2. Add comment for exported JSON emit
3. Add test case for nested-namespace exports.
* add a fail-case test (which passes!)
* Support recursive conditional types
* Accept new API baselines
* Accept new baselines
* Simplify recursive type tracking in type inference
* Accept new baselines
* Add tests
* Accept new baselines
* Revise recursion tracking in type inference
* Revise tests
* Accept new baselines
* Add more tests
* Accept new baselines
* Limit auto import provider project size
* Add test
* Make option configurable
* Fix test
* Only bail when setting is auto
* Fix other test
* Update API baseline