remove some anys (#271651)

This commit is contained in:
Martin Aeschlimann
2025-10-16 11:48:38 +02:00
committed by GitHub
parent 3a8f6b3483
commit cee904f80c
6 changed files with 19 additions and 23 deletions

View File

@@ -179,9 +179,9 @@ async function startClientWithParticipants(languageParticipants: LanguagePartici
}
return r;
}
// eslint-disable-next-line local/code-no-any-casts
const isThenable = <T>(obj: ProviderResult<T>): obj is Thenable<T> => obj && (<any>obj)['then'];
function isThenable<T>(obj: unknown): obj is Thenable<T> {
return !!obj && typeof (obj as unknown as Thenable<T>).then === 'function';
}
const r = next(document, position, context, token);
if (isThenable<CompletionItem[] | CompletionList | null | undefined>(r)) {
return r.then(updateProposals);