@@ -3,7 +3,7 @@ import StateInspector from '@front/features/inspector/StateInspector.vue'
33import EmptyPane from ' @front/features/layout/EmptyPane.vue'
44
55import { computed , defineComponent , ref , watch } from ' vue'
6- import { SharedData , copyToClipboard , getComponentDisplayName } from ' @vue-devtools/shared-utils'
6+ import { SharedData , copyToClipboard , getComponentDisplayName , openInEditor } from ' @vue-devtools/shared-utils'
77import { onKeyDown } from ' @front/util/keyboard'
88import RenderCode from ' ./RenderCode.vue'
99import { useSelectedComponent } from ' ./composable'
@@ -16,6 +16,8 @@ export default defineComponent({
1616 },
1717
1818 setup() {
19+ const openInEditorButton = ref ()
20+
1921 const selectedComponent = useSelectedComponent ()
2022 const displayName = computed (() => getComponentDisplayName (selectedComponent .data .value ?.name ?? ' ' , SharedData .componentNameStyle ))
2123
@@ -38,6 +40,14 @@ export default defineComponent({
3840 stateFilterInput .value .focus ()
3941 return false
4042 }
43+
44+ if (([' o' , ' o' , ' щ' ]).includes (event .key ) && event .altKey ) {
45+ const file = selectedComponent .data .value ?.file
46+ if (file ) {
47+ openInEditor (file )
48+ }
49+ return false
50+ }
4151 }, true )
4252
4353 const sameApp = computed (() => selectedComponent .data .value ?.id .split (' :' )[0 ] === selectedComponentId .value ?.split (' :' )[0 ])
@@ -63,6 +73,7 @@ export default defineComponent({
6373 sameApp ,
6474 copyName ,
6575 showCopiedName ,
76+ openInEditorButton ,
6677 }
6778 },
6879})
@@ -128,6 +139,7 @@ export default defineComponent({
128139
129140 <VueButton
130141 v-if =" fileIsPath"
142+ v-ref =" openInEditorButton"
131143 v-tooltip =" {
132144 content: $t('ComponentInspector.openInEditor.tooltip', { file: data.file }),
133145 html: true,
0 commit comments