Code Monkey home page Code Monkey logo

plaintext-lsp's Introduction

Plaintext Language Server Protocol (LSP) Sample

Overview

This repository contains two main projects: a client written in TypeScript and a server written in .NET Core. These projects work together to implement a Language Server Protocol (LSP) for plaintext files.

What is LSP?

The Language Server Protocol (LSP) is a protocol used between a code editor (like Visual Studio Code) and a language server that provides language features such as auto-completion, go-to-definition, and diagnostics. The goal of LSP is to standardize the communication between the editor and the language server, allowing for better integration and support for multiple programming languages.

For more information on LSP, you can read the official LSP specification.

Projects

Client (TypeScript)

The client project is written in TypeScript and requires NodeJs to be installed. It is responsible for communicating with the language server and providing language features to the editor.

PlaintextLspServer (.NET Core)

The server project is written in .NET Core. It implements the language server that provides language features for plaintext files.

Getting Started

Prerequisites

  • NodeJs (for the client)
  • TypeScript compiler. For example npm install -g typescript
  • .NET Core 8.0 SDK (for the server)
  • Visual Studio Code

Installation

  1. Clone the repository:
git clone https://github.com/grant-archibald-ms/plaintext-lsp.git
cd plaintext-lsp
  1. Set up the client:
cd src/client
npm install
npm run compile
  1. Set up the server:
cd ../PlaintextLspServer
dotnet restore

Running the Projects

  1. Start the server:
cd PlaintextLspServer
dotnet run
The server will start listening on the port specified in the `config.json` file (default is 8080).

Running Extension

  1. Open the src/client folder in Visual Studio Code

  2. Open the src/client.ts file

  3. Select F5 to start debugging the extension. The client will connect to the server and start providing language features for plaintext files.

  4. Experiment with adding capitals to have diagnostic errors

  5. Type list Test. then press control space to get completion suggetions

Configuration

The server port can be configured in the config.json file located in the PlaintextLspServer directory. The default port is 8080.

The client port can be configured in Visual Studio Code Settings

plaintext-lsp's People

Contributors

grant-archibald-ms avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.