Skip to content

Latest commit

 

History

History
39 lines (30 loc) · 1.27 KB

README.md

File metadata and controls

39 lines (30 loc) · 1.27 KB

@codingame/monaco-languageclient-react · monthly downloads npm version PRs welcome

Installation

npm install @codingame/monaco-languageclient-react 

Usage

Simple usage

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}
   />
  );
}