提交 443116c7 编写于 作者: J Johannes Rieken

💄

上级 84658d7a
......@@ -159,7 +159,7 @@ export class OneSnippet {
export class SnippetSession {
static normalizeWhitespace(model: IModel, position: IPosition, template: string): string {
static adjustWhitespace(model: IModel, position: IPosition, template: string): string {
const line = model.getLineContent(position.lineNumber);
const lineLeadingWhitespace = getLeadingWhitespace(line, 0, position.column - 1);
......@@ -236,7 +236,7 @@ export class SnippetSession {
// adjust the template string to match the indentation and
// whitespace rules of this insert location (can be different for each cursor)
const start = snippetSelection.getStartPosition();
const adjustedTemplate = SnippetSession.normalizeWhitespace(model, start, template);
const adjustedTemplate = SnippetSession.adjustWhitespace(model, start, template);
const snippet = SnippetParser.parse(adjustedTemplate).resolveVariables(new EditorSnippetVariableResolver(model, snippetSelection));
const offset = model.getOffsetAt(start) + delta;
......
......@@ -41,7 +41,7 @@ suite('SnippetSession', function () {
test('normalize whitespace', function () {
function assertNormalized(position: IPosition, input: string, expected: string): void {
const actual = SnippetSession.normalizeWhitespace(model, position, input);
const actual = SnippetSession.adjustWhitespace(model, position, input);
assert.equal(actual, expected);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册