Skip to content

fix(ts-autocomplete): fallback directoryExists to true, not false #558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions packages/ts-autocomplete/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ function getVirtualLanguageService(
return fallbackServiceHost?.readDirectory?.(...args) ?? [];
},
directoryExists: (...args) => {
return fallbackServiceHost?.directoryExists?.(...args) ?? false;
// Fallback to true so that it will use the first directory it checks and
// then try and load that file at which point we'll strip the prefix and
// service up the right file from codeHolder.
return fallbackServiceHost?.directoryExists?.(...args) ?? true;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In tests we provide a fallbackServiceHost, so it just worked..

},
getDirectories: (...args) => {
return fallbackServiceHost?.getDirectories?.(...args) ?? [];
Expand Down Expand Up @@ -220,9 +223,8 @@ function filterDiagnostics(diagnostics: ts.Diagnostic[]): {
..._.pick(item, 'messageText'),
};

if (result.fileName?.endsWith('shell-api.ts')) {
delete result.text;
}
// this just tends to be way too verbose
delete result.text;

return result;
});
Expand Down