Re: Is the snippet editor just totally broken?
Re: Is the snippet editor just totally broken?
- Subject: Re: Is the snippet editor just totally broken?
- From: Eeyore <email@hidden>
- Date: Mon, 26 Mar 2012 19:12:48 -0700
You cannot edit the System Snippets. I believe this is probably a good thing (imagine two users on the same machine whose styles differ who "fix" the snippets every time they log in). You can add User Snippets which will override the System Snippets. Take the block of code you wish to keep as a Snippet (e.g.:
if (<#test#>)
{
<#statements#>
}<#end#>
and drag it into the Snippet Library and you will be able to edit this Snippet (the <# #> are placeholders). You can use the System Snippets to determine the necessary information to get the overrides (e.g., the Completion shortcut for an if statement is "if") and it has a Completion Scope of "Function or Method").
Yes, it would be nice if the Edit button for System Snippets said something like "View" instead of "Edit", yes it would be nice if there were a + button down by the Filter textfield. Yes it would be nice if there were a "Duplicate" in the System Snippet popup to make it easy to override system snippets. These are probably all good things to suggest to file enhancement requests on (and will probably be closed as duplicates), but those flaws are a far cry from "utterly broken" and the instructions for adding Code Snippets can be found in the documentation:
Xcode 4.3.1 Developer Library>Tools & Languages>IDEs>Source Editor Help>Creating a Custom Code Snippet (second "Tools Guides" hit when searching for "Code Snippet Library").
Aaron
On Mar 26, 2012, at 6:39 PM, G S wrote:
> I went to change the snippets that control the formatting for, among other things, "if" statements. This was suggested as a workaround to the disappearance of all other methods of controlling auto-formatting.
>
> After clicking on a snippet to pull up the dialog, then pressing Edit on the dialog, I placed the cursor in the code area and started trying to change it. Nothing happened.
>
> Nothing happens in any of them, and nothing is enabled in the bunch of controls above the code.
>
> So the code-formatting user defaults don't work. There's no langspec file anymore, apparently. And the "new" method of resolving code-formatting issues appears to be utterly broken.
>
> Does this sum up the situation accurately, or is there yet another workaround?
>
> Thanks for any insight.
> _______________________________________________
> 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
_______________________________________________
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