Xcode is losing colours and auto complete - xcode

Using Xcode 7.3 , sometimes randomly the editor turns to be black, no syntax colours , but worse- no auto complete for local variables and functions.
When you compile again, you get the colours back , but still no auto complete.
Sometimes there is a message that there is a problem with the editor.
I did not have this problem before (5 years), and I'v read this thread which does not seems like the same problem, because its too old :
Xcode: code loses syntax coloring
This might seems like a small thing, but without the auto-complete -its really hell !

this is common issue. any chance you are coding in Swift? i think it is still kind of unstable.
but you can try
1) delete module cache
it is within the same folder as project's derived data. when syntax highlighting stops working, try to delete it. quit xcode
and delete ~/Library/Developer/Xcode/DerivedData/ModuleCache directory
2) clean project
try clean with ⌘ + ⇧ + K and then with ⌥ + ⌘ + ⇧ + K
3) restart xcode

Related

How can I fix Xcode's open quickly?

I wonder if I'm doing something to make it not work, but simply put after tapping cmmd + shift + O or going to File >> Open quickly the option doesn't show up. It's like I did nothing.
Wondering if this is a known Xcode bug or if I'm doing something.
I'm using Xcode 10.1
You probably have more than one monitor connected.
This is something that confused me a lot of times as well; the quick search prompt will remember its position (you can drag it around) even on secondary monitors.
For what is worth, in my opinion, that field should always be presented on the current (in focus) editor.

How to collapse all issues in the Xcode issue navigator

I am porting a huge C++ project to OS X. After my initial compile with Xcode I have multiple errors in many files I want to investigate.
Problem is that the issue navigator shows all files non collapsed after each compile:
So I have to collapse all of them by hand (there a a lot of files) after each compile to have an overview of a files which need fixing.
Is there a hotkey or a setting to collapse all files?
cmd ⌘-click one of the little disclosure triangles to collapse (or expand) all rows.
let me add some extra info, when tapping a main item
hold ⌘ to : close a type of warnings
hold shift & ⌘ to : close all types of warnings
go to the most top level of issue and alt + <- keyboard arrow key that will close that issue and when you use alt + -> to open the issue again. all issue is collapse

emacs-like mark selection in textmate

I used emacs for years before being convinced to switch over to textmate. I am mostly happy with the move but really, really miss the ability to select text by setting a mark and then moving the cursor; using shift + arrow just doesn't cut it for me. I have tried a couple bindings based on some out-dated blog posts out there but just can't figure it out!
Anybody know of a bundle or binding that will help me get this functionality?
I don't know of a way to do that in TextMate. It has bookmarks, used for navigation, but nothing like what you describe.
If I remember correctly, placing the caret somewhere and extending the selection with ⇧ + arrows is the only practical way to select stuff in TextMate.
Like in all Mac OS X applications you can accelerate the process by hitting ⌘ and go word by word.
There are 3 special shortcuts you might find useful but I don't think they will solve your problem:
^ + W to select the current Word
⇧⌘ + L to select the current Line
⇧⌘ + B to select between enclosing pairs
A bundle I've used for some time (but under a different name, I think) proposes scope-oriented selection. I remember it being quite useful at times but also a bit buggy.

Xcode History (back/forward) Keyboard Shortcut?

Back Arrow Broken In Xcode?
Is there keyboard command to go back/forward one file at a time.
Xcode 3.2 changed the behavior of Cmd-Opt <-- and -->. As noted in another question, they do not operate on a file level like in previous versions of Xcode, but on an "edit point", making it cumbersome to flip through a list of files (the quick way to do it, since Xcode does not support Tabs, as in Eclipse).
Rob Keniger found a partial solution that he noted in another post:
"Hold down the option key while you click the forward/backward arrows ..."
But this requires fiddling with the mouse. Is there any way to do it with the keyboard only?
EDIT:
Later versions of Xcode (v7.2+) now have a Navigate menu (and it changes the keyboard shortcuts yet again):
In XCode 4.4 the following sequence works:
Cmd + Ctrl + ←
and it operates on a file level.
On Xcode 8 I use 2 fingers left / right
Beginning in XCode 3.2.3, the following key sequence works:
Cmd + Option + Shift + ←
Without the Shift key, it just goes back to the previous cursor position. Adding Shift jumps to the previous file (next file, in combination with →).
Navigation shortcuts for Xcode

How can I navigate backwards in Xcode?

In Visual Studio I can navigate backwards by pressing Ctrl + -. This is very useful when checking out the definition of a function and then immediately going back to the code I was working on.
How can I do this in Xcode? (I'm using version 3.1.2)
* Writing this if people using Xcode 4 need the answer for their versions:
In Xcode 4 preferences, it's configured to be ^ + ⌘ + ← (control-command-left arrow) to navigate back and ^ + ⌘ + → (control-command-right arrow) to navigate forwards.
Xcode 3.1.x is admittedly a bit weak in this respect. Happily, the navigation #zoul mentions (The back/forward arrows in the header bar, or ⌘⌥← and ⌘⌥→) is significantly improved in Snow Leopard, and should provide the finer-grained navigation you're hoping for. Sorry there's not an immediate solution, but hopefully it helps to know that a fix is coming...
There’s a Cmd + Alt + ← that goes back in editor history, and conversely Cmd + Alt + → that browses forward. (Not sure if this is exactly what you are looking for.) It goes well with Cmd + Alt + ↑ that switches between the header and the implementation file.
There are small arrows on top left corner of editor pane in Xcode.
On Macs with multitouch trackpads, you can also use three-finger-swipe left and right to navigate through the file history.
Also re: MrDatabase's comments on stefanB's response, if you've been actually jumping from definition to definition (by, for instance, holding down Command and clicking on a symbol) as opposed to just scrolling, I believe that the file history should track navigation even within the same file... perhaps that was a change in Xcode 3.1.3.
Control + Command + Arrow keys work for me.
Other than the 'complete shortcut list', I don't know.
You can find previous with ⇧⌘G, but that's not really what you were after I think.
In Xcode 13.0.0 you can use:
(OS: Mac 11.6)
Control + Command + → or ←
Hope this help!

Resources