Skip to content

Commit 24a1e5e

Browse files
authored
fix(ts-autocomplete): fallback directoryExists to true, not false (#558)
fallback directoryExists to true, not false
1 parent 05f3172 commit 24a1e5e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/ts-autocomplete/src/index.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ function getVirtualLanguageService(
117117
return fallbackServiceHost?.readDirectory?.(...args) ?? [];
118118
},
119119
directoryExists: (...args) => {
120-
return fallbackServiceHost?.directoryExists?.(...args) ?? false;
120+
// Fallback to true so that it will use the first directory it checks and
121+
// then try and load that file at which point we'll strip the prefix and
122+
// service up the right file from codeHolder.
123+
return fallbackServiceHost?.directoryExists?.(...args) ?? true;
121124
},
122125
getDirectories: (...args) => {
123126
return fallbackServiceHost?.getDirectories?.(...args) ?? [];
@@ -220,9 +223,8 @@ function filterDiagnostics(diagnostics: ts.Diagnostic[]): {
220223
..._.pick(item, 'messageText'),
221224
};
222225

223-
if (result.fileName?.endsWith('shell-api.ts')) {
224-
delete result.text;
225-
}
226+
// this just tends to be way too verbose
227+
delete result.text;
226228

227229
return result;
228230
});

0 commit comments

Comments
 (0)