10 Cooperating with Background Check Syntax

▼ |  | Dr Racket Plugins

1 | Tool support for #lang-based Languages
2 | Implementing Dr Racket Plugins
3 | Adding Languages to Dr Racket
4 | Creating New Kinds of Dr Racket Frames
5 | Extending the Existing Dr Racket Classes
6 | Expanding the User’s Program Text and Breaking
7 | Editor Modes
8 | Plugin Capabilities
9 | Check Syntax
10 | Cooperating with Background Check Syntax
11 | Teaching Languages
12 | Signatures
13 | drracket: get/ extend
14 | drracket: unit
15 | drracket: language
16 | drracket: language-configuration
17 | drracket: debug
18 | drracket: rep
19 | drracket: frame
20 | drracket: help-desk
21 | drracket: eval
22 | drracket: modes
23 | drracket: module-language-tools
24 | drracket: module-language
25 | drracket: tracing
26 | drracket: init
27 | Backwards Compatibility
| Index

Racket
top contents ← prev up next →

## 10 Cooperating with Background Check Syntax🔗ℹ

DrRacket’s continuous, background check syntax runs each time an edit to the definitions text happens. In some cases, that expansion process fails, but there is still a well-formed syntax object that check syntax can use to display information to the user. In order to communicate that syntax object to check syntax, send a log message with the name 'online-check-syntax, e.g.

> (define-logger online-check-syntax)
> (log-message online-check-syntax-logger
> 'info
> "ignored message"
> list-of-syntax-objects)

The fourth argument to log-message should be a list of syntax objects; these are processed as if they were the result of expansion.

The syntax objects whose syntax-source field does not match the source of the file that is currently being expanded are ignored. That is, sometimes a macro may log a syntax object to be used by DrRacket in this fashion, but the macro may not be from the file that DrRacket’s expanding, but one from one that is required by it; hence this check is in place to skip them.

Note: the identifiers in these objects should be syntax-original? or else they will be ignored by check syntax.

top contents ← prev up next →