adjust drracket so check syntax can add its preferences itself
closes PR 13419
(cherry picked from commit 3e3283aeba
)
This commit is contained in:
parent
1a9d203f29
commit
91bcf2ad27
|
@ -109,8 +109,10 @@
|
|||
(define-signature drracket:module-language-tools^ extends drracket:module-language-tools-cm^
|
||||
(add-opt-out-toolbar-button
|
||||
add-online-expansion-handler
|
||||
register-online-expansion-pref
|
||||
|
||||
;; the below should be hidden from tools
|
||||
get-online-expansion-pref-funcs
|
||||
(struct online-expansion-handler (mod-path id local-handler))
|
||||
get-online-expansion-handlers
|
||||
no-more-online-expansion-handlers))
|
||||
|
|
|
@ -320,4 +320,10 @@
|
|||
[else
|
||||
(set! online-expansion-handlers
|
||||
(cons (online-expansion-handler mod-path id local-handler)
|
||||
online-expansion-handlers))])))
|
||||
online-expansion-handlers))]))
|
||||
|
||||
(define online-expansion-pref-funcs '())
|
||||
(define (get-online-expansion-pref-funcs) online-expansion-pref-funcs)
|
||||
(define online-expansion-prefs '())
|
||||
(define (register-online-expansion-pref func)
|
||||
(set! online-expansion-pref-funcs (cons func online-expansion-pref-funcs))))
|
||||
|
|
|
@ -2317,7 +2317,6 @@
|
|||
(connect-to-prefs read-choice 'drracket:online-expansion:read-in-defs-errors)
|
||||
(connect-to-prefs var-choice 'drracket:online-expansion:variable-errors)
|
||||
(connect-to-prefs other-choice 'drracket:online-expansion:other-errors)
|
||||
(preferences:add-check vp
|
||||
'drracket:syncheck:show-arrows?
|
||||
(string-constant show-arrows-on-mouseover))
|
||||
(for ([f (in-list (drracket:module-language-tools:get-online-expansion-pref-funcs))])
|
||||
(f vp))
|
||||
parent-vp))))
|
||||
|
|
|
@ -89,6 +89,11 @@ If the namespace does not, they are colored the unbound color.
|
|||
number-between-zero-and-one?))
|
||||
(preferences:set-default 'drracket:syncheck:show-arrows? #t boolean?)
|
||||
|
||||
(define (syncheck-add-to-online-expansion-prefs-panel vp)
|
||||
(preferences:add-check vp
|
||||
'drracket:syncheck:show-arrows?
|
||||
(string-constant show-arrows-on-mouseover)))
|
||||
|
||||
(define (syncheck-add-to-preferences-panel parent)
|
||||
(color-prefs:build-color-selection-panel parent
|
||||
lexically-bound-variable-style-pref
|
||||
|
@ -2081,6 +2086,7 @@ If the namespace does not, they are colored the unbound color.
|
|||
(add-check-syntax-key-bindings (drracket:rep:get-drs-bindings-keymap))
|
||||
(fw:color-prefs:add-to-preferences-panel (string-constant check-syntax)
|
||||
syncheck-add-to-preferences-panel)
|
||||
(drracket:module-language-tools:register-online-expansion-pref syncheck-add-to-online-expansion-prefs-panel)
|
||||
(drracket:language:register-capability 'drscheme:check-syntax-button (flat-contract boolean?) #t)
|
||||
(drracket:get/extend:extend-definitions-text make-syncheck-text%)
|
||||
(drracket:get/extend:extend-definitions-canvas docs-editor-canvas-mixin)
|
||||
|
|
|
@ -162,6 +162,14 @@ all of the names in the tools library, for use defining keybindings
|
|||
and other tools), but any long running computations may freeze DrRacket's GUI,
|
||||
since this procedure is invoked on DrRacket's eventspace's handler thread.})
|
||||
|
||||
(proc-doc/names
|
||||
drracket:module-language-tools:register-online-expansion-pref
|
||||
(-> (-> (is-a?/c vertical-panel%) void?) void?)
|
||||
(func)
|
||||
@{Registers @racket[func] so that it is called while building the
|
||||
preferences panel. The function is passed a panel that contains
|
||||
other configuration controls for online expansion.})
|
||||
|
||||
(proc-doc/names
|
||||
drracket:module-language:add-module-language
|
||||
(-> any)
|
||||
|
|
Loading…
Reference in New Issue
Block a user