Post

Replies

Boosts

Views

Activity

Reply to How do you use the new "Document Tabs" feature?
I'd like to add a couple caveats to my previous post. First, if you Cmd-Cntrl-click on a symbol, the editor will take you to the declaration of that symbol, as I said above. However, once you've Cmd-Cntrl-clicked on a symbol and it's declaration is displayed in the editor, you can scroll around in the editor. Wherever you scroll to will be the location displayed when going back to that symbol's place in the reference stack, whether the symbol you clicked on is shown in the window or not. Second, it seems that Cmd-Cntrl-clicking will attempt to select any static tabs that have already been established for the newly opened file. However, if the file doesn't have any static tabs referencing it, a new temporary tab will be created and any subsequent Cmd-Cntrl-clicks on symbols in other files for which there are no static tabs will replace the file in the newly created temporary tab. Again, I haven't exhaustively tested this, so I'm open to any corrections that others find in this behavior.
Nov ’21
Reply to How do you use the new "Document Tabs" feature?
Here's my attempt to answer dogcoder's issue (3rd paragraph): Like grb2007, I've found out the following through experimentation rather than through Apple's Xcode documentation, though I tried hard to go that route. If you open a project and close all the document (not window) tabs, to start fresh, then open a file in the project navigator, a temporary document tab is opened. Ignoring the tabs for a moment, if you click a couple more files in the project navigator, their contents will be displayed in the editor window. After doing that a few times, you'll find that swiping left or right works as you expected. It will go back and forth between the files you opened in the order that you opened them. However, the more valuable use of swiping left and right, which matches the behavior of clicking the back and forward buttons in the document tab bar, is to do a manual "stack trace" through your functions and methods. If you're examining a function's code and it calls another function, you can Cmd-Cntrl-click that second function's name to immediately open its file with it's declaration selected. As you go through its code, you Cmd-Cntrl-click a function it calls to move deeper into the logic. Again, that function's file will open with it selected. Let's say you repeat that sequence three or four more times. Now you're pretty deep in the calling sequence but how do you get back? The incredibly valuable answer is either the back button or swiping. Each back button click (or swipe right) will take you back to the calling function, so you can very conveniently move right back up the calling stack. This approach includes clicks on any symbol, as far as I can tell, so you can use it to examine type and named value (let or var) declarations as well as function declarations and find your way back up to the top of the reference "stack" when you're done. Of course, if you go half way back up, then click the forward button (or swipe left), you'll retrace your steps back down the stack. As you'd expect, if you go half way back up, then Cmd-Cntrl-click another symbol, the original stack below you will be lost and replaced by this new reference. Of course, this works whether the symbol you clicked was in another file or the same file you were already in. In either case, your editor window will display the referenced symbol's definition which will be added to the stack. This means that sometimes when you go back up the "stack trace", you will move within a file rather than opening a new file in the editor. I just discovered this yesterday and haven't yet experimented with the relationship between these clicks and the document tabs but I thought this might be helpful for some.
Nov ’21