Skip to content
This repository was archived by the owner on May 20, 2026. It is now read-only.

Commit b168a4f

Browse files
committed
nes: remove dead code
1 parent 774d852 commit b168a4f

2 files changed

Lines changed: 0 additions & 24 deletions

File tree

src/extension/xtab/node/xtabProvider.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -788,13 +788,6 @@ export class XtabProvider implements IStatelessNextEditProvider {
788788
return new OffsetRange(codeToEditStart, codeToEditEndExcl);
789789
}
790790

791-
792-
public static getBacktickSection(text: string): string {
793-
const textTrimmedStart = text.replace(/^\`\`\`[a-zA-Z]*\r?\n/, '');
794-
const textTrimmedEnd = textTrimmedStart.replace(/(\r?\n)\`\`\`$/, '');
795-
return textTrimmedEnd;
796-
}
797-
798791
private static mapChatFetcherErrorToNoNextEditReason(fetchError: ChatFetchError): NoNextEditReason {
799792
switch (fetchError.type) {
800793
case ChatFetchResponseType.Canceled:

src/extension/xtab/test/node/xtabProvider.spec.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,3 @@
22
* Copyright (c) Microsoft Corporation. All rights reserved.
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
5-
6-
import { expect, suite, test } from 'vitest';
7-
import { XtabProvider } from '../../node/xtabProvider';
8-
9-
suite('remove backticks', () => {
10-
test('remove backticks', () => {
11-
const code = `\`\`\`python\nfoo bar\njar\n\`\`\``;
12-
13-
expect(JSON.stringify(XtabProvider.getBacktickSection(code))).toMatchInlineSnapshot(`""foo bar\\njar""`);
14-
});
15-
16-
test('remove backticks - preserve carriage returns', () => {
17-
const code = `\`\`\`python\r\nfoo bar\r\njar\r\n\`\`\``;
18-
19-
expect(JSON.stringify(XtabProvider.getBacktickSection(code))).toMatchInlineSnapshot(`""foo bar\\r\\njar""`);
20-
});
21-
});

0 commit comments

Comments
 (0)