fixed auto completion in the REPL and improved the tools manual a little

svn: r7855
This commit is contained in:
Robby Findler 2007-11-29 00:22:05 +00:00
parent affcd3915a
commit 600089413b
8 changed files with 65 additions and 51 deletions

View File

@ -0,0 +1,9 @@
#lang scribble/doc
@begin[
(require scribble/manual)
]
@title{PLT DrScheme: Programming Environment Manual}
Nothing yet.

View File

@ -4,5 +4,6 @@
(define tool-names (list "Check Syntax" "Time Keystrokes")) (define tool-names (list "Check Syntax" "Time Keystrokes"))
(define mred-launcher-names (list "DrScheme")) (define mred-launcher-names (list "DrScheme"))
(define mred-launcher-libraries (list "drscheme.ss")) (define mred-launcher-libraries (list "drscheme.ss"))
(define scribblings '(("tools.scrbl" (multi-page main-doc))))) (define scribblings '(("tools.scrbl" (multi-page main-doc))
("drscheme.scrbl" (#;multi-page main-doc)))))

View File

@ -1333,18 +1333,7 @@
(let ([words #f]) (let ([words #f])
(λ () (λ ()
(unless words (unless words
(set! words (text:get-completions/manuals (set! words (text:get-completions/manuals #f)))
(list "gui"
"guide"
"help"
"mzscheme"
"mred"
"quick"
"r5rs"
"reference"
"scribble"
"web-server-guide"
"web-server-reference"))))
words))) words)))
;; add-built-in-languages : -> void ;; add-built-in-languages : -> void

View File

@ -10,6 +10,8 @@
(define (item/cap x . ys) (apply item (bold (format "~a" x)) ": " ys)) ;; indexing missing (define (item/cap x . ys) (apply item (bold (format "~a" x)) ": " ys)) ;; indexing missing
(define (gui x) (bold x))
] ]
@title{PLT Plugins: DrScheme Extension Manual} @title{PLT Plugins: DrScheme Extension Manual}
@ -18,9 +20,11 @@
This manual describes DrScheme's tools interface. It assumes This manual describes DrScheme's tools interface. It assumes
familiarity with familiarity with
PLT Scheme, as described in PLT Scheme, as described in
@(secref #:doc '(lib "scribblings/guide/guide.scrbl") "top"). @(secref #:doc '(lib "scribblings/guide/guide.scrbl") "top"),
DrScheme, as described in {\DrSchemeManual}, and DrScheme, as described in
the Framework, as described in {\FrameworkManual}. @(secref #:doc '(lib "drscheme/drscheme.scrbl") "top"),
and the Framework, as described in
@(secref #:doc '(lib "framework/framework.scrbl") "top").
@section{Thanks} @section{Thanks}
@ -53,10 +57,6 @@ add new functions and other values bound in the users
namespace. See the DrScheme manual for more information on namespace. See the DrScheme manual for more information on
constructing libraries. constructing libraries.
Tools rely heavily on MzScheme's @scheme[units]. They also
require understanding of \Mzhyperref{libraries and
collections}{mz:mzlib}.
When DrScheme starts up, it looks for tools by reading When DrScheme starts up, it looks for tools by reading
fields in the @File{info.ss} file of each collection and the fields in the @File{info.ss} file of each collection and the
newest version of each PLaneT package installed on the newest version of each PLaneT package installed on the
@ -102,14 +102,14 @@ This bitmap and the name show up in the about box, Help
Desk's bug report form, and the splash screen as the tool is Desk's bug report form, and the splash screen as the tool is
loaded at DrScheme's startup. loaded at DrScheme's startup.
\index{drscheme:tool atsign \scmsig{drscheme:tool}} @index{phase1}
\index{phase1}\index{phase2} @index{phase2}
Each of @scheme[tools] files must contain a module that Each of @scheme[tools] files must contain a module that
@scheme[provide]s @scheme[tool@], which must be bound to a @scheme[provide]s @scheme[tool@], which must be bound to a
@scheme[unit]. The unit @scheme[unit]. The unit
must import the @scheme[drscheme:tool^] signature, which is must import the @scheme[drscheme:tool^] signature, which is
provided by the @FileFirst{tool.ss} library in the provided by the @FileFirst{tool.ss} library in the
@scheme[drscheme] collection. The \scmsig{drscheme:tool} @scheme[drscheme] collection. The @scheme[drscheme:tool^]
signature contains all of the names listed in this manual. signature contains all of the names listed in this manual.
The unit must export the @scheme[drscheme:tool-exports^] The unit must export the @scheme[drscheme:tool-exports^]
signature. signature.
@ -135,14 +135,12 @@ extension. Then, other languages that are aware of the
extension can supply non-default implementations of the extension can supply non-default implementations of the
additional functionality. additional functionality.
\tag{phase1}{phase~1}
Phase 1 functions: Phase 1 functions:
@itemize{ @itemize{
@item{@scheme[drscheme:language:extend-language-interface]} @item{@scheme[drscheme:language:extend-language-interface]}
@item{@scheme[drscheme:unit:add-to-program-editor-mixin]} @item{@scheme[drscheme:unit:add-to-program-editor-mixin]}
} }
\tag{phase2}{phase~2}
Phase 2 functions: Phase 2 functions:
@itemize{ @itemize{
@item{@scheme[drscheme:language-configuration:add-language]} @item{@scheme[drscheme:language-configuration:add-language]}
@ -185,7 +183,7 @@ been loaded and that the @scheme[phase1] and @scheme[phase2]
functions have been called. functions have been called.
@section{Adding Languages to DrScheme} @section{Adding Languages to DrScheme}
\index{adding languages to DrScheme} @index{adding languages to DrScheme}
\label{tools:adding-languages} \label{tools:adding-languages}
@subsection{Adding Module-based Languages to DrScheme} @subsection{Adding Module-based Languages to DrScheme}
@ -198,7 +196,7 @@ where the module is saved. Include these
definitions: definitions:
@(itemize @(itemize
@item/cap['drscheme-language-modules]{ @item/cap['drscheme-language-modules]{
\index{drscheme-language-modules} This must be bound to a @index{drscheme-language-modules} This must be bound to a
list of collection path specifications or strings, one for list of collection path specifications or strings, one for
each language in the collection. Each collection path each language in the collection. Each collection path
specification is the quoted form of what might appear as specification is the quoted form of what might appear as
@ -209,7 +207,7 @@ definitions:
like string arguments to @scheme[require]. like string arguments to @scheme[require].
} }
@item/cap['drscheme-language-positions]{ @item/cap['drscheme-language-positions]{
\index{drscheme-language-positions} @index{drscheme-language-positions}
This must be bound to a This must be bound to a
list of language positions. Each language position list of language positions. Each language position
corresponds to the position of the language in language corresponds to the position of the language in language
@ -217,7 +215,7 @@ This must be bound to a
length must be at least two. length must be at least two.
} }
@item/cap['drscheme-language-numbers]{ @item/cap['drscheme-language-numbers]{
\index{drscheme-language-numbers} @index{drscheme-language-numbers}
This is optional. If This is optional. If
present, it must be a list of a list of numbers. Each list present, it must be a list of a list of numbers. Each list
corresponds to a single language from this collection. corresponds to a single language from this collection.
@ -229,14 +227,14 @@ This is optional. If
} }
@item/cap['drscheme-language-one-line-summaries]{ @item/cap['drscheme-language-one-line-summaries]{
\index{drscheme-language-one-line-summaries} @index{drscheme-language-one-line-summaries}
This is This is
optional. If present, it must be a list of strings. Each optional. If present, it must be a list of strings. Each
string is displayed at the bottom of the language dialog string is displayed at the bottom of the language dialog
when the corresponding language is selected. when the corresponding language is selected.
} }
@item/cap['drscheme-language-urls]{ @item/cap['drscheme-language-urls]{
\index{drscheme-language-urls} @index{drscheme-language-urls}
This is This is
optional. If present, it must be a list whose elements are optional. If present, it must be a list whose elements are
either strings or @scheme{#f}. either strings or @scheme{#f}.
@ -244,7 +242,7 @@ This is
the interactions window opens a web browser to the url. the interactions window opens a web browser to the url.
} }
@item/cap['drscheme-language-readers]{ @item/cap['drscheme-language-readers]{
\index{drscheme-language-readers} @index{drscheme-language-readers}
This is optional. If This is optional. If
present, it must be bound to a quoted list of module present, it must be bound to a quoted list of module
specifications (that is, a quoted version of the argument specifications (that is, a quoted version of the argument
@ -419,14 +417,14 @@ classes derived from that class as its result. For example:
extends the interactions text class with a method named @tt{method1}. extends the interactions text class with a method named @tt{method1}.
@section[#:tag "Expanding and Breaking"]{Expanding the User's Program Text and Breaking} @section[#:tag "Expanding and Breaking"]{Expanding the User's Program Text and Breaking}
\index{expanding user programs} @index{expanding user programs}
\index{breaking} @index{breaking}
\index{break button} @index{break button}
Macro-expanding a program may involve arbitrary computation Macro-expanding a program may involve arbitrary computation
and requires the setup of the correct language. To aid this, and requires the setup of the correct language. To aid this,
DrScheme's tool interface provides DrScheme's tool interface provides
\iscmprocedure{drscheme:eval:expand-program} to help. Use @scheme[drscheme:eval:expand-program] to help. Use
this method to extract the fully expanded program text in a this method to extract the fully expanded program text in a
particular language. particular language.
@ -453,19 +451,19 @@ method. This method controls what behavior the Break button
has. has.
@section{Editor Modes} @section{Editor Modes}
\index{modes} @index{modes}
\index{scheme mode} @index{scheme mode}
DrScheme provides support for multiple editor modes. Tools DrScheme provides support for multiple editor modes. Tools
register modes via register modes via
\iscmprocedure{drscheme:modes:add-mode}. Each mode is @scheme[drscheme:modes:add-mode]. Each mode is
visible in the \gui{Modes} submenu of the \gui{Edit} visible in the @gui{Modes} submenu of the @gui{Edit}
menu. Initially, DrScheme only supports two modes: scheme menu. Initially, DrScheme only supports two modes: scheme
mode and text mode. mode and text mode.
DrScheme automatically selects a mode for each open DrScheme automatically selects a mode for each open
file based on the file's extension. If the file ends with file based on the file's extension. If the file ends with
\File{.txt}, DrScheme uses text mode. Otherwise, DrScheme @File{.txt}, DrScheme uses text mode. Otherwise, DrScheme
uses Scheme mode. uses Scheme mode.
@section{Language-specific capabilities} @section{Language-specific capabilities}
@ -474,12 +472,12 @@ Drscheme's capability interface provides a mechanism for
tools to allow languages to hide their GUI interface, if the tools to allow languages to hide their GUI interface, if the
tool does not apply to the language. Tools register tool does not apply to the language. Tools register
capabilities keyed with symbols via. capabilities keyed with symbols via.
\iscmprocedure{drscheme:language:register-capability}. Once @scheme[drscheme:language:register-capability]. Once
registered, a tool can query a language, via the registered, a tool can query a language, via the
\iscmintfmethodspec{drscheme:language:language}{capability-value}{capability-value} \iscmintfmethodspec{drscheme:language:language}{capability-value}{capability-value}
method. The result from this method controls whether or not method. The result from this method controls whether or not
the tool shows this part of the GUI for DrScheme. the tool shows this part of the GUI for DrScheme.
See \iscmprocedure{drscheme:language:register-capability} See @scheme[drscheme:language:register-capability]
for a list of the capabilities registered by default. for a list of the capabilities registered by default.

View File

@ -0,0 +1,9 @@
#lang scribble/doc
@begin[
(require scribble/manual)
]
@title{PLT Framework: GUI Application Framework}
Nothing yet.

View File

@ -1,4 +1,5 @@
(module info setup/infotab (module info setup/infotab
(define name "Framework") (define name "Framework")
(define doc.txt "doc.txt")) (define doc.txt "doc.txt")
(define scribblings '(("framework.scrbl" (#;multi-page main-doc)))))

View File

@ -37,6 +37,7 @@
thaw-colorer thaw-colorer
reset-region reset-region
get-region
update-region-end update-region-end
skip-whitespace skip-whitespace

View File

@ -431,7 +431,7 @@
(inherit get-styles-fixed) (inherit get-styles-fixed)
(inherit has-focus? find-snip split-snip (inherit has-focus? find-snip split-snip
position-location get-dc) position-location get-dc get-region)
(define/override (get-word-at current-pos) (define/override (get-word-at current-pos)
(let ([no-word ""]) (let ([no-word ""])
@ -447,12 +447,18 @@
[else no-word]))]))) [else no-word]))])))
(define/private (look-for-non-symbol start) (define/private (look-for-non-symbol start)
(let loop ([i start]) (let-values ([(region-start region-end) (get-region)])
(cond (let loop ([i start])
[(< i 0) 0] (cond
[(eq? (classify-position i) 'symbol) [(and (number? region-start)
(loop (- i 1))] (< i region-start))
[else (+ i 1)]))) region-start]
[(< i 0)
0]
[(eq? (classify-position i) 'symbol)
(loop (- i 1))]
[else
(+ i 1)]))))
(public tabify-on-return? tabify (public tabify-on-return? tabify
tabify-all insert-return calc-last-para tabify-all insert-return calc-last-para