This repository was archived by the owner on May 20, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 - z A - 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 :
Original file line number Diff line number Diff line change 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- } ) ;
You can’t perform that action at this time.
0 commit comments