About scopes in Sublime Text 3: text.something vs source.something, and their features - sublimetext3

So I'm contributing, for the sake of learning a bit more of the innards of ST3, to a repository making a new package for Laravel's Blade templating.
In the .sublime-syntax file, the scope is currently set as scope: text.blade, which works fine except for that fact that I cannot make the autocompletion popup appear for my snippets. For that, I need to change the scope to source.blade. But doing to kills the ability of using div.foo+ tab to expand it to <div class="foo"></div>.
I know I could change auto_complete_selectorin my preference to include text, but that's just a solution for me. We wouldn't want to have a package that asks you to change your preferences, we'd want it to just work.
Would there be a way, in my syntax file, to have the autocomplete popup activate while still in the textscope and keeping both features (popup for autocomplete and the tab to expand)?

I'm not sure which is the best solution. It maybe makes sense that the default setting for auto_complete_selector doesn't work in the text scope, but I don't understand why it's not working in text.html. Anyway, the way I see it, you have two options, each of them having their cons.
Don't mess with the user's setting, but communicate the need to adjust the auto_complete_selector, e.g. by using the Messaging system provided by Package Control. Con: users might ignore READMEs or install messages.
Override the user's setting by including a .sublime-settings that adds text.blade to the auto_complete_selector (I've seen packages doing just that!) Con: interferes with user settings.
On a side note, I'm wondering whether it wouldn't be more appropriate to use text.html.blade as a scope.

Related

Is there a way to get Keyboard change reflect on Appimage?

I am using ibus keyboard layout and I can change the language globally, However this change is not reflected on Appimages (I am using Inkscape). Is there a solution to this problem or are Appimages supposed to be like this?
This needs to be addressed by the Inskape AppImage authors. They are the ones who decide whether the bundle will use the system settings or a fixed language/keyboard preferences.

VSCode Vim multiple cursors

I have looked everywhere and I am still unable to switch off this 'feature'!
I've been using vi and, later, vim, since the 80's and I have never had need of multiple cursors, nor can I see a use for them.
:<range>s/search/replace/ does everything I need so this new feature is infuriating beyond words, especially as I've no idea how to switch it off when it seemingly-randomly appears.
Would someone be wonderful enough as to tell me how to banish, remove, consign-to-history the multiple cursors feature in VSCode Vim 1.12.4, please?
I believe this issue is specific to the plugin. I experienced it with the HTML plugin recently, and I'm assuming you have the same problem with HTML files, but the same principle should apply to other plugins as well. You just have to find the setting.
In the VS Code settings, there is an option that reads:
HTML: Mirror Cursor On Matching Tag
You can uncheck the box there to disable the feature. Or you can go to the settings.json in your local repo (inside the .vscode directory), or the equivalent global file, and add/modify the following field like so:
"html.mirrorCursorOnMatchingTag": false
That should take care of it for you.

Chose a color for a particular method in VS2012

Pretty dumb question I know,
I want to know if there is a way to assign a particular color to a method of my choice in .cs file.
So that i donot even accidently go and write or change anything there.
No, Visual Studio does not support this behavior natively (though someone could write an extension that did it).
Some ideas, though...
My first suggestion is to use version control so that any changes you make can be reviewed and reverted.
My second is, in C# you could use a partial class to keep all the code that should never change in one file and the code you can change in another file. You could even go further and set the readonly flag on the file you never want to change (though check how this affects your source control system).
But use version control either way.

ReSharper - Is there a disable command I can add to a file that will not allow reorder of type members?

Much like
// ReSharper disable ConvertToAutoProperty
I would like to know what, if existing, I can add to particular files (and only particular files) so that fields are not sorted on code cleanup.
For more information:
I know there are settings one can set in R# itself. This needs to work even where I don't control settings (like on other people's computers)
I know I can make a setting to disable sorting for particular types in TypeMembersLayout. This also will not work due to the same reason.
I only want this to happen on files I care that it doesn't happen with, not a global setting.
I've been using Resharper for years, and can say with confidence this option doesn't exist. Good idea though..
Maybe Generated Code options can help you. But I didn't try it.
Go to ReSharper->Options->Code Inspection->Generated Code and add your files.
I think ReSharper leaves such files untouched.

Alternatives to Struts-Menu for Menus in Struts 2.X Application

Per user feedback, I am opening a new question for this topic.
So I am currently using Struts-Menu to handle my menu needs for my Struts 2 J2EE application. It is not necessarily a package I wish to work with I have found by playing around with it. So what are some alternatives to this package? I immediately flocked to Struts-Menu because I saw a fair amount of web search traffic pointing to it, including those who use Struts2. What I am worried about is difficulty in the future of making it work with other packages, given its 2007 last update and the extra tap dance I had do to make it work with my configuration. It seems too fragile at this point for my taste.
I have several different menus in my app, but the one I am specifically addressing at the present is like this ... The top level menu drops down upon mouse hover over it. The submenus expand horizontally upon mouse hover. Exactly one menu item can be selected as no radio buttons or check boxes are contained in the menu. This particular menu does not require db access to populate its children. It works sort of like Velocity CoolMenus4 from the Struts-Menu demos.
I've never used struts-menu, but it looks like overkill to me.
I would recommend that you locate a menu that you like and then write a tag file to handle outputting it in your view layer. To me, that's a lot easier than using a framework or library just to output a menu. Plus, its specific to the actual menu you want to use. Your tag can handle doing security checks to ensure that the user only sees what they have permission to access, etc.

Resources