Skip to content

Commit

Permalink
feat: add some optional features
Browse files Browse the repository at this point in the history
  • Loading branch information
Loïc Mangeonjean committed Oct 16, 2023
1 parent f47eaf8 commit d8904cc
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 1 deletion.
32 changes: 32 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,38 @@
"exports": {
".": {
"default": "./dist/main.js"
},
"./features/views": {
"types": "./dist/features/views.d.ts",
"default": "./dist/features/views.js"
},
"./features/viewPanels": {
"types": "./dist/features/viewPanels.d.ts",
"default": "./dist/features/viewPanels.js"
},
"./features/debug": {
"types": "./dist/features/debug.d.ts",
"default": "./dist/features/debug.js"
},
"./features/search": {
"types": "./dist/features/search.d.ts",
"default": "./dist/features/search.js"
}
},
"typesVersions": {
"*": {
"features/views": [
"./dist/features/views.d.ts"
],
"features/viewPanels": [
"./dist/features/viewPanels.d.ts"
],
"features/debug": [
"./dist/features/debug.d.ts"
],
"features/search": [
"./dist/features/search.d.ts"
]
}
},
"files": [
Expand Down
6 changes: 5 additions & 1 deletion rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ const extensions = ['.js', '.ts']
export default rollup.defineConfig({
cache: false,
input: {
main: 'src/index.ts'
main: 'src/index.ts',
'features/views': 'src/features/views.ts',
'features/viewPanels': 'src/features/viewPanels.ts',
'features/search': 'src/features/search.ts',
'features/debug': 'src/features/debug.ts'
},
external: function isExternal (source, importer, isResolved) {
if (isResolved) {
Expand Down
6 changes: 6 additions & 0 deletions src/features/debug.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import getDebugServiceOverride from '@codingame/monaco-vscode-debug-service-override'
import { registerServices } from '../services'

registerServices({
...getDebugServiceOverride()
})
8 changes: 8 additions & 0 deletions src/features/search.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import getSearchServiceOverride from '@codingame/monaco-vscode-search-service-override'
import { registerServices } from '../services'

import '@codingame/monaco-vscode-search-result-default-extension'

registerServices({
...getSearchServiceOverride()
})
12 changes: 12 additions & 0 deletions src/features/viewPanels.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import getMarkersServiceOverride from '@codingame/monaco-vscode-markers-service-override'
import getOutputServiceOverride from '@codingame/monaco-vscode-output-service-override'
import { registerServices } from '../services'
import { registerWorkerLoader } from '../worker'
import '@codingame/monaco-vscode-references-view-default-extension'

registerWorkerLoader('outputLinkComputer', () => new Worker(new URL('@codingame/monaco-vscode-output-service-override/worker', import.meta.url)))

registerServices({
...getOutputServiceOverride(),
...getMarkersServiceOverride()
})
28 changes: 28 additions & 0 deletions src/features/views.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import getViewsServiceOverride from '@codingame/monaco-vscode-views-service-override'
import getOutputServiceOverride from '@codingame/monaco-vscode-output-service-override'
import getStatusBarServiceOverride from '@codingame/monaco-vscode-view-status-bar-service-override'
import getMarkersServiceOverride from '@codingame/monaco-vscode-markers-service-override'
import getQuickAccessServiceOverride from '@codingame/monaco-vscode-quickaccess-service-override'
import { editorOpenHandlerRegistry, registerServices, useGlobalPicker } from '../services'

import '@codingame/monaco-vscode-theme-seti-default-extension'
import '@codingame/monaco-vscode-media-preview-default-extension'
import '@codingame/monaco-vscode-markdown-language-features-default-extension'
import '@codingame/monaco-vscode-markdown-math-default-extension'

registerServices({
...getViewsServiceOverride((model, input, sideBySide) => {
return editorOpenHandlerRegistry.openCodeEditor(model, input, sideBySide)
}),
...getOutputServiceOverride(),
...getStatusBarServiceOverride(),
...getMarkersServiceOverride(),
...getQuickAccessServiceOverride({
shouldUseGlobalPicker () {
return useGlobalPicker()
},
isKeybindingConfigurationVisible () {
return true
}
})
})

0 comments on commit d8904cc

Please sign in to comment.