Skip to content

Commit f14bce8

Browse files
committed
fix: remove the available launch editors limit, closes #95, #96
1 parent eb52002 commit f14bce8

File tree

1 file changed

+4
-25
lines changed

1 file changed

+4
-25
lines changed

packages/core/src/index.ts

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ export interface VitePluginInspectorOptions {
107107
/**
108108
* Target editor when open in editor (v5.1.0+)
109109
*
110-
* @default code (Visual Studio Code)
110+
* @default process.env.LAUNCH_EDITOR ?? code (Visual Studio Code)
111111
*/
112-
launchEditor?: 'appcode' | 'atom' | 'atom-beta' | 'brackets' | 'clion' | 'code' | 'code-insiders' | 'codium' | 'emacs' | 'idea' | 'notepad++' | 'pycharm' | 'phpstorm' | 'rubymine' | 'sublime' | 'vim' | 'visualstudio' | 'webstorm'
112+
launchEditor?: 'appcode' | 'atom' | 'atom-beta' | 'brackets' | 'clion' | 'code' | 'code-insiders' | 'codium' | 'emacs' | 'idea' | 'notepad++' | 'pycharm' | 'phpstorm' | 'rubymine' | 'sublime' | 'vim' | 'visualstudio' | 'webstorm' | 'rider' | string
113113
}
114114

115115
const toggleComboKeysMap = {
@@ -135,30 +135,9 @@ export const DEFAULT_INSPECTOR_OPTIONS: VitePluginInspectorOptions = {
135135
toggleButtonPos: 'top-right',
136136
appendTo: '',
137137
lazyLoad: false,
138-
launchEditor: (process.env.LAUNCH_EDITOR ?? 'code') as VitePluginInspectorOptions['launchEditor'],
138+
launchEditor: process.env.LAUNCH_EDITOR ?? 'code',
139139
} as const
140140

141-
const availableLaunchEditors = [
142-
'appcode',
143-
'atom',
144-
'atom-beta',
145-
'brackets',
146-
'clion',
147-
'code',
148-
'code-insiders',
149-
'codium',
150-
'emacs',
151-
'idea',
152-
'notepad++',
153-
'pycharm',
154-
'phpstorm',
155-
'rubymine',
156-
'sublime',
157-
'vim',
158-
'visualstudio',
159-
'webstorm',
160-
]
161-
162141
function VitePluginInspector(options: VitePluginInspectorOptions = DEFAULT_INSPECTOR_OPTIONS): PluginOption {
163142
const inspectorPath = getInspectorPath()
164143
const normalizedOptions = {
@@ -173,7 +152,7 @@ function VitePluginInspector(options: VitePluginInspectorOptions = DEFAULT_INSPE
173152
cleanHtml = vue === 3, // Only enabled for Vue 3 by default
174153
} = normalizedOptions
175154

176-
if (normalizedOptions.launchEditor && availableLaunchEditors.includes(normalizedOptions.launchEditor))
155+
if (normalizedOptions.launchEditor)
177156
process.env.LAUNCH_EDITOR = normalizedOptions.launchEditor
178157

179158
return [

0 commit comments

Comments
 (0)