mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
perf: consolidate three getState() calls into single await in resolveWebviewView
This commit is contained in:
parent
12cddc9697
commit
53fffd8e12
1 changed files with 22 additions and 28 deletions
|
|
@ -747,35 +747,29 @@ export class ClineProvider
|
|||
|
||||
// Initialize out-of-scope variables that need to receive persistent
|
||||
// global state values.
|
||||
this.getState().then(
|
||||
({
|
||||
terminalShellIntegrationTimeout = Terminal.defaultShellIntegrationTimeout,
|
||||
terminalShellIntegrationDisabled = false,
|
||||
terminalCommandDelay = 0,
|
||||
terminalZshClearEolMark = true,
|
||||
terminalZshOhMy = false,
|
||||
terminalZshP10k = false,
|
||||
terminalPowershellCounter = false,
|
||||
terminalZdotdir = false,
|
||||
}) => {
|
||||
Terminal.setShellIntegrationTimeout(terminalShellIntegrationTimeout)
|
||||
Terminal.setShellIntegrationDisabled(terminalShellIntegrationDisabled)
|
||||
Terminal.setCommandDelay(terminalCommandDelay)
|
||||
Terminal.setTerminalZshClearEolMark(terminalZshClearEolMark)
|
||||
Terminal.setTerminalZshOhMy(terminalZshOhMy)
|
||||
Terminal.setTerminalZshP10k(terminalZshP10k)
|
||||
Terminal.setPowershellCounter(terminalPowershellCounter)
|
||||
Terminal.setTerminalZdotdir(terminalZdotdir)
|
||||
},
|
||||
)
|
||||
const {
|
||||
terminalShellIntegrationTimeout = Terminal.defaultShellIntegrationTimeout,
|
||||
terminalShellIntegrationDisabled = false,
|
||||
terminalCommandDelay = 0,
|
||||
terminalZshClearEolMark = true,
|
||||
terminalZshOhMy = false,
|
||||
terminalZshP10k = false,
|
||||
terminalPowershellCounter = false,
|
||||
terminalZdotdir = false,
|
||||
ttsEnabled,
|
||||
ttsSpeed,
|
||||
} = await this.getState()
|
||||
|
||||
this.getState().then(({ ttsEnabled }) => {
|
||||
setTtsEnabled(ttsEnabled ?? false)
|
||||
})
|
||||
|
||||
this.getState().then(({ ttsSpeed }) => {
|
||||
setTtsSpeed(ttsSpeed ?? 1)
|
||||
})
|
||||
Terminal.setShellIntegrationTimeout(terminalShellIntegrationTimeout)
|
||||
Terminal.setShellIntegrationDisabled(terminalShellIntegrationDisabled)
|
||||
Terminal.setCommandDelay(terminalCommandDelay)
|
||||
Terminal.setTerminalZshClearEolMark(terminalZshClearEolMark)
|
||||
Terminal.setTerminalZshOhMy(terminalZshOhMy)
|
||||
Terminal.setTerminalZshP10k(terminalZshP10k)
|
||||
Terminal.setPowershellCounter(terminalPowershellCounter)
|
||||
Terminal.setTerminalZdotdir(terminalZdotdir)
|
||||
setTtsEnabled(ttsEnabled ?? false)
|
||||
setTtsSpeed(ttsSpeed ?? 1)
|
||||
|
||||
// Set up webview options with proper resource roots
|
||||
const resourceRoots = [this.contextProxy.extensionUri]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue