• Stars
    star
    264
  • Rank 155,103 (Top 4 %)
  • Language
    Racket
  • License
    Other
  • Created over 7 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

racket-langserver

racket-langserver is a Language Server Protocol implementation for Racket. This project seeks to use DrRacket's public APIs to provide functionality that mimics DrRacket's code tools as closely as possible.

Installation and usage

A Racket runtime is a prerequisite, so before using racket-langserver, ensure that a Racket runtime is installed. You can install an from the official download page or install one from your package manager.

Atom

You can use the atom-ide-racket package. The language server will be automatically installed when atom-ide-racket installs.

VSCode

Use the Magic Racket extension.

Other editors and IDEs

First, install an LSP runtime for your editor.

Next, install the package via raco:

raco pkg install racket-langserver

Once it is installed, you can configure your editor to use a custom LSP client for Racket files (.rkt), and set the command for the custom client to

racket -l racket-langserver

You may need to restart your LSP runtime or your editor for racket-langserver to start.

Capabilities

Currently Supported:

  • Hover (textDocument/hover)
  • Jump to Definition (textDocument/definition)
  • Find References (textDocument/references)
    • Note: Currently only considers references within the current file.
  • Document Highlight (textDocument/documentHighlight)
  • Diagnostics (textDocument/publishDiagnostics)
  • Code Formatting (textDocument/formatting & textDocument/rangeFormatting & textDocument/onTypeFormatting)
  • Code Action (textDocument/codeAction)
  • Signature Help (textDocument/signatureHelp)
  • Rename (textDocument/rename & textDocument/prepareRename)
    • Note: Currently only allows renaming symbols defined within the current file.
  • Code completion (textDocument/completion)

Work in Progress:

  • Document Outline (textDocument/documentSymbol)

Notes for Contributers

It is useful to think of this project as a "headless mode" for DrRacket. Contributions to this project should seek to avoid re-implementing functionality that is already exposed through DrRacket's public API.

Currently, we do not support workspace-wide (or project-wide) methods because the underlying DrRacket code tools only operate on one file at a time. If multi-file code tools are a desirable feature, then they should be considered for inclusion into DrRacket proper before being implemented in this project.

jeapostrophe commented on Apr 29, 2020

I think that the right way to implement most features in Racket-LSP is to find the corresponding feature in DrRacket and then disentangle from DrR's GUI and then expose the feature through the LSP. In many cases, DrR has already been internally organized to do that, but we just haven't done enough spelunking yet.

More Repositories

1

racket-android

deploying Racket on Android
Racket
98
star
2

exp

Configuration files and experimental, one-off code
Racket
62
star
3

mode-lambda

mode-lambda - sprite-based 2D graphics engine
Racket
39
star
4

racket-cheat

racket-cheat - a cheat sheet for Racket
Racket
36
star
5

remix

remix - a revised version of Racket
Racket
33
star
6

lux

lux - a simple library for creating real-time graphical apps
Racket
29
star
7

adqc

adqc - A version of C with verification and resource bounds
Racket
22
star
8

mic1

mic1
Racket
21
star
9

mongodb

raw mongodb interface in Racket
Racket
18
star
10

jeapostrophe.github.com

my blog!
HTML
15
star
11

raart

raart - racket ansi art
Racket
14
star
12

k-type

[dead] a variant of "Typing of the Dead" for learning Japanese
JavaScript
13
star
13

opencl

FFI for OpenCL
Racket
12
star
14

zeromq

FFI to zeromq
Racket
12
star
15

c

#lang for writing C code
Racket
12
star
16

automata

automata - macros to build automata over match patterns
Racket
11
star
17

slideshow-latex

embedding LaTeX in Racket slideshows
Racket
11
star
18

m8b

a graduate admissions management site
Racket
10
star
19

wizarding-world

wizarding-world - A "Powered by the Apocalypse"-style tabletop RPG based on the world of JK Rowling's Harry Potter
Racket
9
star
20

superc

C code with macros in Racket
Racket
9
star
21

dos

DOS - Delimited-continuation-based Operating-system Simulator
Racket
9
star
22

rmc

rmc - Racket-Made C
Racket
8
star
23

struct-define

struct-define - quickly access fields of struct
Racket
7
star
24

puresuri

puresuri presentation system
Racket
7
star
25

rackunit-chk

a short-hand for writing rackunit tests
Racket
7
star
26

apse

apse - A Pixel Sprite Editor
Racket
6
star
27

parenlog

purely parenthetical version of Prolog
Racket
6
star
28

iswim

iswim - #lang for writing ISWIM terms and helping to write ISWIM interpeters
Racket
6
star
29

presentations

source code for some presentations I've given
C
6
star
30

runic

C
6
star
31

teachlog

teachlog - A logic language for teaching language creation
Racket
6
star
32

srpnt

srpnt - synthesized, random pulse, noise, and triangle (wip)
Racket
6
star
33

lll

[dormant] a low-level language framework (including SNES assembler!)
Racket
6
star
34

live-free-or-die

live-free-or-die - Escape from Typed Racket
Racket
5
star
35

galaxy

[moved] the next Racket package system (merged into the core)
Racket
5
star
36

bloggy

basic blogging system
Racket
4
star
37

lux-charterm

lux-charterm - the dream of the 1970s
Racket
4
star
38

rune

a text editor in Racket---to a first approximation
Racket
4
star
39

org-mode

org-mode file parser
Racket
4
star
40

openmpi

FFI for OpenMPI
Racket
4
star
41

compiler

[dormant] experimental compiler infrastructure
Scheme
4
star
42

dbm

FFI to dbm
Racket
4
star
43

fra

functional relational algebra implementation
Racket
4
star
44

gamejam-2019

Racket
3
star
45

chk

chk - a minimal tester
Racket
3
star
46

xml-rpc

XML RPC in Racket
Racket
3
star
47

higan

my copy of unofficial higan repo
C++
2
star
48

youchart

[dead] a Web app for charting your monthly cycle
Scheme
2
star
49

grade-ninja

[dead] a UNIX-based turn-in submission and grading system
JavaScript
2
star
50

planet2-example

[dead] example package for planet 2
Racket
2
star
51

grade-samurai

a turn-in and grading site for my courses
Racket
2
star
52

matrix

matrix data structures
Racket
2
star
53

ldap

implementation of basic LDAP authentication
Racket
2
star
54

twitter

[rewrite] Basic Twitter API (lame)
Scheme
2
star
55

bulletml

[dormant] implementation of bulletml
Scheme
2
star
56

sps

[dormant] a basic physics simulator
Scheme
2
star
57

html-parsing

fork on html parsing library
Racket
2
star
58

redex

redex modules for papers, etc
Coq
2
star
59

jwm

jwm - Jay's UI environment
Shell
2
star
60

compy

[dormant] an experiment in making a compiler for teaching
Racket
2
star
61

pltwitter

[dead] twitter in Racket
Racket
2
star
62

sqlite

[moved] FFI for sqlite (now in Racket 'db' package)
Racket
2
star
63

chipmunk

[dormant] FFI for chipmunk physics
Scheme
2
star
64

ring-buffer

a fixed-size overwriting ring buffer
Racket
2
star
65

gl-world

[dead] opengl version of HtDP's world interface
Racket
2
star
66

datalog

[moved] an implementation of datalog (moved to datalog package in Racket core)
Scheme
2
star
67

gl2d

[dead] 2D drawing with opengl
Scheme
1
star
68

wtk

[rewrite] a toolkit of Web components
Scheme
1
star
69

pfp

[dormant] purely functional physics simulator
Scheme
1
star
70

batched-deque

[rewrite] batched deque data structure
Scheme
1
star
71

monaco

monaco - Monte Carlo Tree Search library
C
1
star
72

rl

[dormant] an experimental "roguelike" in Racket
Scheme
1
star
73

mccgames

Games from the McCarthy family
Lua
1
star
74

fib-heap

[rewrite] implementation of fibonacci heap
Scheme
1
star
75

hash-store

[rewrite] a hash-based store
Scheme
1
star
76

spvector

semi-persistent vectors
Racket
1
star
77

rip

Racket Interactive Programming
Racket
1
star
78

dijkstra

[rewrite] implementation of dijkstra's algorithm
Scheme
1
star
79

apd

[dormant] automatic protocol designer
Scheme
1
star
80

with-bindings

[dead] a basic macro for request-bindings
Scheme
1
star
81

url-param

embedding values in URLs automatically in Racket Web server programs
Scheme
1
star
82

floyd-warshall

[rewrite] floyd-warshall implementation
Scheme
1
star
83

mv

[dormant] an experiment in making a metroidvania style game
Scheme
1
star
84

wrap-dict

[dead] wrapping a dictionary with a processing step
Scheme
1
star
85

job-queue

implementation of a job queue + workers
Racket
1
star
86

restore

protocol for restore program state
Racket
1
star
87

mmss

[dead] a bunch of random libraries
Scheme
1
star
88

grade-harvest

Racket
1
star
89

openal

openal - FFI for OpenAL
Racket
1
star
90

rust-vs-hs

Rust
1
star
91

fortunedb

[dead] fortunedb implementation
Scheme
1
star
92

sdl

[dead] FFI to SDL
Racket
1
star
93

shmup

[dormant] a basic shmup
Scheme
1
star
94

flowww

[dormant] frp across the Web
Scheme
1
star
95

svn-prop

[dead] FFI to SVN's property api
Scheme
1
star
96

rack

an experimental racket-y language/vm
Racket
1
star
97

fs-persist

[rewrite] filesystem persistence
Scheme
1
star
98

birthday-scriptures

Racket
1
star
99

pyramidstack

[dead] an animation of a pyramid stack of blocks crashing
Scheme
1
star
100

memcached

memcached API in Racket
Racket
1
star