* Start experiment * Add logging * Go back to a single program * Fix forEachExternalModuleToImportFrom * Move auxiliary program to language service * Add logging * Don’t use resolution cache * Fix(?) containingProjects for ScriptInfo in auxiliary program * Fix ScriptInfo project inclusion * Add test for default project of auto-importable ScriptInfo * Add fourslash server test * Don’t create auto import provider inside node_modules * Add monorepo-like test * WIP * Naively ensure autoImportProvider is up to date after package.json change * Start limiting when auto update provider gets updated * Respond to changes in node_modules * Don’t create auto-import provider until a file is open that would use it e.g., don’t create them during cross-project find-all-refs * Clean up naming, @internal marking, and fix empty project creation bug * Drop devDependencies, include peerDependencies * Add additional compiler options * Fix interaction with importSuggestionsCache * Move option to UserPreferences, allow inclusion of devDependencies * Don’t filter out peerDependencies * Watch unparseable package.jsons * But don’t filter packages out due to an invalid package.json * Update test * Don’t use autoImportProvider in codefixes where it can never be used (or any refactors) * Add CompletionEntry property for telemetry * Add assertion for isPackageJsonImport to fourslash * Fix missing pushSymbol argument * Add isPackageJsonImport to tests and API baselines * Fix unit test * Host auto import provider in new Project kind * Fix InferredProject attaching on AutoImportProvider-included files, load eagerly * Update Public APIs * Simplify PackageJsonCache host * Remove unneeded markAsDirty * Defer project finished event until after AutoImportProvider is created * Make AutoImportProviderProject always report isOrphan = true * Close and remove AutoImportProviderProject when host project closes * Don’t set pendingEnsureProjectForOpenFiles * Use hasAddedOrRemovedFiles instead of hasNewProgram * Use host-wide watchOptions for package.json watching * Add to `printProjects` * Clean up * Get autoImportProvider directly from LanguageServiceHost * Clean up * Clean up * Close auto import provider on disableLanguageService * Move AutoImportProvider preload to project updateGraph * Clear auto import suggestion cache when provider program changes * Fix tests * Revert yet-unneeded change * Use projectService host for module resolution host * Don’t re-resolve type directives if nothing has changed * Update src/server/project.ts Co-authored-by: Sheetal Nandi <shkamat@microsoft.com> * Use ts.emptyArray Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
49 lines
1.4 KiB
TypeScript
49 lines
1.4 KiB
TypeScript
/// <reference path="../fourslash.ts" />
|
|
|
|
// @Filename: /node_modules/common-dependency/package.json
|
|
//// { "name": "common-dependency" }
|
|
|
|
// @Filename: /node_modules/common-dependency/index.d.ts
|
|
//// export declare class CommonDependency {}
|
|
|
|
// @Filename: /node_modules/package-dependency/package.json
|
|
//// { "name": "package-dependency" }
|
|
|
|
// @Filename: /node_modules/package-dependency/index.d.ts
|
|
//// export declare class PackageDependency
|
|
|
|
// @Filename: /package.json
|
|
//// { "private": true, "dependencies": { "common-dependency": "*" } }
|
|
|
|
// @Filename: /tsconfig.json
|
|
//// { "files": [], "references": [{ "path": "packages/a" }] }
|
|
|
|
// @Filename: /packages/a/tsconfig.json
|
|
//// { "compilerOptions": { "target": "esnext", "composite": true } }
|
|
|
|
// @Filename: /packages/a/package.json
|
|
//// { "peerDependencies": { "package-dependency": "*" } }
|
|
|
|
// @Filename: /packages/a/index.ts
|
|
//// /**/
|
|
|
|
goTo.marker("");
|
|
verify.completions({
|
|
includes: [{
|
|
name: "PackageDependency",
|
|
hasAction: true,
|
|
source: "/node_modules/package-dependency/index",
|
|
sortText: completion.SortText.AutoImportSuggestions,
|
|
isPackageJsonImport: true
|
|
}, {
|
|
name: "CommonDependency",
|
|
hasAction: true,
|
|
source: "/node_modules/common-dependency/index",
|
|
sortText: completion.SortText.AutoImportSuggestions,
|
|
isPackageJsonImport: true
|
|
}],
|
|
preferences: {
|
|
includeCompletionsForModuleExports: true
|
|
}
|
|
});
|