Skip to content

fork-house/codemirror-languageserver

This branch is up to date with FurqanSoftware/codemirror-languageserver:master.

Folders and files

NameName
Last commit message
Last commit date
Feb 3, 2025
Feb 28, 2021
Feb 28, 2021
Feb 28, 2021
Feb 27, 2021
Oct 30, 2022
Jan 19, 2025
Jan 19, 2025
Apr 23, 2021
Apr 23, 2021
Jan 19, 2025

Repository files navigation

Language Server Plugin for CodeMirror 6

npm version

This plugin enables code completion, hover tooltips, and linter functionality by connecting a CodeMirror 6 editor with a language server over WebSocket.

How It Works

Usage

npm i codemirror-languageserver
import { languageServer } from 'codemirror-languageserver';

const transport = new WebSocketTransport(serverUri)

var ls = languageServer({
	// WebSocket server uri and other client options.
	serverUri,
	rootUri: 'file:///',

	// Alternatively, to share the same client across multiple instances of this plugin.
	client: new LanguageServerClient({
		serverUri,
		rootUri: 'file:///'
	}),

	documentUri: `file:///${filename}`,
	languageId: 'cpp' // As defined at https://microsoft.github.io/language-server-protocol/specification#textDocumentItem.
});

var view = new EditorView({
	state: EditorState.create({
		extensions: [
			// ...
			ls,
			// ...
		]
	})
});

Contributing

Contributions are welcome.

Real World Uses

code-editor.mp4
  • Toph: Competitive programming platform. Toph uses Language Server Plugin for CodeMirror 6 with its integrated code editor.

License

The library is available under the BSD (3-Clause) License.

About

Language Server integration for CodeMirror 6 (Toph's code editor)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 98.2%
  • JavaScript 1.8%