How can I define collapsible regions? - ssms

Intellisense automatically adds these little '+' / '-' symbols in the editor that allow me to show/hide a section of code. I'm having trouble ascertaining the logical rules it uses to define these sections. I would like to add them to certain parts of my script, but I don't know how they get added. Anyone know if there is a way to manually add these?

Related

JetBrains IDEs live templates - place multiple carets

In IntelliJ live templates one can use $END$ to specify where the cursor should be placed once the template is expanded.
Is there a way to place multiple carets? Specifying multiple $END$ locations doesn't work. I sometimes need to type the same text into several places for what can be an auto-generated piece and that would be a nice expansion of functionality.
Currently as a solution I use "surround templates" where I can first type some text and then use $SELECTION variable.

How to find the name for indentation of object-attributes in .tsx-file in PhpStorm

I'm editting a .tsx-file and are reaching upon this bonkers file-formatting:
... If I enlarge the window a bit, then it makes more sense:
But I would still like to change it, so value and onClick aren't aligned all that way to the right. Ideally, it would try to align them with the opening bracket (as they do), unless the opening bracket is more than 35 characters, from the line start. Or something like that.
Now, I assume that it's the TypeScript-formatting that dictates the Code Style for a .tsx-file. But when I open the settings: Editor >> Code Style >> TypeScript then there are BAZILLIONS of settings.
Which leads me to three questions:
Does anyone know what I need to change, so object-attributes doesn't follow the opening-brackets width?
Could I find the name of what I'm looking for, in some smart way? I tried hovering over the massive space, hoping that the little yellow light-bulb could shine some light on, what I was after.
Are there any presets, to be found somewhere? So I don't need to engineer a new Code Style, if I dislike the default.
Make sure that the following option is disabled:
Settings (Preferences on macOS)
Editor | Code Style | TypeScript | Wrapping and Braces
Function call arguments: Align when multiline
NOTE: It is possible that the default value has been changed somewhere since the previous version as I have seen a few questions for the same option but different language (PHP and JavaScript).
HINT 1: Did you know that you can paste your own code in the preview area and start changing options to see how they will affect it? It helps locating the right option a lot.
HINT 2: There is a special popup that shows formatting rules applied to the code. It does not show all possible options but can give you a hint what to look for. To invoke it:
Use Help | Find Action... (or Action tab on Search Everywhere -- they use to be different popups but are using the same popup nowadays)
Type adjust to filer actions
Select and invoke "Adjust code style settings" action
It will give you a popup with applicable rules (it's a limited set: may not list all).
An example for PHP code:

Abbreviations in PhpStorm

IntelliJ comes with 2 abbreviations that I have used a lot in the past, but cannot find in PhpStorm:
iter Iterate (for each..in)
itar Iterate elements of array (traditional loop)
So whenever I typed iter and pressed tab, it generated an enhanced for-loop. How can I achieve this in PhpStorm?
PHPStorm has live template so you can use it to generate several types of code snippets.
Live templates can be used to insert frequently-used constructs into your source code, for example, loops, conditions, various declarations, print statements, tags, and so on. To expand a code snippet, type the corresponding template abbreviation and press Tab. Keep pressing Tab to jump from one variable in the template to the next. Press Shift+Tab to move to a previous variable
I think this link is useful and also suggest that you read this link
for creating a new snippet you can go settings > Editor > Live Template

How can I include a comment in GNU Radio Companion?

Especially when making examples to distribute with out of tree modules, I'd like to include comments in the flow graph. That is, I'd like to include text with no effect on the generated code.
How can I do that?
In any block’s properties, under the Advanced tab, there is a field called “Comment”. This text will be displayed below the block.
You can use the block Core → Misc → Note which allows you to put arbitrary text in its “Name” field.
Neither of these puts any comments or anything else into the generated code.

What does the scheme dropdown menu do in Phpstorm?

In the settings window of Phpstorm, there is a dropdown box labelled scheme
What does it do?
What does it do?
You may be surprised .. but it allows you to choose another (different) Code Style scheme for this project.
PhpStorm supports globally defined schemas (by default it provides only one -- "Default") which can be used by any project and project-specific schema called "Project" which available for this project only (and stored together with other project-specific settings).
You can read more in official help page.
The Code Style is used for code formatting: be it automatic as you type / use live templates etc .. or manual reformat via Code | Reformat Code...
It's used to
choose the code style scheme to be used as the base for your custom coding style for the selected language (Source).
In other words: after selecting a scheme, you can set different formatting options, like tabs vs spaces, tab size or line breaks etc. To use those settings in your current project, you need to click Manage, select your edited scheme and click Copy to Project. After this, you can press Ctrl + Alt + L (Code > Reformat Code...) in the editor to reformat a file according to those scheme settings.