mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
small fixes; fixed tests
This commit is contained in:
1 parent
69ee9fc069
commit
c3a64bcb17
8 files changed
+66
-91
No files matched your search
@@ -4551,10 +4551,6 @@ namespace ts {
|
||||
writer.write(s);
|
||||
}
|
||||
|
||||
function escapeSnippetText(text: string): string {
|
||||
return text.replace(/\$/gm, "\\$");
|
||||
}
|
||||
|
||||
function increaseIndent() {
|
||||
writer.increaseIndent();
|
||||
}
|
||||
|
||||
@@ -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, "\\$");
|
||||
}
|
||||
}
|
||||
@@ -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,
|
||||
|
||||
@@ -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, "\\$");
|
||||
// }
|
||||
}
|
||||
@@ -33,7 +33,6 @@
|
||||
"preProcess.ts",
|
||||
"rename.ts",
|
||||
"smartSelection.ts",
|
||||
"snippets.ts",
|
||||
"signatureHelp.ts",
|
||||
"inlayHints.ts",
|
||||
"sourcemaps.ts",
|
||||
|
||||
Reference in new issue
Block a user