Skip to content

Commit 3d3f31a

Browse files
committed
doc: Add editor configuration section
1 parent 88ebeba commit 3d3f31a

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,29 @@ Note: using `vscode/service-override/modelEditor`, you'll be able to use the `vs
7777
`StandaloneServices.initialize` can only be called once (note that `monaco.editor.create` calls `StandaloneServices.initialize`).
7878

7979
Also, a service that is used cannot be overriden anymore. So `StandaloneServices.initialize` should be called as soon as possible to prevent most of the issues.
80+
81+
## Editor configuration
82+
83+
The editors created using `monaco.editor.create` don't use the configuration from the configurationService.
84+
85+
This library exposes functions to create editors binded on the configuration:
86+
87+
before:
88+
```typescript
89+
import * as monaco from 'monaco-editor'
90+
monaco.editor.create(...)
91+
```
92+
93+
after:
94+
```typescript
95+
import { createConfiguredEditor } from 'vscode/monaco'
96+
97+
createConfiguredEditor(...)
98+
```
99+
100+
`createConfiguredEditor` returns a subclass of what is returned by `monaco.editor.create`, the `updateOptions` method can still be used.
101+
The only difference is that is will use the `configurationService` as a default configuration
102+
80103
### Installation
81104

82105
```bash

0 commit comments

Comments
 (0)