Delete a User Code Snippet in Xcode - xcode

How ??? I can not delete a custom code snippet in Xcode.

I did these steps :
Select needed code snippet and press Delete key.
A pop-up window will appear , and select Delete button.
Remember that : this action cannot be undone.

In the Library select the code snippet you want to delete and press Backspace. A confirm dialog will show up, click "Delete".

Good question, I haven't found a way to do it from within Xcode, but they can be deleted from the Finder. The snippets are stored at ~/Library/Developer/Xcode/UserData/CodeSnippets/. Each one is a separate file that you can delete. Unfortunately they're named with an ID and don't give an indication of which one is which. They're XML files though, so either use a text editor or QuickLook to see the contents and recognise them.
Also, I've had to restart Xcode in order to get the deleted snippets to no longer show up.

I was having trouble, and after messing around a bit it finally worked. You select the user snip and hit the delete key. I tried this multiple times but it didn't work initially. This may be due to me running a prerelease version of Xcode though.

In Xcode 10, select snippet from snippet pop-up dialog.
Then press Shift+⌘
After that just confirm your removal.
Note: This process cannot be undo at this moment.

I was trying forever to delete the useless (to me) C++ ones, but apparently you can only delete the user-created ones in Xcode 10. Bummer.

User-created code snippets are located in
~/Library/Developer/Xcode/UserData/CodeSnippets.
If your XCode UI for deletings snippets doesn't work as in my Xcode 10.2.1, you can navigate to this folder and
either delete all user snippets with rm * or use some kind of cat/grep to find the ones you want to delete.

In xcode select the code snippet
Delete title and shortcut and save it after that select the same and press delete a confirmation box pops up asking you to delete or cancel the code snippet.

Related

Xcode 8: custom description in suggestion

I'm trying to have custom description for my functions shown in the suggestions box which shows up as I type said function names, the same way it works for swift functions: e.g the UIActivityIndicatorView.startAnimating() description is shown both in the
QuickHelp menu AND in the completion box
in Xcode 7 I would just add a comment line with the /** */ tags prior to the function declaration and the ide would recognize it accordingly e.g.
but for some reason doing so with Xcode 8 only shows the custom description within the QuickHelp tab of the Utilities menu, and not in the suggestion box.
Is there any suggestion about how I may obtain the same behavior with this new version of Xcode? I would appreciate it a lot!
Hear i found some solution. You need to change User Header Search Path No to Yes under Build settings. And then restart your xcode.
This is working fine for me.
It is because of Indexing.... just go to your project name at the top of navigation and Clean (cmd+shift+k) then come again to the file where you wanna work type any word you will see suggestion popUp. that it..
Other way is that just quit your xcode and open it again and wait for a moment let xcode indexing the files then type any word you will see suggestion popUp. that it..

Remove unwanted code in Visual Studio 2010?

When I'm creating a GUI of Windows Forms in Visual Studio, I sometimes happens to double click on a component and get some auto generated code. To remove this unwanted code, I read somewhere, but I can't remember where, to remove this code you shouldn't delete it, it should be done in some other way to prevent future errors. How do I remove this unwanted code in Visual Studio the right way?
Normally, I simply delete the code and nothing bad come out of it. At worse, when you try to build, you'll get an error in the designer.cs saying some code is not found. Simply delete that and everything will work fine.
You can also use Ctrl+Z when you double-click, but it will delete the component you double-clicked on and you'll have to add it again to your form.
AFAIK, the answer is NO. Unless there is some specific add-ins from Microsoft (Which I am not aware off) which enables it.
So, You will have to manually delete the unnecessary code which have been auto generated.
Control-Z - it will remove the event handler registration from the YourForm.designer.cs file and also the method from YourForm.cs file.
A warning box will come up as soon as you press Control-Z, just click yes.
Just remove it from the XAML code. For example, if you double click a button, search for Click="button1_Click" in your XAML and delete it.
If you created a Windows Forms project, go to Solution Explorer and open file file Form.Designer.cs and from function InitializeComponent() delete this line:
this.button1.Click += new System.EventHandler(this.button1_Click);

XCode 4 Cursor Jumps To First Line When Auto Suggesting

I have a problem in XCode 4.2 when I have the autosuggest feature turned on. Whenever an autosuggest (autocomplete) pops up, the cursor will jump to the top of the file, to the second character of the first line. This happens regardless of whether or not I select the autosuggest or take any other action. As soon as I turn off the autosuggest feature, this behavior stops happening.
I have turned off all key binding associated with jumping to the top of the page and have deleted all derived data for the project as per some suggestions I have heard, but have not been able to solve the problem.
Anybody have a solution?
I had similar problem Xcode cursor jumped randomly. It was triggered by an editor theme using an italic font. I changed the font to a regular one, and the problem was resolved.
Simple solution (or workaround):
Open Preferences.
Open Fonts & Colors tab.
Select Basic theme.
I got the hint from this page.
Just in case there is a bounty awarded :) let me repeat my "solution" from above: I suggest moving aside your /Developer folder and re-installing Xcode. Simply running the installer w/o removing the old /Developer folder may not replace all the necessary files. Good luck.
I have had a similar problem where the cursor jumped to the top and I couldn't scroll down. I don't know if it is the same problem that you have but there is no real solution. Its just one of Xcode's bugs there are a lot more. Open another file in the project and go back to the file you were working on, close and reopen the project or restart Xcode. Thats the only solutions I found.
If thats not working, then you can always re-install Xcode

Is there a way to rename an Xcode 4 scheme?

I've been looking all over Xcode for this, but I can't find any place that allows you to rename an existing scheme in Xcode 4. Is this even possible?
You need to click on the scheme button, then hit "Manage Schemes". Once you do so, you'll have a window like this:
Select the scheme you want to change, and hit Return.
Now the scheme name will be editable, and you can change it to your hearts desire. Then hit Return again to save it.
A slow double click also does the job.
Click once to select it. Then again click on selected title to get to edit mode.

Eclipse's tab double click on Visual Studio?

On Eclipse, whenever I double click a tab, it fills the workspace (by hiding all other views like project tree, console, etc).
Is there any way to do this on Visual Studio?
Note: i'm not looking for full screen, just want a way to declutter the workspace but still have access to menus.
Are you after this?
Set shortcuts for the Window.AutoHideAll function and for the Window.ResetWindowLayout function. In order for the ResetWindowLayout to work, you have to export your settings (make sure you select "All Settings") with all windows expanded and then import them again.
ResetWindowLayout will restore all windows to the way they were the last time you imported your settings.
Not with double click on tab, but you can do the same with Shift+Alt+Enter key combination.
This keyboard shorcut was changed to F11 from 1.9.1 vscode version.
All keyboard Shortcuts: https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf
I was looking for that, as well, and I now just got used to using full screen (Shift+Alt+Enter), which hides a little too much, which you seem to think, as well, but does in fact still show the menus.
Looks like drby got it on this one. Just FYI. I pinged the VS team to ask about this and here is the response:
"There is no way to reverse the command automatically. For it to work as a toggle we would need to save which toolwindows were auto hidden and which ones were not when the command was run, which we don’t do (it would cause lots of interesting persistence questions, across profiles and VS sessions)."
The idea of a "Unhide All" command is what I suggested. So if you hide all then you can unhide all as well. There might be some windows you don't want to unhide but the 1 or 2 extra windows is better than not having an unhide IMHO.

Resources