Re: [racket-dev] check-syntax hack: patch to show how many uses an identifier has

2012-08-01 Thread Robby Findler
FWIW, this is done now.

Robby

On Thu, Jun 21, 2012 at 12:09 PM, Robby Findler
 wrote:
> I'll try to do something along these lines. It shouldn't be hard to
> make it a tooltip.
>
> Robby
>
> On Thu, Jun 21, 2012 at 11:03 AM, John Clements
>  wrote:
>>
>> On Jun 21, 2012, at 8:58 AM, Matthias Felleisen wrote:
>>
>>>
>>> +a lot; I'd like that
>>
>> Robby, what's the nastiness threshold for getting something like this into 
>> the distribution?
>>
>> - is it okay to have a menu item with no action?
>> - is it okay to just say how many arrows--lines, really--radiate from this 
>> point, or would I need to go to the binding identifier and figure out how 
>> many uses the thing has?
>>
>> John
>>
>>>
>>>
>>> On Jun 20, 2012, at 10:48 PM, John Clements wrote:
>>>
 When I'm using online check syntax, I often look at the lines leaving an 
 identifier and wonder: is that just one line, or are there two or three? 
 When lines overlap, there's no easy way to tell. This can be important in 
 refactoring decisions, or in debugging (how many uses of this thing are 
 there to check?).

 Let me show you what I mean:

 

 How many uses of 'x' are there?

 I decided to spend a few minutes digging through the source, and came up 
 with this *EXTREMELY ROUGH* hack which helps me. :

 oiseau:...plt/collects/drracket/private/syncheck clements> git diff gui.rkt
 diff --git a/collects/drracket/private/syncheck/gui.rkt 
 b/collects/drracket/private/syncheck/gui.rkt
 index 5f691bd..e69b9c7 100644
 --- a/collects/drracket/private/syncheck/gui.rkt
 +++ b/collects/drracket/private/syncheck/gui.rkt
 @@ -1069,6 +1069,11 @@ If the namespace does not, they are colored the 
 unbound color.
   [var-arrows (filter var-arrow? 
 arrows)]
   [add-menus (append (map cdr (filter 
 pair? vec-ents))
  (filter 
 procedure? vec-ents))])
 + (make-object menu-item%
 +   (string-append ">> " (number->string 
 (length arrows))
 +  " arrows from this 
 identifier")
 +   menu
 +   (λ (item evt) (void)))
  (unless (null? arrows)
(make-object menu-item%
  (string-constant cs-tack/untack-arrow)


 Let me just emphasize how rough this hack is: when I use it on a use of an 
 identifier rather than a definition, it just shows the number 1, because 
 that's the number of arrows--that is, the one that goes back to the 
 definition.

 Keeping its limitations in mind, though, it's really nice to be able to 
 see:

 


 Would others find this useful?

 John


 _
 Racket Developers list:
 http://lists.racket-lang.org/dev
>>>
>>

_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] check-syntax hack: patch to show how many uses an identifier has

2012-06-27 Thread John Clements

On Jun 21, 2012, at 10:09 AM, Robby Findler wrote:

> I'll try to do something along these lines. It shouldn't be hard to
> make it a tooltip.

Don't spend too much time on it!

John

> 
> Robby
> 
> On Thu, Jun 21, 2012 at 11:03 AM, John Clements
>  wrote:
>> 
>> On Jun 21, 2012, at 8:58 AM, Matthias Felleisen wrote:
>> 
>>> 
>>> +a lot; I'd like that
>> 
>> Robby, what's the nastiness threshold for getting something like this into 
>> the distribution?
>> 
>> - is it okay to have a menu item with no action?
>> - is it okay to just say how many arrows--lines, really--radiate from this 
>> point, or would I need to go to the binding identifier and figure out how 
>> many uses the thing has?
>> 
>> John
>> 
>>> 
>>> 
>>> On Jun 20, 2012, at 10:48 PM, John Clements wrote:
>>> 
 When I'm using online check syntax, I often look at the lines leaving an 
 identifier and wonder: is that just one line, or are there two or three? 
 When lines overlap, there's no easy way to tell. This can be important in 
 refactoring decisions, or in debugging (how many uses of this thing are 
 there to check?).
 
 Let me show you what I mean:
 
 
 
 How many uses of 'x' are there?
 
 I decided to spend a few minutes digging through the source, and came up 
 with this *EXTREMELY ROUGH* hack which helps me. :
 
 oiseau:...plt/collects/drracket/private/syncheck clements> git diff gui.rkt
 diff --git a/collects/drracket/private/syncheck/gui.rkt 
 b/collects/drracket/private/syncheck/gui.rkt
 index 5f691bd..e69b9c7 100644
 --- a/collects/drracket/private/syncheck/gui.rkt
 +++ b/collects/drracket/private/syncheck/gui.rkt
 @@ -1069,6 +1069,11 @@ If the namespace does not, they are colored the 
 unbound color.
   [var-arrows (filter var-arrow? 
 arrows)]
   [add-menus (append (map cdr (filter 
 pair? vec-ents))
  (filter 
 procedure? vec-ents))])
 + (make-object menu-item%
 +   (string-append ">> " (number->string 
 (length arrows))
 +  " arrows from this 
 identifier")
 +   menu
 +   (λ (item evt) (void)))
  (unless (null? arrows)
(make-object menu-item%
  (string-constant cs-tack/untack-arrow)
 
 
 Let me just emphasize how rough this hack is: when I use it on a use of an 
 identifier rather than a definition, it just shows the number 1, because 
 that's the number of arrows--that is, the one that goes back to the 
 definition.
 
 Keeping its limitations in mind, though, it's really nice to be able to 
 see:
 
 
 
 
 Would others find this useful?
 
 John
 
 
 _
 Racket Developers list:
 http://lists.racket-lang.org/dev
>>> 
>> 



smime.p7s
Description: S/MIME cryptographic signature
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] check-syntax hack: patch to show how many uses an identifier has

2012-06-21 Thread Robby Findler
I'll try to do something along these lines. It shouldn't be hard to
make it a tooltip.

Robby

On Thu, Jun 21, 2012 at 11:03 AM, John Clements
 wrote:
>
> On Jun 21, 2012, at 8:58 AM, Matthias Felleisen wrote:
>
>>
>> +a lot; I'd like that
>
> Robby, what's the nastiness threshold for getting something like this into 
> the distribution?
>
> - is it okay to have a menu item with no action?
> - is it okay to just say how many arrows--lines, really--radiate from this 
> point, or would I need to go to the binding identifier and figure out how 
> many uses the thing has?
>
> John
>
>>
>>
>> On Jun 20, 2012, at 10:48 PM, John Clements wrote:
>>
>>> When I'm using online check syntax, I often look at the lines leaving an 
>>> identifier and wonder: is that just one line, or are there two or three? 
>>> When lines overlap, there's no easy way to tell. This can be important in 
>>> refactoring decisions, or in debugging (how many uses of this thing are 
>>> there to check?).
>>>
>>> Let me show you what I mean:
>>>
>>> 
>>>
>>> How many uses of 'x' are there?
>>>
>>> I decided to spend a few minutes digging through the source, and came up 
>>> with this *EXTREMELY ROUGH* hack which helps me. :
>>>
>>> oiseau:...plt/collects/drracket/private/syncheck clements> git diff gui.rkt
>>> diff --git a/collects/drracket/private/syncheck/gui.rkt 
>>> b/collects/drracket/private/syncheck/gui.rkt
>>> index 5f691bd..e69b9c7 100644
>>> --- a/collects/drracket/private/syncheck/gui.rkt
>>> +++ b/collects/drracket/private/syncheck/gui.rkt
>>> @@ -1069,6 +1069,11 @@ If the namespace does not, they are colored the 
>>> unbound color.
>>>                                       [var-arrows (filter var-arrow? 
>>> arrows)]
>>>                                       [add-menus (append (map cdr (filter 
>>> pair? vec-ents))
>>>                                                          (filter procedure? 
>>> vec-ents))])
>>> +                                 (make-object menu-item%
>>> +                                   (string-append ">> " (number->string 
>>> (length arrows))
>>> +                                                  " arrows from this 
>>> identifier")
>>> +                                   menu
>>> +                                   (λ (item evt) (void)))
>>>                                  (unless (null? arrows)
>>>                                    (make-object menu-item%
>>>                                      (string-constant cs-tack/untack-arrow)
>>>
>>>
>>> Let me just emphasize how rough this hack is: when I use it on a use of an 
>>> identifier rather than a definition, it just shows the number 1, because 
>>> that's the number of arrows--that is, the one that goes back to the 
>>> definition.
>>>
>>> Keeping its limitations in mind, though, it's really nice to be able to see:
>>>
>>> 
>>>
>>>
>>> Would others find this useful?
>>>
>>> John
>>>
>>>
>>> _
>>> Racket Developers list:
>>> http://lists.racket-lang.org/dev
>>
>

_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] check-syntax hack: patch to show how many uses an identifier has

2012-06-21 Thread John Clements

On Jun 21, 2012, at 8:58 AM, Matthias Felleisen wrote:

> 
> +a lot; I'd like that

Robby, what's the nastiness threshold for getting something like this into the 
distribution? 

- is it okay to have a menu item with no action?
- is it okay to just say how many arrows--lines, really--radiate from this 
point, or would I need to go to the binding identifier and figure out how many 
uses the thing has?

John

> 
> 
> On Jun 20, 2012, at 10:48 PM, John Clements wrote:
> 
>> When I'm using online check syntax, I often look at the lines leaving an 
>> identifier and wonder: is that just one line, or are there two or three? 
>> When lines overlap, there's no easy way to tell. This can be important in 
>> refactoring decisions, or in debugging (how many uses of this thing are 
>> there to check?).
>> 
>> Let me show you what I mean:
>> 
>> 
>> 
>> How many uses of 'x' are there?
>> 
>> I decided to spend a few minutes digging through the source, and came up 
>> with this *EXTREMELY ROUGH* hack which helps me. :
>> 
>> oiseau:...plt/collects/drracket/private/syncheck clements> git diff gui.rkt
>> diff --git a/collects/drracket/private/syncheck/gui.rkt 
>> b/collects/drracket/private/syncheck/gui.rkt
>> index 5f691bd..e69b9c7 100644
>> --- a/collects/drracket/private/syncheck/gui.rkt
>> +++ b/collects/drracket/private/syncheck/gui.rkt
>> @@ -1069,6 +1069,11 @@ If the namespace does not, they are colored the 
>> unbound color.
>>   [var-arrows (filter var-arrow? arrows)]
>>   [add-menus (append (map cdr (filter 
>> pair? vec-ents))
>>  (filter procedure? 
>> vec-ents))])
>> + (make-object menu-item%
>> +   (string-append ">> " (number->string 
>> (length arrows))
>> +  " arrows from this 
>> identifier")
>> +   menu
>> +   (λ (item evt) (void)))
>>  (unless (null? arrows)
>>(make-object menu-item%
>>  (string-constant cs-tack/untack-arrow)
>> 
>> 
>> Let me just emphasize how rough this hack is: when I use it on a use of an 
>> identifier rather than a definition, it just shows the number 1, because 
>> that's the number of arrows--that is, the one that goes back to the 
>> definition.
>> 
>> Keeping its limitations in mind, though, it's really nice to be able to see:
>> 
>> 
>> 
>> 
>> Would others find this useful?
>> 
>> John
>> 
>> 
>> _
>> Racket Developers list:
>> http://lists.racket-lang.org/dev
> 



smime.p7s
Description: S/MIME cryptographic signature
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] check-syntax hack: patch to show how many uses an identifier has

2012-06-21 Thread Matthias Felleisen

+a lot; I'd like that


On Jun 20, 2012, at 10:48 PM, John Clements wrote:

> When I'm using online check syntax, I often look at the lines leaving an 
> identifier and wonder: is that just one line, or are there two or three? When 
> lines overlap, there's no easy way to tell. This can be important in 
> refactoring decisions, or in debugging (how many uses of this thing are there 
> to check?).
> 
> Let me show you what I mean:
> 
> 
> 
> How many uses of 'x' are there?
> 
> I decided to spend a few minutes digging through the source, and came up with 
> this *EXTREMELY ROUGH* hack which helps me. :
> 
> oiseau:...plt/collects/drracket/private/syncheck clements> git diff gui.rkt
> diff --git a/collects/drracket/private/syncheck/gui.rkt 
> b/collects/drracket/private/syncheck/gui.rkt
> index 5f691bd..e69b9c7 100644
> --- a/collects/drracket/private/syncheck/gui.rkt
> +++ b/collects/drracket/private/syncheck/gui.rkt
> @@ -1069,6 +1069,11 @@ If the namespace does not, they are colored the 
> unbound color.
>[var-arrows (filter var-arrow? arrows)]
>[add-menus (append (map cdr (filter 
> pair? vec-ents))
>   (filter procedure? 
> vec-ents))])
> + (make-object menu-item%
> +   (string-append ">> " (number->string 
> (length arrows))
> +  " arrows from this 
> identifier")
> +   menu
> +   (λ (item evt) (void)))
>   (unless (null? arrows)
> (make-object menu-item%
>   (string-constant cs-tack/untack-arrow)
> 
> 
> Let me just emphasize how rough this hack is: when I use it on a use of an 
> identifier rather than a definition, it just shows the number 1, because 
> that's the number of arrows--that is, the one that goes back to the 
> definition.
> 
> Keeping its limitations in mind, though, it's really nice to be able to see:
> 
> 
> 
> 
> Would others find this useful?
> 
> John
> 
> 
> _
>  Racket Developers list:
>  http://lists.racket-lang.org/dev


_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] check-syntax hack: patch to show how many uses an identifier has

2012-06-20 Thread Neil Van Dyke

John Clements wrote at 06/20/2012 10:48 PM:
When I'm using online check syntax, I often look at the lines leaving 
an identifier and wonder: is that just one line, or are there two or 
three? When lines overlap, there's no easy way to tell. This can be 
important in refactoring decisions, or in debugging (how many uses of 
this thing are there to check?).


Yes, I've wondered this too.  And in large files, it's often really hard 
to tell, like in your first screenshot.


Maybe, if the mouse hovers over the center point of a binding 
identifier, there's a tooltip that shows useful info, such as how many 
references (maybe in what procedures?), and whether it's provided by the 
module.  (I haven't thought about submodules, though.)


Neil V.

_
 Racket Developers list:
 http://lists.racket-lang.org/dev