Skip to content

Commit

Permalink
doc: Add new features in README
Browse files Browse the repository at this point in the history
  • Loading branch information
CGNonofr committed Jul 5, 2022
1 parent b89a9f4 commit 32991eb
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ This library allows you to use a more convenient way using `StandaloneService.in
Also, monaco-editor doesn't provide good type for them, so this library does it.

Example:
```
```typescript
import { StandaloneService, INotificationService } from 'vscode/services'

class MyCustomNotificationService implements INotificationService { ... }
Expand All @@ -46,6 +46,27 @@ StandaloneService.initialize({
})
```

Additionally, this library exposes 2 modules that include the vscode version of some services (with some glue to make it work with monaco):
- Notification / Dialog: `vscode/service-override/messages`
- Model / Editor: `vscode/service-override/modelEditor`

Usage:
```typescript
import { StandaloneService } from 'vscode/services'
import getModelEditorServiceOverride from 'vscode/service-override/modelEditor'
import getMessageServiceOverride from 'vscode/service-override/messages'

StandaloneServices.initialize({
...getModelEditorServiceOverride((model, input, sideBySide) => {
// Open a new editor here and return it
// It will be called when for instance the user ctrl+click on an import
}),
...getMessageServiceOverride(document.body)
})
```

Note: using `vscode/service-override/modelEditor`, you'll be able to use the `vscode.workspace.registerTextDocumentContentProvider` api

### Installation

```bash
Expand Down

0 comments on commit 32991eb

Please sign in to comment.