How do you get the helpful tools in DrRacket?
Asked Answered
P

1

12

My brother wanted to introduce me to lisp languages, so he showed me DrRacket on his computer. Everything looked awesome, including arrows that point to where a function is being imported from, and a documentation bubble of sorts that tells you the syntax for a function.

I downloaded DrRacket onto my computer, however I don't have either of these. They are definitely not required, but they would make learning much easier.

According to my brother, he "spammed a bunch of Emacs shortcuts by accident, and it just sort of happened."

If anyone could help me, it would be much appreciated.

Prescriptible answered 16/2, 2015 at 4:3 Comment(5)
They should be enabled automatically, but I'd make sure you have Background Expansion enabled in the settings—it's what provides those features.Palenque
Or, if you have background expansion disabled, try clicking the Check Syntax button. Also see the docs.Aerometeorograph
@mattstir Click the "Check syntax" button. Then move the mouse over a variable that is used more than once in program.Liberati
Thank you very much for your comments. I tried both solutions, and... lo and behold, it worked!Prescriptible
No one seems to have mentioned this: I believe that these tools are disabled by default in the teaching languages, but enabled by default in the full #lang racket language.Mccutcheon
P
9

These features are provided as part of DrRacket's background expansion, which can be enabled or disabled in the "Background Expansion" tab of DrRacket's preferences.

Background expansion preferences panel

Enabling background expansion causes DrRacket to constantly perform macro-expansion as you edit your program, which will automatically detect syntax errors as a helpful side-effect.

Once background expansion has completed for a program, binding arrows and documentation blueboxes will be enabled (provided you've checked the relevant checkboxes in the background expansion preferences).


In some especially complex programs that employ a large number of macros, background expansion can take a non-trivial amount of time, though it shouldn't take any more than a few moments for all but the most complicated of programs. The current state of background expansion is displayed in the bottom-right corner of DrRacket's editor window.

Background expansion in progress

Once background expansion has completed, the indicator circle will turn green, and all program analysis tools such as arrows, documentation bubbles, and refactoring will become available.


If you don't want to use background expansion for some reason, you can manually trigger the syntax analysis DrRacket provides by pressing the "Check Syntax" button in the DrRacket toolbar.

Check Syntax button

This enables the binding arrows and documentation bubbles, and it also colorizes the source code using more advanced syntax highlighting that provides some additional information about the way bindings are used (this feature is only provided by Check Syntax, not background expansion).

Palenque answered 27/2, 2015 at 6:57 Comment(1)
do other IDE's have this feature? I find it pretty useful and I would love to write python code with the binding arrows/green bubblesAtaraxia

© 2022 - 2024 — McMap. All rights reserved.