File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ This library allows you to use a more convenient way using `StandaloneService.in
3535Also, monaco-editor doesn't provide good type for them, so this library does it.
3636
3737Example:
38- ```
38+ ``` typescript
3939import { StandaloneService , INotificationService } from ' vscode/services'
4040
4141class MyCustomNotificationService implements INotificationService { ... }
@@ -46,6 +46,27 @@ StandaloneService.initialize({
4646})
4747```
4848
49+ Additionally, this library exposes 2 modules that include the vscode version of some services (with some glue to make it work with monaco):
50+ - Notification / Dialog: ` vscode/service-override/messages `
51+ - Model / Editor: ` vscode/service-override/modelEditor `
52+
53+ Usage:
54+ ``` typescript
55+ import { StandaloneService } from ' vscode/services'
56+ import getModelEditorServiceOverride from ' vscode/service-override/modelEditor'
57+ import getMessageServiceOverride from ' vscode/service-override/messages'
58+
59+ StandaloneServices .initialize ({
60+ ... getModelEditorServiceOverride ((model , input , sideBySide ) => {
61+ // Open a new editor here and return it
62+ // It will be called when for instance the user ctrl+click on an import
63+ }),
64+ ... getMessageServiceOverride (document .body )
65+ })
66+ ```
67+
68+ Note: using ` vscode/service-override/modelEditor ` , you'll be able to use the ` vscode.workspace.registerTextDocumentContentProvider ` api
69+
4970### Installation
5071
5172``` bash
You can’t perform that action at this time.
0 commit comments