File tree 4 files changed +32
-2
lines changed
4 files changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -184,6 +184,7 @@ export interface VSCodeTunnelOptions {
184
184
export interface NuxtDevToolsOptions {
185
185
behavior : {
186
186
telemetry : boolean | null
187
+ openInEditor : string | undefined
187
188
}
188
189
ui : {
189
190
componentsGraphShowGlobalComponents : boolean
Original file line number Diff line number Diff line change @@ -24,8 +24,23 @@ const {
24
24
sidebarScrollable,
25
25
} = useDevToolsOptions (' ui' )
26
26
27
+ const {
28
+ openInEditor,
29
+ } = useDevToolsOptions (' behavior' )
30
+
27
31
const client = useClient ()
28
32
33
+ const editorOptions = [
34
+ [' Auto' , undefined ],
35
+ [' VS Code' , ' vscode' ],
36
+ [' VS Code Insider' , ' vscode-insider' ],
37
+ [' Cursor' , ' cursor' ],
38
+ [' Zed' , ' zed' ],
39
+ [' WebStorm' , ' webstorm' ],
40
+ [' Sublime Text' , ' sublime' ],
41
+ [' Atom' , ' atom' ],
42
+ ]
43
+
29
44
const scaleOptions = [
30
45
[' Tiny' , 12 / 15 ],
31
46
[' Small' , 14 / 15 ],
@@ -227,6 +242,15 @@ watchEffect(() => {
227
242
{{ i[0] }}
228
243
</option >
229
244
</NSelect >
245
+
246
+ <div mx--2 my1 h-1px border =" b base" op75 />
247
+
248
+ <p >Open In Editor</p >
249
+ <NSelect v-model =" openInEditor" n-primary >
250
+ <option v-for =" i of editorOptions" :key =" i[0]" :value =" i[1]" >
251
+ {{ i[0] }}
252
+ </option >
253
+ </NSelect >
230
254
</NCard >
231
255
232
256
<h3 mt2 text-lg >
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ export const defaultOptions: ModuleOptions = {
21
21
export const defaultTabOptions : NuxtDevToolsOptions = {
22
22
behavior : {
23
23
telemetry : null ,
24
+ openInEditor : undefined ,
24
25
} ,
25
26
ui : {
26
27
componentsView : 'list' ,
Original file line number Diff line number Diff line change @@ -7,11 +7,12 @@ import { logger } from '@nuxt/kit'
7
7
import { colors } from 'consola/utils'
8
8
import destr from 'destr'
9
9
import { resolve } from 'pathe'
10
-
11
10
import { snakeCase } from 'scule'
11
+
12
12
import { resolveBuiltinPresets } from 'unimport'
13
13
import { getDevAuthToken } from '../dev-auth'
14
14
import { setupHooksDebug } from '../runtime/shared/hooks'
15
+ import { getOptions } from './options'
15
16
16
17
export function setupGeneralRPC ( {
17
18
nuxt,
@@ -181,8 +182,11 @@ export function setupGeneralRPC({
181
182
if ( result )
182
183
return true
183
184
}
185
+ let editor = getOptions ( ) ?. behavior . openInEditor ?? undefined
186
+ if ( editor === 'auto' )
187
+ editor = undefined
184
188
// @ts -expect-error missin types
185
- await import ( 'launch-editor' ) . then ( r => ( r . default || r ) ( path + suffix ) )
189
+ await import ( 'launch-editor' ) . then ( r => ( r . default || r ) ( path + suffix , editor ) )
186
190
return true
187
191
}
188
192
catch ( e ) {
You can’t perform that action at this time.
0 commit comments