npm install @codingame/monaco-languageclient-react
You need to create an infrastructure
object and render the LanguageClient
component:
import React from "react";
import LanguageClient, { Infrastructure } from "@codingame/monaco-languageclient-react";
class MyInfrastructure implements Infrastructure {
automaticTextDocumentUpdate = false
rootUri = 'file://...'
useMutualizedProxy() { return false }
getFileContent(resource, languageClient) { return ... }
openConnection(id) {
// create connection
}
}
const infrastructure = new MyInfrastructure()
function LanguageClientContainer() {
return (
<LanguageClient
id='java'
infrastructure={infrastructure}
/>
);
}