racket / drracket

DrRacket, IDE for Racket
http://www.racket-lang.org/
Other
445 stars 93 forks source link

Inlay hints (aka Parameter hints) #557

Open jestarray opened 2 years ago

jestarray commented 2 years ago

https://github.com/jeapostrophe/racket-langserver/issues/29

Inlay Hints

(bug regarding wrong argument order) https://github.com/racket/racket/commit/96f26e0a3576f0c67c17d9ee6faeee899494b1f0

Rendering inlay hints would be very useful, eliminating a lot of the guess work of function arguments and struct fields without needing to look at the documentation or the definition again and in the case of structs, creating functions with keyword arguments to see what the fields are.

(struct person (firstname middlename lastname age job))

; when constructing, it will render the field names as a sort of "background image", 
; the code that actually is ran is the valid amount of arguments, so (person "bob" "j" "smith" 20 "programmer")

(person firstname "bob" middlename "j" lastname "smith" age 20 job "programmer")