* Add test where module resolution cache is not local and hence doesnt report errors in watch mode
* Ensure module resolution cache is passed through in watch mode
* Remove unnecessary setting of impliedFormat which should anyways be done as part of create source file
* Add test for packge.json changing and modifying implied format
* Distinguish between package.json watch and affecting file location watch
* Pass in failed lookup and affected file locations for source file's implied format
Also stop creating options if we already have them
* Add diagnostic for explaining file's implied format if based on package.json
* Watch implied format dependencies for modules and schedule update on change
* For program if implied node format doesnt match create new source file. Handle implied node format in document registry
Fixes#50086
* Modify tests to show package.json being watched irrespective of folder its in
* Check file path if it can be watched before watching package.json file
* Because we are watching package.json files and failed lookups its safe to invalidate package json entries instead of clearing them out everytime program is created
* Remove todos
* Fix the incorrect merge
* Pickup PackageJsonInfo renames from #50088
* Rename
* Account for type parameters in missing function codefix
* Apply suggestions from code review
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* WIP
* Synthesize new type parameters instead of deep unions and intersections
* Pass along type parameter constraints
* E.T. phone home
* Clean up comments just a bit
* Only widen the instance type sometimes
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* 🐛 Avoid grouping JSDoc nodes of propery signatures with others in smart selection
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
* ⚗️ Add test case for JSDoc smart selection (#39618)
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
* ⚗️ Add test baseline for JSDoc smart selection (#39618)
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
* 🐛 Fix skipping SyntaxList first child's JSDoc in smart selection
Signed-off-by: GitHub <noreply@github.com>
* ⚗️ Add tests to ensure not skipping first SyntaxList child's JSDoc
Signed-off-by: GitHub <noreply@github.com>
* 🔨 Exclude JSDoc token from tokens pivoting property signature
Signed-off-by: GitHub <noreply@github.com>
* ⚗️ Update test case to also include modifier
Signed-off-by: GitHub <noreply@github.com>
* ⚗️ Update test case reference baseline
Signed-off-by: GitHub <noreply@github.com>
* Support path completions for exports wildcards
* Break up results by directory
* Share code between typesVersions and exports processing
* Revert completion kind change
* Add kinds to tests
* Update existing test
* Support nested conditions, improve recursive globbing
* Demote priority of JS completions
Fixes#48498
Unchecked JS files gather identifier-based completions. Currently, this search
happens instead of `getCompletionEntriesFromSymbols` for TS/checked JS
files. However, identifier-based completions are much lower quality and
can be ignored by some editors.
Identifier-based completions should be gathered last, after gathering
other completions. That's what this PR does.
* Invert isUncheckedFile to avoid double negative
* dedupe calls to getCompletionEntriesFromSymbols
* Stop re-creating list of entry names
* more deduping + fix lint
* Add a simple queue implementation with better performance than `Array.shift`
This lets us clean up the hack introduced in #49581
* Correct typo
Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
* add bug repro test
* add test and start fix implementation
* adjust for useAlias preference
* fix existing renaming test
* refactor to get rid of options
* fix named bindings & other imports cases
* fix eslint error
* address cr comments
* hopefully actually fix eslint
* clean up stale baseline
* make API change non-breaking
* add/fix comments
* Merge 'decorators' into 'modifiers' on various Nodes
* Drop RESERVED argument in favor of removing parameter
* Ignore grammar error nodes when asserting invariants
* Revert 'illegalX' property renames
* PR Feedback
* fix(47562): Add option to suppress type hint if variable name matches type
* Remove the unnecessary debug code
* Re-run gulp runtests
* Use equateStringsCaseInsensitive to compare strings
* Fix path completions for typesVersions
* Add more tests
* Fix case when * is a fragment of a path component
* Once a path pattern matches, only return completions from that pattern and higher priority ones
* Fix iteration order issue
* Aesthetics
* Remove unnecessary members of HostCache
* Standardize on calling compiler host members in preparation for adding caching at that layer
* Call changeCompilerHostLikeToUseCache to cache existence checks
* Drop now-redundant HostCache
* Don't make directoryExists caching contingent on createDirectory
* Clear compilerHost rather than tracking state
* Clean up FAR and RenameLocations
This change had two goals:
1. Make the code easier to understand, primarily by simplifying the callback structure and minimizing side-effects
2. Improve performance by reducing repeated work, both FAR searches of individual projects and default tsconfig searches
This implementation attempts to preserve the merging order found in the original code (someone less relevant in the present state of using syntactic isDefinition).
* Stop enforcing search and aggregation order
...in preparation for implementing isDefinition explicitly.
Also restore convention of referring to `DocumentPosition`s as "locations".
* Introduce LanguageService.updateIsDefinitionOfReferencedSymbols
...to allow use of the checker when computing isDefinition across projects.
* Update baselines
* Tidy diff
* De-dup simplified results
* Baseline cross-project isDefinition results
* Move de-duping upstream to fix Full output
* Add server baseline test to confirm searches are not repeated
* Manually merge #48758
* Update baseline for newer fix to #48963