small fixes; fixed tests

This commit is contained in:
Gabriela Araujo Britto committed 2021-10-12 15:24:06 -07:00
1 parent 69ee9fc069
commit c3a64bcb17
8 files changed
+66 -91

No files matched your search

-4
View File
@@ -4551,10 +4551,6 @@ namespace ts {
writer.write(s);
}
function escapeSnippetText(text: string): string {
return text.replace(/\$/gm, "\\$");
}
function increaseIndent() {
writer.increaseIndent();
}
+4
View File
@@ -7419,4 +7419,8 @@ namespace ts {
export function isFunctionExpressionOrArrowFunction(node: Node): node is FunctionExpression | ArrowFunction {
return node.kind === SyntaxKind.FunctionExpression || node.kind === SyntaxKind.ArrowFunction;
}
export function escapeSnippetText(text: string): string {
return text.replace(/\$/gm, "\\$");
}
}
-5
View File
@@ -909,11 +909,6 @@ namespace ts.Completions {
}
}
// TODO: move to services/utilities?
function escapeSnippetText(text: string): string {
return text.replace(/\$/gm, "\\$");
}
function originToCompletionEntryData(origin: SymbolOriginInfoExport): CompletionEntryData | undefined {
return {
exportName: origin.exportName,
-56
View File
@@ -1,56 +0,0 @@
/* eslint-disable no-fallthrough */
/* @internal */
namespace ts.snippets {
// interface SnippetWriter extends EmitTextWriter, PrintHandlers {}
// function createSnippetWriter(newLine: string): SnippetWriter {
// const substituteNode = (_hint: EmitHint, node: Node) => {
// switch (node.kind) {
// // Comments:
// // TODO: doesn't work because comments are `TextRanges` with a syntax kind, but are not nodes.
// // case SyntaxKind.SingleLineCommentTrivia:
// // case SyntaxKind.MultiLineCommentTrivia:
// // return escapeTrivia(node);
// // >> comments are emitted in previous phase
// // String-like literals:
// case SyntaxKind.StringLiteral: // >> emitLiteral
// return escapeLiteralLikeNode(node as StringLiteral);
// case SyntaxKind.RegularExpressionLiteral: // >> emitLiteral
// return escapeLiteralLikeNode(node as RegularExpressionLiteral);
// case SyntaxKind.NoSubstitutionTemplateLiteral: // >> emitLiteral
// // Has .rawText but also .text
// // Templates:
// // >> .rawText
// case SyntaxKind.TemplateHead: // >> emitLiteral
// case SyntaxKind.TemplateMiddle: // >> emitLiteral
// case SyntaxKind.TemplateTail: // >> emitLiteral
// // Identifiers:
// case SyntaxKind.Identifier: // >> emitIdentifier
// case SyntaxKind.PrivateIdentifier: // >> emitPrivateIdentifier
// // Other:
// // >> TODO: JSX? JSDoc?
// return undefined;
// }
// return node;
// };
// const writer = createTextWriter(newLine);
// return {
// ...writer,
// substituteNode,
// };
// }
// function escapeLiteralLikeNode<T extends LiteralLikeNode>(node: T): T {
// const copy = getSynthesizedDeepClone(node);
// copy.text = escapeSnippetText(node.text);
// return copy;
// }
// function escapeSnippetText(text: string): string {
// return text.replace(/\$/gm, "\\$");
// }
}
-1
View File
@@ -33,7 +33,6 @@
"preProcess.ts",
"rename.ts",
"smartSelection.ts",
"snippets.ts",
"signatureHelp.ts",
"inlayHints.ts",
"sourcemaps.ts",