Coder Social home page Coder Social logo

racket-language-server's Introduction

Racket Language Server Build Status

Implementation of the Language Server Protocol for Racket.

Custom extensions

Colorize Notification (:arrow_left:)

Colorize notifications are sent from the server to the client to enable semantic syntax highlighting.

When a file changes it is the server's responsibility to re-compute syntax highlighting and push them to the client. Newly pushed tokens always replace previously pushed tokens. There is no merging that happens on the client side.

Notification:

  • method: 'racket/colorize'
  • params: RacketColorizeParams defined as follows:
interface RacketColorizeParams {
	/**
	 * The URI for which colorization is reported.
	 */
	uri: DocumentUri;

	/**
	 * An array of diagnostic information items.
	 */
	tokens: RacketToken[];
}

interface RacketToken {
    /**
     * The kind of token.
     */
     kind: RacketTokenKind;

     /**
      * The lexer mode used.
      */
     mode: RacketLexerMode;

     /**
      * Range of the token.
      */
     range: Range;
}

enum RacketLexerMode {
    Racket = "racket",
    Scribble = "scribble",
    Other = "other"
}

enum RacketTokenKind {
    // Generic token kinds
    Symbol = "symbol",
    Keyword = "keyword",
    Comment = "comment",
    String = "string",
    Constant = "constant",
    Parenthesis = "parenthesis",
    Error = "error",
    NoColor = "no-color",
    Other = "other",
    // Racket token kinds
    HashColonKeyword = "hash-colon-keyword",
    SexpComment = "sexp-comment",
    // Racket semantic token kinds
    Imported = "imported",
    LexicallyBound = "lexically-bound",
    Free = "free",
    Set!d = "set!d",
    // Scribble token kinds
    Text = "text"
}

Indent Request (:arrow_left:)

Indent requests are sent from the client to the server to compute the indentation for a line number.

Request:

  • method: 'racket/indent'
  • params: RacketIndentParams defined as follows:
interface RacketIndentParams {
	/**
	 * The TextDocument for which indentation is requested.
	 */
	textDocument: TextDocumentIdentifier;

	/**
	 * The line to indent.
	 */
	line: number;
}

Response:

  • result: number
  • error: code and message set in case an exception happens during the definition request.

References

License

Copyright 2018 David Craven and others

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

racket-language-server's People

Contributors

acepie avatar dvc94ch 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.