@gql.tada/cli-utils 1.9.2 → 1.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2748,7 +2748,7 @@ function initTTY(t = {}) {
2748
2748
  n = process.stderr;
2749
2749
  a = process.stdout;
2750
2750
  } else {
2751
- r = n.isTTY;
2751
+ r = r && !!n.isTTY;
2752
2752
  }
2753
2753
  var i = process.argv.includes("--color");
2754
2754
  var o = "FORCE_COLOR" in process.env || !process.env.NO_COLOR && !process.env.CI;
@@ -2770,7 +2770,6 @@ function initTTY(t = {}) {
2770
2770
  function onKeypress(t, n) {
2771
2771
  switch (n.name) {
2772
2772
  case "c":
2773
- case "d":
2774
2773
  case "x":
2775
2774
  if (n.ctrl) {
2776
2775
  return r();
@@ -2844,16 +2843,16 @@ function initTTY(t = {}) {
2844
2843
  n.write(text(...r));
2845
2844
  }
2846
2845
  },
2847
- start: function start(r) {
2846
+ start: function start(a) {
2848
2847
  var write = r => {
2849
2848
  if (!t.silent) {
2850
2849
  n.write("" + r);
2851
2850
  }
2852
2851
  };
2853
- if (t.disableTTY) {
2854
- return pipe(compose(r), onPush(write), toPromise);
2852
+ if (t.disableTTY || !r) {
2853
+ return pipe(compose(a), onPush(write), toPromise);
2855
2854
  } else {
2856
- return pipe(compose(r), onPush(write), takeUntil(l), toPromise);
2855
+ return pipe(compose(a), onPush(write), takeUntil(l), toPromise);
2857
2856
  }
2858
2857
  },
2859
2858
  mode: function mode(...t) {
@@ -3010,6 +3009,9 @@ var writeOutput = async (t, r) => {
3010
3009
  }));
3011
3010
  }));
3012
3011
  }
3012
+ if (await readOutput(t) === r) {
3013
+ return;
3014
+ }
3013
3015
  var n = a("string" != typeof t ? await f.realpath(t) : t);
3014
3016
  if (!await directoryExists(n)) {
3015
3017
  await f.mkdir(n, {
@@ -4116,33 +4118,39 @@ function createCacheContents(r, a, n, i) {
4116
4118
  for (var l of r) {
4117
4119
  s.set(l.argumentKey, l);
4118
4120
  }
4119
- var c = "";
4120
- for (var d of s.values()) {
4121
- if (c) {
4122
- c += "\n";
4123
- }
4124
- if (d.documentHash) {
4125
- c += ` /** @gql.tada/hash ${d.documentHash} */\n`;
4126
- }
4127
- c += ` ${d.argumentKey}:\n ${d.documentType};`;
4128
- }
4129
- var f = "import type { TadaDocumentNode, $tada } from 'gql.tada';\n";
4130
- var p = "string" == typeof n || n && "object" == typeof n && "toString" in n && !("writable" in n);
4131
- var h = new Set;
4132
- for (var g of a) {
4133
- for (var m of g.imports) {
4134
- if (p) {
4135
- var v = n.toString();
4136
- var y = t.dirname(g.absolutePath);
4137
- if (t.resolve(y, m.specifier) === t.resolve(v) || h.has(m.specifier)) {
4121
+ var c = [ ...s.values() ].sort(((t, r) => compareUtf16(t.argumentKey, r.argumentKey)));
4122
+ var d = "";
4123
+ for (var f of c) {
4124
+ if (d) {
4125
+ d += "\n";
4126
+ }
4127
+ if (f.documentHash) {
4128
+ d += ` /** @gql.tada/hash ${f.documentHash} */\n`;
4129
+ }
4130
+ d += ` ${f.argumentKey}:\n ${f.documentType};`;
4131
+ }
4132
+ var p = "import type { TadaDocumentNode, $tada } from 'gql.tada';\n";
4133
+ var h = "string" == typeof n || n && "object" == typeof n && "toString" in n && !("writable" in n);
4134
+ var g = [ ...a ].sort(((t, r) => compareUtf16(t.absolutePath, r.absolutePath)));
4135
+ var m = new Set;
4136
+ for (var v of g) {
4137
+ for (var y of v.imports) {
4138
+ if (h) {
4139
+ var w = n.toString();
4140
+ var S = t.dirname(v.absolutePath);
4141
+ if (t.resolve(S, y.specifier) === t.resolve(w) || m.has(y.specifier)) {
4138
4142
  continue;
4139
4143
  }
4140
- h.add(m.specifier);
4144
+ m.add(y.specifier);
4141
4145
  }
4142
- f += m.importClause + "\n";
4146
+ p += y.importClause + "\n";
4143
4147
  }
4144
4148
  }
4145
- return o + f + "\ndeclare module 'gql.tada' {\n interface setupCache {\n" + c + "\n }\n}\n";
4149
+ return o + p + "\ndeclare module 'gql.tada' {\n interface setupCache {\n" + d + "\n }\n}\n";
4150
+ }
4151
+
4152
+ function compareUtf16(t, r) {
4153
+ return t < r ? -1 : t > r ? 1 : 0;
4146
4154
  }
4147
4155
 
4148
4156
  class TurboCommand extends Command {
@@ -6517,21 +6525,93 @@ function maybeBind(t, r) {
6517
6525
  return r ? r.bind(t) : void 0;
6518
6526
  }
6519
6527
 
6520
- var buildLanguageService = r => {
6521
- var {virtualMap: a} = r;
6522
- var n = I.createLanguageService(r.languageServiceHost, r.documentRegistry);
6523
- var i = maybeBind(n, n.getProgram);
6524
- var mapFileFn = t => (r, ...i) => {
6525
- var o = a.get(r);
6526
- if (o && o.sourceFileId === r) {
6527
- r = o.generatedFileId;
6528
+ var buildProgram = r => {
6529
+ var {program: a, virtualMap: n} = r;
6530
+ var i = ((r, a) => {
6531
+ var toKey = t => "win32" === process.platform ? t.toLowerCase() : t;
6532
+ var n = new Set([ toKey(t.resolve(r)) ]);
6533
+ for (var i of a) {
6534
+ if (t.isAbsolute(i)) {
6535
+ n.add(toKey(t.dirname(i)));
6536
+ }
6537
+ }
6538
+ return r => {
6539
+ var a = toKey(t.dirname(t.resolve(r)));
6540
+ for (;;) {
6541
+ if (n.has(a)) {
6542
+ return !0;
6543
+ }
6544
+ var i = t.dirname(a);
6545
+ if (i === a) {
6546
+ return !1;
6547
+ }
6548
+ a = i;
6549
+ }
6550
+ };
6551
+ })(r.projectRoot, r.rootNames);
6552
+ var o = maybeBind(a, a.isSourceFileFromExternalLibrary);
6553
+ var s = maybeBind(a, a.getModeForResolutionAtIndex);
6554
+ var l = maybeBind(a, a.getSourceFile);
6555
+ var c = maybeBind(a, a.getSourceFiles);
6556
+ var mapSourceFileFn = t => (r, ...i) => {
6557
+ var o = r && n.get(r.fileName);
6558
+ if (o && o.sourceFileId === r?.fileName) {
6559
+ r = l(o.generatedFileId) || r;
6560
+ }
6561
+ return t.call(a, r, ...i);
6562
+ };
6563
+ return Object.assign(a, {
6564
+ getSyntacticDiagnostics: mapSourceFileFn(a.getSyntacticDiagnostics),
6565
+ getSemanticDiagnostics: mapSourceFileFn(a.getSemanticDiagnostics),
6566
+ getDeclarationDiagnostics: mapSourceFileFn(a.getDeclarationDiagnostics),
6567
+ isSourceFileDefaultLibrary: mapSourceFileFn(a.isSourceFileDefaultLibrary),
6568
+ getModeForUsageLocation: mapSourceFileFn(a.getModeForUsageLocation),
6569
+ isSourceFileFromExternalLibrary(t) {
6570
+ var r = n.get(t.fileName);
6571
+ return !(!r || r.sourceFileId !== t.fileName) || o(t);
6572
+ },
6573
+ getSourceFiles() {
6574
+ var t = [];
6575
+ for (var r of c()) {
6576
+ if (i(r.fileName) && !a.isSourceFileFromExternalLibrary(r)) {
6577
+ t.push(r);
6578
+ }
6579
+ }
6580
+ return t;
6581
+ },
6582
+ getSourceFile(t) {
6583
+ var r = n.get(t);
6584
+ if (r && r.sourceFileId === t) {
6585
+ t = r.generatedFileId;
6586
+ }
6587
+ return l(t);
6588
+ },
6589
+ getModeForResolutionAtIndex(t, r) {
6590
+ var a = n.get(t.fileName);
6591
+ if (a && a.sourceFileId === t.fileName) {
6592
+ t = l(a.generatedFileId) || t;
6593
+ r = a.getGeneratedOffset(r)?.[0] ?? r;
6594
+ }
6595
+ return s(t, r);
6596
+ }
6597
+ });
6598
+ };
6599
+
6600
+ var buildLanguageService = t => {
6601
+ var {virtualMap: r} = t;
6602
+ var a = I.createLanguageService(t.languageServiceHost, t.documentRegistry);
6603
+ var n = maybeBind(a, a.getProgram);
6604
+ var mapFileFn = t => (n, ...i) => {
6605
+ var o = r.get(n);
6606
+ if (o && o.sourceFileId === n) {
6607
+ n = o.generatedFileId;
6528
6608
  }
6529
- return t.call(n, r, ...i);
6609
+ return t.call(a, n, ...i);
6530
6610
  };
6531
- var mapFileTextSpanFn = t => (r, i, ...o) => {
6532
- var s = a.get(r);
6533
- if (s && s.sourceFileId === r) {
6534
- r = s.generatedFileId;
6611
+ var mapFileTextSpanFn = t => (n, i, ...o) => {
6612
+ var s = r.get(n);
6613
+ if (s && s.sourceFileId === n) {
6614
+ n = s.generatedFileId;
6535
6615
  var l = s.getGeneratedOffset(i.start)?.[0];
6536
6616
  var c = s.getGeneratedOffset(i.start + i.length - 1)?.[0];
6537
6617
  if (null != l) {
@@ -6544,12 +6624,12 @@ var buildLanguageService = r => {
6544
6624
  }
6545
6625
  }
6546
6626
  }
6547
- return t.call(n, r, i, ...o);
6627
+ return t.call(a, n, i, ...o);
6548
6628
  };
6549
- var mapFileTextRangeFn = t => (r, i, ...o) => {
6550
- var s = a.get(r);
6551
- if (s && s.sourceFileId === r) {
6552
- r = s.generatedFileId;
6629
+ var mapFileTextRangeFn = t => (n, i, ...o) => {
6630
+ var s = r.get(n);
6631
+ if (s && s.sourceFileId === n) {
6632
+ n = s.generatedFileId;
6553
6633
  var l = s.getGeneratedOffset(i.pos)?.[0];
6554
6634
  var c = s.getGeneratedOffset(i.end)?.[0];
6555
6635
  if (null != l) {
@@ -6562,137 +6642,90 @@ var buildLanguageService = r => {
6562
6642
  }
6563
6643
  }
6564
6644
  }
6565
- return t.call(n, r, i, ...o);
6645
+ return t.call(a, n, i, ...o);
6566
6646
  };
6567
- var mapFilePositionFn = t => (r, i, ...o) => {
6568
- var s = a.get(r);
6569
- if (s && s.sourceFileId === r) {
6570
- r = s.generatedFileId;
6647
+ var mapFilePositionFn = t => (n, i, ...o) => {
6648
+ var s = r.get(n);
6649
+ if (s && s.sourceFileId === n) {
6650
+ n = s.generatedFileId;
6571
6651
  i = s.getGeneratedOffset(i)?.[0] ?? i;
6572
6652
  }
6573
- return t.call(n, r, i, ...o);
6653
+ return t.call(a, n, i, ...o);
6574
6654
  };
6575
- var mapFileStartEndFn = t => (r, i, o, ...s) => {
6576
- var l = a.get(r);
6577
- if (l && l.sourceFileId === r) {
6578
- r = l.generatedFileId;
6655
+ var mapFileStartEndFn = t => (n, i, o, ...s) => {
6656
+ var l = r.get(n);
6657
+ if (l && l.sourceFileId === n) {
6658
+ n = l.generatedFileId;
6579
6659
  i = l.getGeneratedOffset(i)?.[0] ?? i;
6580
6660
  o = l.getGeneratedOffset(o)?.[0] ?? o;
6581
6661
  }
6582
- return t.call(n, r, i, o, ...s);
6662
+ return t.call(a, n, i, o, ...s);
6583
6663
  };
6584
- var o;
6585
- return Object.assign(n, {
6664
+ var i;
6665
+ return Object.assign(a, {
6586
6666
  getProgram() {
6587
- if (o) {
6588
- return o;
6667
+ if (i) {
6668
+ return i;
6589
6669
  } else {
6590
- var a = i();
6591
- return a ? o = (r => {
6592
- var {program: a, virtualMap: n, projectRoot: i} = r;
6593
- var o = maybeBind(a, a.isSourceFileFromExternalLibrary);
6594
- var s = maybeBind(a, a.getModeForResolutionAtIndex);
6595
- var l = maybeBind(a, a.getSourceFile);
6596
- var c = maybeBind(a, a.getSourceFiles);
6597
- var mapSourceFileFn = t => (r, ...i) => {
6598
- var o = r && n.get(r.fileName);
6599
- if (o && o.sourceFileId === r?.fileName) {
6600
- r = l(o.generatedFileId) || r;
6601
- }
6602
- return t.call(a, r, ...i);
6603
- };
6604
- return Object.assign(a, {
6605
- getSyntacticDiagnostics: mapSourceFileFn(a.getSyntacticDiagnostics),
6606
- getSemanticDiagnostics: mapSourceFileFn(a.getSemanticDiagnostics),
6607
- getDeclarationDiagnostics: mapSourceFileFn(a.getDeclarationDiagnostics),
6608
- isSourceFileDefaultLibrary: mapSourceFileFn(a.isSourceFileDefaultLibrary),
6609
- getModeForUsageLocation: mapSourceFileFn(a.getModeForUsageLocation),
6610
- isSourceFileFromExternalLibrary(t) {
6611
- var r = n.get(t.fileName);
6612
- return !(!r || r.sourceFileId !== t.fileName) || o(t);
6613
- },
6614
- getSourceFiles() {
6615
- var r = [];
6616
- for (var n of c()) {
6617
- if (!t.relative(i, n.fileName).startsWith("..") && !a.isSourceFileFromExternalLibrary(n)) {
6618
- r.push(n);
6619
- }
6620
- }
6621
- return r;
6622
- },
6623
- getSourceFile(t) {
6624
- var r = n.get(t);
6625
- if (r && r.sourceFileId === t) {
6626
- t = r.generatedFileId;
6627
- }
6628
- return l(t);
6629
- },
6630
- getModeForResolutionAtIndex(t, r) {
6631
- var a = n.get(t.fileName);
6632
- if (a && a.sourceFileId === t.fileName) {
6633
- t = l(a.generatedFileId) || t;
6634
- r = a.getGeneratedOffset(r)?.[0] ?? r;
6635
- }
6636
- return s(t, r);
6637
- }
6638
- });
6639
- })({
6640
- program: a,
6641
- virtualMap: r.virtualMap,
6642
- projectRoot: r.projectRoot
6670
+ var r = n();
6671
+ return r ? i = buildProgram({
6672
+ program: r,
6673
+ virtualMap: t.virtualMap,
6674
+ projectRoot: t.projectRoot,
6675
+ rootNames: t.rootNames
6643
6676
  }) : void 0;
6644
6677
  }
6645
6678
  },
6646
- getReferencesAtPosition: mapFilePositionFn(n.getReferencesAtPosition),
6647
- findReferences: mapFilePositionFn(n.findReferences),
6648
- getDefinitionAtPosition: mapFilePositionFn(n.getDefinitionAtPosition),
6649
- getDefinitionAndBoundSpan: mapFilePositionFn(n.getDefinitionAndBoundSpan),
6650
- getTypeDefinitionAtPosition: mapFilePositionFn(n.getTypeDefinitionAtPosition),
6651
- getImplementationAtPosition: mapFilePositionFn(n.getImplementationAtPosition),
6652
- getCompletionsAtPosition: mapFilePositionFn(n.getCompletionsAtPosition),
6653
- getCompletionEntryDetails: mapFilePositionFn(n.getCompletionEntryDetails),
6654
- getCompletionEntrySymbol: mapFilePositionFn(n.getCompletionEntrySymbol),
6655
- getQuickInfoAtPosition: mapFilePositionFn(n.getQuickInfoAtPosition),
6656
- getBreakpointStatementAtPosition: mapFilePositionFn(n.getBreakpointStatementAtPosition),
6657
- getSignatureHelpItems: mapFilePositionFn(n.getSignatureHelpItems),
6658
- getRenameInfo: mapFilePositionFn(n.getRenameInfo),
6659
- getSmartSelectionRange: mapFilePositionFn(n.getSmartSelectionRange),
6660
- getDocumentHighlights: mapFilePositionFn(n.getDocumentHighlights),
6661
- prepareCallHierarchy: mapFilePositionFn(n.prepareCallHierarchy),
6662
- provideCallHierarchyIncomingCalls: mapFilePositionFn(n.provideCallHierarchyIncomingCalls),
6663
- provideCallHierarchyOutgoingCalls: mapFilePositionFn(n.provideCallHierarchyOutgoingCalls),
6664
- getBraceMatchingAtPosition: mapFilePositionFn(n.getBraceMatchingAtPosition),
6665
- getIndentationAtPosition: mapFilePositionFn(n.getIndentationAtPosition),
6666
- getFormattingEditsAfterKeystroke: mapFilePositionFn(n.getFormattingEditsAfterKeystroke),
6667
- getDocCommentTemplateAtPosition: mapFilePositionFn(n.getDocCommentTemplateAtPosition),
6668
- isValidBraceCompletionAtPosition: mapFilePositionFn(n.isValidBraceCompletionAtPosition),
6669
- getJsxClosingTagAtPosition: mapFilePositionFn(n.getJsxClosingTagAtPosition),
6670
- getLinkedEditingRangeAtPosition: mapFilePositionFn(n.getLinkedEditingRangeAtPosition),
6671
- getSpanOfEnclosingComment: mapFilePositionFn(n.getSpanOfEnclosingComment),
6672
- getSyntacticClassifications: mapFileTextSpanFn(n.getSyntacticClassifications),
6673
- getSemanticClassifications: mapFileTextSpanFn(n.getSemanticClassifications),
6674
- getEncodedSyntacticClassifications: mapFileTextSpanFn(n.getEncodedSyntacticClassifications),
6675
- getEncodedSemanticClassifications: mapFileTextSpanFn(n.getEncodedSemanticClassifications),
6676
- provideInlayHints: mapFileTextSpanFn(n.provideInlayHints),
6677
- getNameOrDottedNameSpan: mapFileStartEndFn(n.getNameOrDottedNameSpan),
6678
- getFormattingEditsForRange: mapFileStartEndFn(n.getFormattingEditsForRange),
6679
- getCodeFixesAtPosition: mapFileStartEndFn(n.getCodeFixesAtPosition),
6680
- getFileReferences: mapFileFn(n.getFileReferences),
6681
- getNavigationBarItems: mapFileFn(n.getNavigationBarItems),
6682
- getNavigationTree: mapFileFn(n.getNavigationTree),
6683
- getOutliningSpans: mapFileFn(n.getOutliningSpans),
6684
- getTodoComments: mapFileFn(n.getTodoComments),
6685
- getFormattingEditsForDocument: mapFileFn(n.getFormattingEditsForDocument),
6686
- getEditsForRefactor: mapFileFn(n.getEditsForRefactor),
6687
- getEmitOutput: mapFileFn(n.getEmitOutput),
6688
- getSuggestionDiagnostics: mapFileFn(n.getSuggestionDiagnostics),
6689
- getSemanticDiagnostics: mapFileFn(n.getSemanticDiagnostics),
6690
- getSyntacticDiagnostics: mapFileFn(n.getSyntacticDiagnostics),
6691
- getSupportedCodeFixes: mapFileFn(n.getSupportedCodeFixes),
6692
- toggleLineComment: mapFileTextRangeFn(n.toggleLineComment),
6693
- toggleMultilineComment: mapFileTextRangeFn(n.toggleMultilineComment),
6694
- commentSelection: mapFileTextRangeFn(n.commentSelection),
6695
- uncommentSelection: mapFileTextRangeFn(n.uncommentSelection)
6679
+ getReferencesAtPosition: mapFilePositionFn(a.getReferencesAtPosition),
6680
+ findReferences: mapFilePositionFn(a.findReferences),
6681
+ getDefinitionAtPosition: mapFilePositionFn(a.getDefinitionAtPosition),
6682
+ getDefinitionAndBoundSpan: mapFilePositionFn(a.getDefinitionAndBoundSpan),
6683
+ getTypeDefinitionAtPosition: mapFilePositionFn(a.getTypeDefinitionAtPosition),
6684
+ getImplementationAtPosition: mapFilePositionFn(a.getImplementationAtPosition),
6685
+ getCompletionsAtPosition: mapFilePositionFn(a.getCompletionsAtPosition),
6686
+ getCompletionEntryDetails: mapFilePositionFn(a.getCompletionEntryDetails),
6687
+ getCompletionEntrySymbol: mapFilePositionFn(a.getCompletionEntrySymbol),
6688
+ getQuickInfoAtPosition: mapFilePositionFn(a.getQuickInfoAtPosition),
6689
+ getBreakpointStatementAtPosition: mapFilePositionFn(a.getBreakpointStatementAtPosition),
6690
+ getSignatureHelpItems: mapFilePositionFn(a.getSignatureHelpItems),
6691
+ getRenameInfo: mapFilePositionFn(a.getRenameInfo),
6692
+ getSmartSelectionRange: mapFilePositionFn(a.getSmartSelectionRange),
6693
+ getDocumentHighlights: mapFilePositionFn(a.getDocumentHighlights),
6694
+ prepareCallHierarchy: mapFilePositionFn(a.prepareCallHierarchy),
6695
+ provideCallHierarchyIncomingCalls: mapFilePositionFn(a.provideCallHierarchyIncomingCalls),
6696
+ provideCallHierarchyOutgoingCalls: mapFilePositionFn(a.provideCallHierarchyOutgoingCalls),
6697
+ getBraceMatchingAtPosition: mapFilePositionFn(a.getBraceMatchingAtPosition),
6698
+ getIndentationAtPosition: mapFilePositionFn(a.getIndentationAtPosition),
6699
+ getFormattingEditsAfterKeystroke: mapFilePositionFn(a.getFormattingEditsAfterKeystroke),
6700
+ getDocCommentTemplateAtPosition: mapFilePositionFn(a.getDocCommentTemplateAtPosition),
6701
+ isValidBraceCompletionAtPosition: mapFilePositionFn(a.isValidBraceCompletionAtPosition),
6702
+ getJsxClosingTagAtPosition: mapFilePositionFn(a.getJsxClosingTagAtPosition),
6703
+ getLinkedEditingRangeAtPosition: mapFilePositionFn(a.getLinkedEditingRangeAtPosition),
6704
+ getSpanOfEnclosingComment: mapFilePositionFn(a.getSpanOfEnclosingComment),
6705
+ getSyntacticClassifications: mapFileTextSpanFn(a.getSyntacticClassifications),
6706
+ getSemanticClassifications: mapFileTextSpanFn(a.getSemanticClassifications),
6707
+ getEncodedSyntacticClassifications: mapFileTextSpanFn(a.getEncodedSyntacticClassifications),
6708
+ getEncodedSemanticClassifications: mapFileTextSpanFn(a.getEncodedSemanticClassifications),
6709
+ provideInlayHints: mapFileTextSpanFn(a.provideInlayHints),
6710
+ getNameOrDottedNameSpan: mapFileStartEndFn(a.getNameOrDottedNameSpan),
6711
+ getFormattingEditsForRange: mapFileStartEndFn(a.getFormattingEditsForRange),
6712
+ getCodeFixesAtPosition: mapFileStartEndFn(a.getCodeFixesAtPosition),
6713
+ getFileReferences: mapFileFn(a.getFileReferences),
6714
+ getNavigationBarItems: mapFileFn(a.getNavigationBarItems),
6715
+ getNavigationTree: mapFileFn(a.getNavigationTree),
6716
+ getOutliningSpans: mapFileFn(a.getOutliningSpans),
6717
+ getTodoComments: mapFileFn(a.getTodoComments),
6718
+ getFormattingEditsForDocument: mapFileFn(a.getFormattingEditsForDocument),
6719
+ getEditsForRefactor: mapFileFn(a.getEditsForRefactor),
6720
+ getEmitOutput: mapFileFn(a.getEmitOutput),
6721
+ getSuggestionDiagnostics: mapFileFn(a.getSuggestionDiagnostics),
6722
+ getSemanticDiagnostics: mapFileFn(a.getSemanticDiagnostics),
6723
+ getSyntacticDiagnostics: mapFileFn(a.getSyntacticDiagnostics),
6724
+ getSupportedCodeFixes: mapFileFn(a.getSupportedCodeFixes),
6725
+ toggleLineComment: mapFileTextRangeFn(a.toggleLineComment),
6726
+ toggleMultilineComment: mapFileTextRangeFn(a.toggleMultilineComment),
6727
+ commentSelection: mapFileTextRangeFn(a.commentSelection),
6728
+ uncommentSelection: mapFileTextRangeFn(a.uncommentSelection)
6696
6729
  });
6697
6730
  };
6698
6731
 
@@ -6875,17 +6908,20 @@ var programFactory = r => {
6875
6908
  var o = new Set(s);
6876
6909
  var l = new Set([ r.rootPath ]);
6877
6910
  for (var c of s) {
6878
- l.add(t.dirname(c));
6879
- }
6880
- for (var u of l) {
6881
- for (var d of i.readDirectory(u, a, [ "**/node_modules" ])) {
6882
- if (!o.has(d)) {
6883
- o.add(d);
6884
- var p = i.readFile(d, "utf8");
6885
- if (p) {
6911
+ var u = t.dirname(c);
6912
+ if (t.isAbsolute(u)) {
6913
+ l.add(u);
6914
+ }
6915
+ }
6916
+ for (var d of l) {
6917
+ for (var p of i.readDirectory(d, a, [ "**/node_modules" ])) {
6918
+ if (!o.has(p)) {
6919
+ o.add(p);
6920
+ var h = i.readFile(p, "utf8");
6921
+ if (h) {
6886
6922
  n.push(f.createSourceFile({
6887
- fileId: d,
6888
- sourceText: p
6923
+ fileId: p,
6924
+ sourceText: h
6889
6925
  }, I.ScriptKind.External));
6890
6926
  }
6891
6927
  }