Creating code hints in XCode [duplicate] - objective-c

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
How to create documentation for instance variable and methods in Xcode?
Eclipse-based editors such as PDT and Eclipse allow you to automatically add code hints for your custom code by using a special commenting syntax. Is there anyway you can add these code hints to your custom code in XCode?

I think you're looking for the code snippet library. The shortcut key is [control][option][command]2
The code snippet library will appear in the lower-right corner of the window.
You can select some code on your screen and drag it to the Code Snippet Library. This will create a new code snippet called "My Code Snippet" which will likely appear at the bottom of the list. You can single click the new snippet to view it in a pop-up. From there, you can click the edit button to make the snippet more useful.
For place-holders, use <# text #>. For example, <#height#> would produce a placeholder labeled height.
Use the field called "Completion Shortcut" for the text you want to type in order to activate the snippet.
When you're done editing the snippet, click the done button and start typing your Completion Shortcut text to test it out.

Related

Can I view only a specific part of code and make the rest disappear?

I'm using IntelliJ and VSCode and i'm wondering if there is a way to mark a part of the code and the tool will only display and focus on that code and will make the rest disappear. This will help to get rid of clutter code that i'm not interested in.
You can point the cursor over the code block you want to focus on, press Ctrl+Shift+NumPad - to collapse all code blocks and press Ctrl+NumPad - to expand the selected one. See Write and edit source code | Code Folding for more information.
In addition you can consider using Distraction Free Mode.

VBA: How to edit Attribute inside a Procedure?

I recently discovered that is possible to use Attribute [ProcedureName].VB_*, inside procedures.
What I found
But this code is not shown inside VBA Editor.
Same code in VBA Editor (left) and exported .cls in Notepad (right)
When Attribute is written inside VBA Editor, it's marked red
Attributes added manually in the VBA Editor
The question
Is there more elegant way how to maintain these Attributes than export class module, edit them outside and import them back (facepalm needed)?
Also I haven't found official documentation for these Attributes (on https://learn.microsoft.com/en-us/office/vba/).
Thank you!
PS: As always I hitted something interesting and related just after Question had been sent. A step-by-step example on Microsoft Docs site suggests to do it by Export-Edit-Import method :(
The process for getting Rubberduck to apply annotations requires a few steps.
Execute a Rubberduck refresh. If the code does not compile cleanly then Rubberduck will show a 'Parse Error'. In this case you need to sort out your code first. This can be an issues if you are applying Rubberduck to an existing code base. If not then learn to compile and rubberduck.Refresh early and regularly (i.e. after every complete edit)
If Rubberduck parses successfully you then need to look at Rubberduck.Code Inspections. To take action about an inspection result select the individual result and right click. This will provide a list of actions that can be applied by Rubberduck.

IntelliJ IDEA - How to remove auto generated hints? [duplicate]

This question already has answers here:
How to disable parameter hints in IntelliJ IDEA?
(2 answers)
Closed 5 years ago.
Am trying out IntelliJ IDEA 2017.1.3 (being an Eclipse user, there's been a lot of great nods to both Jetbrains and IntelliJ IDEA being sophisticated, so I have been fooling around with it all day and actually enjoying some features).
Wrote a simple unit test (which worked) but am noticing inside the editor that its auto-inserting my variable's value with a grey background following a colon ":" afterwards and also inside the assertEquals() method its adding a grey background for the word "expected:".
After placing my mouse cursor and clicking the second button, a dialog came up stating "Disable Hints" and I was able to get rid of them manually, but am wondering how to not have them appear by default.
Attached is a screenshot (a picture speaks a thousand words)! :)
How can I turn this off? Am using the macOS version of IntelliJ IDEA.
You can permanently disable them by go to Preferences.. > Editor > General > Appearance > Show parameter name hints (uncheck to disable)

Intellij: Highlight current block of code

I was wondering if it is possible to highlight the block of code you are working on in Intellij Idea.
There was a similar question here: Is there a way to highlight the currently active code block in Visual Studio 2010? .
So what I mean is that if you have clicked into e.g. a method or a while loop... ,the background of the whole block becomes a bit lighter or whatever.
There's already one such feature, but it's more subtle, in the form of a vertical line inside the left gutter... I can't recall whether it's enabled by default or not, but you can activate it by File -> Settings -> Editor -> General, scroll to the Highlight on Caret Movement section (about half of the page).
I looked around for a while but I have not yet found a way to change its appearance to match your description, although I personally prefer this less intrusive highlight than having all the background changed.
P.S. Not sure this is relevant or useful to you, but there was a plugin I tried a while ago called CodeGlance which offered a scrollable-map of the class:
I don't know when this feature was implemented. As of 2021, if you double click anywhere in the scope ( but not on text ), Intellij selects the current block of code ( text within two curly braces ).

Choose a snippet from the AutoComplete window in Xamarin Studio

I am running Xamarin Studio 4.2.3 on Windows. I have it set to show the autocomplete window automatically when typing... so for instance, when I type cw the following appears:
The editor will allow me to choose CswWriter from the list and press either TAB or ENTER to replace the cw with CswWriter.
However... it will not allow me to choose the cw snippet from the dropdown. I also dug through the Key Bindings dialog looking for the ability to bind something like "Expand Snippet" to a key and did not see it.
Anyone know what's going on? How do I expand the snippet?
I CAN bind a key to "Insert Template...", which pops up another autocomplete-like window with only code snippets in it... but why put them in the normal autocomplete if it won't actually let you choose them?
Xamarin Studio has similar behaviour to Visual Studio. To expand the snippet you need to press tab when the completion window is closed.
When you type in cw, the auto-completion window is displayed, pressing tab will then complete the text, in this case cw, which you have already written. Now if you press tab again the code snippet will be expanded.
The first tab key press in your example is a bit confusing since you have already typed in the full text, however for longer code snippet names (e.g. 'prop' and you have typed in just 'pr'), it is less confusing since you will complete the text for the code snippet with the initial tab key press, then pressing tab again will expand it.
Visual Studio displays the message "Press TAB twice to insert the snippet" in the code completion window to make it more obvious what you need to do.