MCPcopy Index your code
hub / github.com/angular/angular / withFallback

Function withFallback

packages/language-service/src/ts_plugin.ts:38–46  ·  view source on GitHub ↗
(
    fileName: string,
    cb: (ls: ts.LanguageService | LanguageService) => Result | undefined,
  )

Source from the content-addressed store, hash-verified

36 const ngLS = new LanguageService(project, tsLS, config);
37
38 function withFallback<Result>(
39 fileName: string,
40 cb: (ls: ts.LanguageService | LanguageService) => Result | undefined,
41 ): Result | undefined {
42 if (angularOnly || !isTypeScriptFile(fileName)) {
43 return cb(ngLS);
44 }
45 return cb(tsLS) ?? cb(ngLS);
46 }
47
48 function getSyntacticDiagnostics(fileName: string): ts.DiagnosticWithLocation[] {
49 if (!angularOnly && isTypeScriptFile(fileName)) {

Callers 8

getQuickInfoAtPositionFunction · 0.85
getCompletionsAtPositionFunction · 0.85
getCompletionEntrySymbolFunction · 0.85
getSignatureHelpItemsFunction · 0.85
getOutliningSpansFunction · 0.85

Calls 2

isTypeScriptFileFunction · 0.90
cbFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…