From 036c3156211b3e83ab169b19aca947bf00e6ab69 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Mon, 2 Mar 2009 02:06:47 +0000 Subject: [PATCH] added more info to popup menu svn: r13894 --- collects/drscheme/syncheck.ss | 25 ++++++++++++++++--- .../english-string-constants.ss | 1 + 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/collects/drscheme/syncheck.ss b/collects/drscheme/syncheck.ss index 370b2bb615..a9a266bf44 100644 --- a/collects/drscheme/syncheck.ss +++ b/collects/drscheme/syncheck.ss @@ -21,8 +21,8 @@ If the namespace does not, they are colored the unbound color. scheme/unit scheme/contract scheme/class + scheme/list drscheme/tool - mzlib/list syntax/toplevel syntax/boundmap mrlib/switchable-button @@ -2574,7 +2574,8 @@ If the namespace does not, they are colored the unbound color. (when path (let ([index-entry (xref-tag->index-entry xref definition-tag)]) (when index-entry - (send defs-text syncheck:add-background-color source-editor "navajowhite" start fin (syntax-e stx)) + (send defs-text syncheck:add-background-color + source-editor "navajowhite" start fin (syntax-e stx)) (send defs-text syncheck:add-menu source-editor start @@ -2583,7 +2584,7 @@ If the namespace does not, they are colored the unbound color. (λ (menu) (instantiate menu-item% () (parent menu) - (label (fw:gui-utils:format-literal-label (string-constant cs-view-docs) (exported-index-desc-name (entry-desc index-entry)))) + (label (build-docs-label (entry-desc index-entry))) (callback (λ (x y) (let* ([url (path->url path)] @@ -2599,6 +2600,24 @@ If the namespace does not, they are colored the unbound color. url)]) (send-url (url->string url2)))))))))))))))))))))) + (define (build-docs-label desc) + (let ([libs (exported-index-desc-from-libs desc)]) + (cond + [(null? libs) + (fw:gui-utils:format-literal-label + (string-constant cs-view-docs) + (exported-index-desc-name desc))] + [else + (fw:gui-utils:format-literal-label + (string-constant cs-view-docs-from) + (format + (string-constant cs-view-docs) + (exported-index-desc-name desc)) + (apply string-append + (add-between + (map (λ (x) (format "~s" x)) libs) + ", ")))]))) + ; diff --git a/collects/string-constants/english-string-constants.ss b/collects/string-constants/english-string-constants.ss index e173f76b85..e0cfadc415 100644 --- a/collects/string-constants/english-string-constants.ss +++ b/collects/string-constants/english-string-constants.ss @@ -192,6 +192,7 @@ please adhere to these guidelines: (cs-status-loading-docs-index "Check Syntax: loading documentation index") (cs-mouse-over-import "binding ~s imported from ~s") (cs-view-docs "View documentation for ~a") + (cs-view-docs-from "~a from ~a") ;; a completed version of the line above (cs-view-docs) is put into the first ~a and a list of modules (separated by commas) is put into the second ~a. Use check syntax and right-click on a documented variable (eg, 'require') to see this in use (cs-lexical-variable "lexical variable") (cs-imported-variable "imported variable")