* Convert symlink scenarios to virtual FS where its symlinks are correctly maintained
Adds test for #36866
* Fix the casing issue when redirects differ in casing of the file
* Make ModuleSpecifierResolutionHost internal
* Refactoring for ModuleSpecifierResolutionHost
* If any of the file path option is from node_modules folder, consider only paths in node_modules folder
* Update src/services/utilities.ts
Co-Authored-By: Andrew Branch <andrewbranch@users.noreply.github.com>
Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
* Add codefix for --noImplicitThis
* Code review
* Back to building post-merge
* Remove redundant functions + update tests
Infer-from-usage also inserts `this: any` parameters when needed, so I
removed that from fixImplicitThis.
Otherwise, fixImplicitThis has better suggestions than inferFromUsage,
so I moved inferFromUsage later in the suggestion order.
* More redundancy removal
Don't need to add `@this` anymore either since inferFromUsage will do
that.
* More baseline updates
From moving inferFromUsage down in priority I think?
* remove now-redundant ad-hoc jsdoc emit
* fix more bad merge
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* Flatten immediately nested conditional types in the false position
* Add test
* Accept new baselines
* Handle nested distributive types with different checkType
* Allow deeply nested immediately resolving conditionals without any syntactic requirements or implementation contortions
Extract logic into function
Co-authored-by: Wesley Wigham <wewigham@microsoft.com>
* Add tests that fail because of symlink to non common directory node_modules
* When the imported module is through node_modules and symlink to folder that isnt node_modules
Most of the monorepo like scenarios are like this so looking at symlink to decide if file can be imported is essential
Fixes#28689
* Treat intersections of only objects as a single object in relations
* Exclude intersections containing non-inferrable types
* Accept new baselines
* Update test
* Accept new baselines
* Add tests
* getPropertiesOfUnionOrIntersectionType: handle types with index signature
Fixes: #31565
* fix test
* more testing
* fix typo in checker.ts
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* add trim trailing whitespace option
* set default trimTrailingWhiteSpace to true
* add fourslash tests
* accept new baselines
* only preserce whitespace when setting is explicitly false
* format whitespace
* Make substitution types even if the substitution base isnt a type variable
* Broaden usage of getConditionalFlowTypeOfType to _all_ type lookups
* Align comments
* Add test where file from referenced project of solution belongs to inferred project instead of referenced project
* Try to find project from project references if the default config project is solution
Fixes#36708
* Add test to verify the correct collection of projects
* Handle when default config project is indirectly referenced in the solution
* Include public API tests in unittests
* Make sure default project for script info is calculated correctly
* Handle reload projects
* Ensure to load solution project tree when project is referenced by solution
* Find all refs when the file is referenced via d.ts
* Some comments per feedback
* Fix typo
* Adds some docs to the LSP dts
* Ensure that getProgramDiagnostic is included everywhere that getCompilerOptionsDiagnostic is
* Update baselines
* Apply suggestions from code review
Co-Authored-By: Andrew Branch <andrewbranch@users.noreply.github.com>
* Remove the getCompilerOptionsDiagnostics -> getProgramDiagnostics change
Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
* Treat write-only-access to a class member with setter as a reference.
* Add test case for unused private members, special-casing the member with a setter.
Signed-off-by: Andrew Deniszczyc <adeniszczyc@bloomberg.net>
Cleanup of implementation
Move check node container check
Add test cases for fixExpectedCommaError
Renaming and add test case
Co-authored-by: Andrew Deniszczyc <adeniszczyc@bloomberg.net>
* make splice `deleteCount` required in es5.d.ts
In ES5 `deleteCount` is not an optional argument. If it is not provided it defaults to 0 as a side effect of `undefined` being converted to an integer.
In ES6 `deleleteCount` is optional, and it defaults to the length of the array minus the start index.
If you are targeting ES5 but don't provide `deleteCount` the behaviour will be different depending on the environment your build is running in.
fixes#32638
* update baselines
* Make the systems for baselining default to pretty
* Ensure that we have seenAffectedFiles map when files are added to pending emit because they were present in the old state
This happens in build scenarios since semantic diagnostics are queried before emit and hence files are added to seenAffectedFiles pending emit
Fixes#37269
This addresses issue #28975
(https://github.com/microsoft/TypeScript/issues/28975).
When providing a value as a type argument, we can suggest a more specific
error message: "Did you mean to use typeof T?"
adds error message
WIP: Detect error
WIP: progress
updated tests
janky implementation
adds test coverage around literal types being unaffected
refactor out isIdentifierATypeArgument function
adds test case for type alias
adds test case for nested type arguments
fixes linting errors
merge master into branch to overwrite changes
changes value as type error message
This suggests 'typeof T' as a potential alternative when we give an error
about using value T as a type.
remove stale tests from old change
Co-authored-by: John Patterson <john@johnppatterson.com>
* Increase timeout for ensuring projects for open files
* Condense the project/file printing in the log (given now we have project printed anytime its structure changes)