Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distribute language server via npm package #158

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
"compile:rust": "cd rust && npm run build-release && shx cp ./index.node ../out/vscode_motoko.node",
"compile:extension": "esbuild ./src/extension.ts --bundle --outfile=out/extension.js --external:vscode --format=cjs --platform=node --minify",
"compile:browser": "esbuild ./src/browser.ts --bundle --outfile=out/browser.js --external:vscode --format=cjs --platform=node --minify",
"compile:server": "esbuild ./src/server/server.ts --bundle --outfile=out/server.js --external:vscode --format=cjs --platform=node --minify",
"compile:server": "esbuild ./src/server/server.ts --bundle --outfile=out/server.js --format=cjs --platform=node --minify",
"compile:motoko": "esbuild motoko --bundle --outfile=out/motoko.js --format=cjs --platform=node --minify",
"test": "jest",
"package": "vsce package && npm test",
Expand Down
4 changes: 4 additions & 0 deletions packages/mo-ide/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules

/dist
/pkg
35 changes: 35 additions & 0 deletions packages/mo-ide/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# mo-ide · [![npm version](https://img.shields.io/npm/v/mo-ide.svg?logo=npm)](https://www.npmjs.com/package/mo-ide) [![GitHub license](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

> #### The official [Language Server Protocol (LSP)](https://microsoft.github.io/language-server-protocol/) implementation for [Motoko](https://github.com/dfinity/motoko).

---

`mo-ide` exists for developers interested in using features from the [Motoko VS Code extension](https://github.com/dfinity/vscode-motoko) in an IDE without official Motoko language support.

## Setup

Ensure that [Node.js](https://nodejs.org/en/download/) is installed on your system, and run the following command:

```bash
npm install -g mo-ide
```

This will add the `mo-ide` command to your path, which you can then use in your supported IDE of choice.

For environments without Node.js, you can also download a portable executable from the [GitHub releases](https://github.com/dfinity/vscode-motoko/releases) page.

## Getting Started

IDE-specific setup instructions are currently a work in progress.

## Advanced Usage

Start the language server using the following commands:

```bash
mo-ide --stdio # standard I/O transport (when in doubt, try this option)

mo-ide --node-ipc # Node.js IPC transport (used in VS Code)

mo-ide --socket={number} # TCP socket transport
```
Loading