Skip to content

Commit

Permalink
feat: expose a method to use global picker
Browse files Browse the repository at this point in the history
  • Loading branch information
Loïc Mangeonjean committed Jan 25, 2024
1 parent 8512eb0 commit fd44960
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { updateUserConfiguration, registerConfigurations, registerDefaultConfigu
import { getMonacoLanguage, loadLanguage } from './languages'
import { updateKeybindings, updateEditorKeybindingsMode } from './keybindings'
import './style'
import { setUseGlobalPicker } from './services'
export * from './tools'

export {
Expand All @@ -24,5 +25,6 @@ export {

getMonacoLanguage,
registerEditorOpenHandler,
loadLanguage
loadLanguage,
setUseGlobalPicker
}
9 changes: 6 additions & 3 deletions src/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,19 @@ import getStorageServiceOverride from '@codingame/monaco-vscode-storage-service-
import getLifecycleServiceOverride from '@codingame/monaco-vscode-lifecycle-service-override'
import getQuickAccessServiceOverride from '@codingame/monaco-vscode-quickaccess-service-override'
import { ILogService, LogLevel, StandaloneServices, initialize as initializeServices } from 'vscode/services'
import { initialize as initializeExtensions } from 'vscode/extensions'
import * as monaco from 'monaco-editor'
import EditorOpenHandlerRegistry from './tools/EditorOpenHandlerRegistry'

const editorOpenHandlerRegistry = new EditorOpenHandlerRegistry()

let _useGlobalPicker: boolean = false
export function setUseGlobalPicker (useGlobalPicker: boolean = true): void {
_useGlobalPicker = useGlobalPicker
}

export function useGlobalPicker (): boolean {
// TODO should picker and keybindings be global or per-editor
return false
// should picker and keybindings be global or per-editor
return _useGlobalPicker
}

let services: monaco.editor.IEditorOverrideServices = {
Expand Down

0 comments on commit fd44960

Please sign in to comment.