@codingame/monaco-languageclient-react 4.0.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,19 +10,29 @@ npm install @codingame/monaco-languageclient-react
|
|
|
10
10
|
|
|
11
11
|
#### Simple usage
|
|
12
12
|
|
|
13
|
-
You
|
|
13
|
+
You need to create an `infrastructure` object and render the `LanguageClient` component:
|
|
14
14
|
|
|
15
|
-
```
|
|
15
|
+
```tsx
|
|
16
16
|
import React from "react";
|
|
17
17
|
|
|
18
|
-
import LanguageClient from "@codingame/monaco-languageclient-react";
|
|
18
|
+
import LanguageClient, { Infrastructure } from "@codingame/monaco-languageclient-react";
|
|
19
|
+
|
|
20
|
+
class MyInfrastructure implements Infrastructure {
|
|
21
|
+
automaticTextDocumentUpdate = false
|
|
22
|
+
rootUri = 'file://...'
|
|
23
|
+
useMutualizedProxy() { return false }
|
|
24
|
+
getFileContent(resource, languageClient) { return ... }
|
|
25
|
+
openConnection(id) {
|
|
26
|
+
// create connection
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const infrastructure = new MyInfrastructure()
|
|
19
30
|
|
|
20
31
|
function LanguageClientContainer() {
|
|
21
32
|
return (
|
|
22
33
|
<LanguageClient
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
languageServerUrl={...}
|
|
34
|
+
id='java'
|
|
35
|
+
infrastructure={infrastructure}
|
|
26
36
|
/>
|
|
27
37
|
);
|
|
28
38
|
}
|