Re: Accessing function definitions Radar (Re: Accessing function definitions)
Re: Accessing function definitions Radar (Re: Accessing function definitions)
- Subject: Re: Accessing function definitions Radar (Re: Accessing function definitions)
- From: Laurence Harris <email@hidden>
- Date: Fri, 27 Oct 2006 16:06:57 -0400
On Oct 27, 2006, at 2:16 PM, Jeffrey Oleander wrote:
Laurence Harris <email@hidden> wrote:
- The contextual menu Xcode displays when I open a CM for
a selected function name (or by clicking anywhere is a
source
file) makes no sense to me. Most of the items in it have
nothing to do with the current text selection (or *any*
text
selection). Contextual menus should be *contextual*.
This
menu is not contextual in the least. It contains the
same
commands no matter where I click or if any text is
selected or not, and only one item disables if no text is
selected (Search in Spotlight). Jump to Definition, for
example, is always there and always enabled. It just
doesn't do anything if you choose it without a symbol
currently selected.
There is more to "current context" than whether and what
text is selected.
I agree there should be but...
What kind of window is the cursor in when you open the CM?
Source file.
Is it a text editing window?
Yes.
Is it over text, over a scroll
bar, over the title...?
No CM menu opens over the title bar or scroll bar.
Is the cursor within the scope of a function/method when
you open the CM?
It doesn't matter. I see the same list of commands in the menu no
matter where I click within the text content area of the window or
whether any text is selected or not, The only difference I have ever
seen is that the Search in Spotlight command is disabled if no text
is selected.
(If so, perhaps you're wanting to
find/open the declaration for that method/function since
you're in the middle of its implementaiton, or maybe you
want to jump to the beginning of that implementation. If
the latter, then "doing nothing" may be all that is
required to show the beginning of the function/method.)
Nope, that command is always enabled. If a symbol is selected, that
command acts as if I'd Command-double-clicked the symbol, even if I
click away from the selected text.
Does Xcode "know" that the text you've selected is a
method/function name or signature, or invocation?...
If the selected text is a symbol, it does the above. If there is no
selected text, it does nothing. If the currently selected text is not
a symbol, it's hard to know what will happen. Normally nothing
happens. But playing around I selected the "break" keyword in a
switch statement and the Jump to Definition command took me to this
line in MacErrors.h:
breakRecd = -90 /*Break received (SCC)*/
which doesn't seem correct to me by any reasoning.
I don't know the answers. I'm just trying to think the way
one of the developers of Xcode might have been thinking.
Perhaps one of them could tell us more, or point us to the
place in the manual where it's elaborated.
Whatever he was thinking, the current behavior is wrong. To see how
CMs are *supposed* to work in a text window, open a text file in
TextEdit and see how TextEdit changes the menu commands based on
whether text is selected or not, and the selection changes if you
open a CM away from selected text. The latter is important because it
needs to be clear that the commands in the menu apply to the
interface element under the mouse, not to a selection half a window
away.
Larry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden