✨ automatic config updates
This commit is contained in:
parent
d3a0c35a83
commit
4c315b2d28
4 changed files with 21 additions and 5 deletions
|
|
@ -18,14 +18,17 @@ export class ConfigHandler {
|
|||
private readonly ide: IDE;
|
||||
private readonly remoteConfigServerUrl: URL | undefined;
|
||||
private readonly writeLog: (text: string) => void;
|
||||
private readonly onConfigUpdate: () => void;
|
||||
constructor(
|
||||
ide: IDE,
|
||||
remoteConfigServerUrl: URL | undefined,
|
||||
writeLog: (text: string) => void
|
||||
writeLog: (text: string) => void,
|
||||
onConfigUpdate: () => void
|
||||
) {
|
||||
this.ide = ide;
|
||||
this.remoteConfigServerUrl = remoteConfigServerUrl;
|
||||
this.writeLog = writeLog;
|
||||
this.onConfigUpdate = onConfigUpdate;
|
||||
try {
|
||||
this.loadConfig();
|
||||
} catch (e) {
|
||||
|
|
@ -37,6 +40,7 @@ export class ConfigHandler {
|
|||
this.savedConfig = undefined;
|
||||
this.savedBrowserConfig = undefined;
|
||||
this.loadConfig();
|
||||
this.onConfigUpdate()
|
||||
}
|
||||
|
||||
async getSerializedConfig(): Promise<BrowserSerializedContinueConfig> {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ async function* chunkDocumentWithoutId(
|
|||
}
|
||||
return;
|
||||
} catch (e) {
|
||||
console.error(`Failed to parse ${filepath}: `, e);
|
||||
// console.error(`Failed to parse ${filepath}: `, e);
|
||||
// falls back to basicChunker
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,8 @@ export class VsCodeExtension {
|
|||
"=========================================================================="
|
||||
);
|
||||
outputChannel.append(log);
|
||||
}
|
||||
},
|
||||
() => this.webviewProtocol?.request("configUpdate", undefined)
|
||||
);
|
||||
|
||||
this.configHandler.reloadConfig();
|
||||
|
|
|
|||
|
|
@ -354,8 +354,11 @@ function TipTapEditor(props: TipTapEditorProps) {
|
|||
}
|
||||
|
||||
props.onEnter(json);
|
||||
editor.commands.clearContent(true);
|
||||
}, [props.onEnter, editor]);
|
||||
|
||||
if (props.isMainInput) {
|
||||
editor.commands.clearContent(true);
|
||||
}
|
||||
}, [props.onEnter, editor, props.isMainInput]);
|
||||
|
||||
// This is a mechanism for overriding the IDE keyboard shortcut when inside of the webview
|
||||
const [ignoreHighlightedCode, setIgnoreHighlightedCode] = useState(false);
|
||||
|
|
@ -382,6 +385,14 @@ function TipTapEditor(props: TipTapEditorProps) {
|
|||
};
|
||||
}, []);
|
||||
|
||||
// Re-focus main input after done generating
|
||||
const active = useSelector((state: RootState) => state.state.active);
|
||||
useEffect(() => {
|
||||
if (editor && !active && props.isMainInput) {
|
||||
editor.commands.focus();
|
||||
}
|
||||
}, [props.isMainInput, active,editor])
|
||||
|
||||
// IDE event listeners
|
||||
useWebviewListener(
|
||||
"userInput",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue