-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(agent): clean up experimental post-processing features. (#1973)
* chore(agent): clean up experimental syntax features. * fix: lint
- Loading branch information
Showing
24 changed files
with
55 additions
and
1,136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 2 additions & 15 deletions
17
clients/tabby-agent/src/postprocess/calculateReplaceRange.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,11 @@ | ||
import { AgentConfig } from "../AgentConfig"; | ||
import { isBrowser } from "../env"; | ||
import { PostprocessChoiceFilter, logger } from "./base"; | ||
import { PostprocessChoiceFilter } from "./base"; | ||
import { calculateReplaceRangeByBracketStack } from "./calculateReplaceRangeByBracketStack"; | ||
import { calculateReplaceRangeBySyntax } from "./calculateReplaceRangeBySyntax"; | ||
|
||
export function calculateReplaceRange( | ||
config: AgentConfig["postprocess"]["calculateReplaceRange"], | ||
_config: AgentConfig["postprocess"]["calculateReplaceRange"], | ||
): PostprocessChoiceFilter { | ||
return async (choice, context) => { | ||
const preferSyntaxParser = | ||
!isBrowser && // syntax parser is not supported in browser yet | ||
config.experimentalSyntax; | ||
|
||
if (preferSyntaxParser) { | ||
try { | ||
return await calculateReplaceRangeBySyntax(choice, context); | ||
} catch (error) { | ||
logger.debug({ error }, "Failed to calculate replace range by syntax parser"); | ||
} | ||
} | ||
return calculateReplaceRangeByBracketStack(choice, context); | ||
}; | ||
} |
163 changes: 0 additions & 163 deletions
163
clients/tabby-agent/src/postprocess/calculateReplaceRangeBySyntax.test.ts
This file was deleted.
Oops, something went wrong.
64 changes: 0 additions & 64 deletions
64
clients/tabby-agent/src/postprocess/calculateReplaceRangeBySyntax.ts
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
clients/tabby-agent/src/postprocess/golden/limit_scope/experimental_block_01.toml
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
clients/tabby-agent/src/postprocess/golden/limit_scope/experimental_block_02.toml
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.