mirror of
https://github.com/enso-org/enso.git
synced 2024-12-23 02:01:47 +03:00
Add profiling shortcuts to GUI2 (#8406)
- Closes #8404 # Important Notes - All relevant documentation has already been updated in #8358. - I've tested that the keyboard shortcuts send appropriate messages over the LS connection, and have confirmed that a non-error response is received, but I'm not sure that the profiling actually works. - There seem to be no entries in `~/.enso/`, nor in `~/enso/`
This commit is contained in:
parent
a38680adf4
commit
93a4937cc4
@ -380,6 +380,16 @@ export class LanguageServer extends ObservableV2<Notifications> {
|
||||
return this.request('runtime/getComponentGroups', {})
|
||||
}
|
||||
|
||||
/** [Documentation](https://github.com/enso-org/enso/blob/develop/docs/language-server/protocol-language-server.md#profilingstart) */
|
||||
profilingStart(memorySnapshot?: boolean): Promise<void> {
|
||||
return this.request('profiling/start', { memorySnapshot })
|
||||
}
|
||||
|
||||
/** [Documentation](https://github.com/enso-org/enso/blob/develop/docs/language-server/protocol-language-server.md#profilingstop) */
|
||||
profilingStop(): Promise<void> {
|
||||
return this.request('profiling/stop', {})
|
||||
}
|
||||
|
||||
/** A helper function to subscribe to file updates.
|
||||
* Please use `ls.on('file/event')` directly if the initial `'Added'` notifications are not
|
||||
* needed. */
|
||||
|
@ -30,6 +30,8 @@ export const graphBindings = defineKeybinds('graph-editor', {
|
||||
deselectAll: ['Escape', 'PointerMain'],
|
||||
copyNode: ['Mod+C'],
|
||||
pasteNode: ['Mod+V'],
|
||||
startProfiling: ['Mod+Alt+,'],
|
||||
stopProfiling: ['Mod+Alt+.'],
|
||||
})
|
||||
|
||||
export const selectionMouseBindings = defineKeybinds('selection', {
|
||||
|
@ -132,6 +132,12 @@ const graphBindingsHandler = graphBindings.handler({
|
||||
redo() {
|
||||
projectStore.module?.undoManager.redo()
|
||||
},
|
||||
startProfiling() {
|
||||
projectStore.lsRpcConnection.then((ls) => ls.profilingStart(true))
|
||||
},
|
||||
stopProfiling() {
|
||||
projectStore.lsRpcConnection.then((ls) => ls.profilingStop())
|
||||
},
|
||||
openComponentBrowser() {
|
||||
if (keyboardBusy()) return false
|
||||
if (graphNavigator.sceneMousePos != null && !componentBrowserVisible.value) {
|
||||
|
Loading…
Reference in New Issue
Block a user