Skip to content

Commit f62ee4e

Browse files
author
Loïc Mangeonjean
committed
feat!: add a way to force the global picker even when standalone editors
1 parent 9e958df commit f62ee4e

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

demo/src/setup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ await initializeMonacoService({
8484
...getSnippetServiceOverride(),
8585
...getQuickAccessServiceOverride({
8686
isKeybindingConfigurationVisible: isEditorPartVisible,
87-
shouldUseGlobalPicker: isEditorPartVisible
87+
shouldUseGlobalPicker: (_editor, isStandalone) => !isStandalone && isEditorPartVisible()
8888
}),
8989
...getOutputServiceOverride(),
9090
...getTerminalServiceOverride(new TerminalBackend()),

src/service-override/quickaccess.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ import 'vs/workbench/contrib/codeEditor/browser/quickaccess/gotoLineQuickAccess'
1515
import 'vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess'
1616
import 'vs/workbench/browser/actions/quickAccessActions'
1717
import 'vs/workbench/contrib/quickaccess/browser/quickAccess.contribution'
18+
import { ICodeEditor } from 'vs/editor/browser/editorBrowser'
1819

1920
let isKeybindingConfigurationVisible = () => {
2021
return false
2122
}
22-
let shouldUseGlobalPicker = () => {
23+
let shouldUseGlobalPicker = (_activeCodeEditor: ICodeEditor | null, _activeCodeEditorStandalone: boolean) => {
2324
return false
2425
}
2526

@@ -50,7 +51,8 @@ class DelegateQuickInputService implements IQuickInputService {
5051

5152
private get activeService (): IQuickInputService {
5253
const activeCodeEditor = StandaloneServices.get(ICodeEditorService).getFocusedCodeEditor()
53-
if (!(activeCodeEditor instanceof StandaloneCodeEditor) && shouldUseGlobalPicker()) {
54+
55+
if (shouldUseGlobalPicker(activeCodeEditor, activeCodeEditor instanceof StandaloneCodeEditor)) {
5456
return this.workbenchQuickInputService
5557
}
5658

@@ -112,7 +114,7 @@ class DelegateQuickInputService implements IQuickInputService {
112114

113115
interface QuickAccessProps {
114116
isKeybindingConfigurationVisible?: () => boolean
115-
shouldUseGlobalPicker?: () => boolean
117+
shouldUseGlobalPicker?: (activeCodeEditor: ICodeEditor | null, activeCodeEditorStandalone: boolean) => boolean
116118
}
117119

118120
export default function getServiceOverride ({

0 commit comments

Comments
 (0)