Skip to content

CodinGame/monaco-languageclient-react

Repository files navigation

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