Fold Razor Comments in VS2012 - visual-studio-2012

I have large blocks of code in .cshtml file that are commented using the following syntax.
#*
...
*#
But Visual Studio doesn't show code folding option for this block. Is there a way to do so?

You could have a normal html comment around this as one solution.
Might not be the most elegant solution but it woorks.
<!--#*
................
*#-->

Related

Android Studio using Kotlin - is there a way to automatically fold multiline comments?

Been getting into Android Studio (and Android development in general) lately, mostly a personal challenge to make a modern version of an app my mum loves but hasn't been updated in ages. But my life story isn't the point, and that's not just because it's not that interesting.
The actual question:
Is there a way to make Android Studio do automatic folding for block comments (i.e. /* to */) in Kotlin files? In Settings > Editor > Code Folding there's options for documentation (in general) and multiline comments for C or Java, but no settings specific to Kotlin, and just one for Android in general (which has nothing to do with comments).
The reasoning: Because I'm still pretty new at this, there's a lot of things I've tried but haven't worked, and comment out instead of deleting because I still might be able to learn something from them later. There's also some big blocks of logging code for debugging that are great when I'm trying to debug but in the way (given I usually write them in the middle of classes or methods) when I'm not, so I comment them out. It's just annoying having to fold several sections of comments whenever I open a file.
The "well duh" solution?: I could set them as documentation comments, which would hopefully get automatically folded, but if I start writing documentation (like I really should get around to) they'll get mixed in and that would be annoying.
What I've tried so far: Going through all the settings with a fine tooth comb (and I'll freely admit I could have gone over something obvious) and searched for plugins for code folding, about the only one I could find is https://plugins.jetbrains.com/plugin/12007-foldingplus which doesn't seem to do anything about this particular problem.
Can anyone help me out here, other than maybe "be less of a newbie in general"?
With Android Studio Arctic Fox I found that if you highlight a region that has the comments in question, you can right-click on it and one of the options will be Folding. From the expanded options select Fold Selection / Remove Region and the selected comments will fold.

I can't see Malware code whine I use any editor

I have Malware code (java), I can see the code using (view source), I can't see bad code when I use any editor to delete the code, My domain is pointed to CloudFlare. What do I need to do to see the code and delete?
Try to enable line wrapping in editor. It is possible lines with bad code begin with many spaces and code shifted from begin of line to place where it need to scroll to right.

Collapse all xml comments in Visual Studio 2012

I have recently been given an existing project to work with that is very comment heavy, especially in terms of XML comments. In many cases the methods are short and simple and the XML comments take up more than half of the lines in the file. As much as I'd like to blow them all away with a quick find/replace, I'm not in a position to do so.
Is there a command, extension, macro, anything that will collapse all XML comment blocks in a couple of clicks/keystrokes? My Googling has only yielded solutions for older versions of VS.
Check out this blog post, the macro provides two functionalities - one is collapse all XML comments, the other one is toggle all XML comments.
The blog post mentioned that the macro should work for Visual Studio 2005 and above so I suppose it will work in VS 2012 too. I am using VS 2010 and it is working great for me even after I hook the macro up with keyboard shortcuts. I am glad that I found the blog post link in one of the answer in another stack overflow question =)

How to configure rules in JSLint extension for Visual Studio 2012

I tried to use JSLint.VS2012 extension to check the JavaScript code. it is useful for it found a lot syntax issues in my code. However, is it possible to configure the rules in JSLint to enable/disable certain rules? Currently, I'd like to switch off 2 rules:
1) The code format checking. Because I use Visual Studio 2012 as the editor, it has a default code formatter, the formated code is OK for me. But, seems JSLint requires a different code format style, so I prefer VS2012 auto format feature, and need switch off the JSLint rule. Here is a snapshot shows JSLint complaining the 'bad' formatted code.
2) The second I want to be disabled rule is "Unexpected 'else' after 'return':
I don't this rule is good, but guarded return could improve the readability of if-else switches, below is a snapshot:
This has been silent long enough I'll at least answer for VS 2008 and hope it's similar for the VS 2012 plugin.
Question 1: Go to your tools menu. Select "JSLint Options". Look for "Tolerate sloppy whitespace", and check it. Hopefully the 2012 version has a similar checkbox.
Question 2: The second is a little nastier. I don't believe there's a setting to turn it off, but even the VS plugin just uses the JSLint javascript file under the hood (or at least the 2008 version does via Noesis). So if you want, you can open up jslint.js and edit it.
If you edit this part, the error is ignored:
if (peek(0).id === '}' && peek(1).id === 'else') {
// commented out >>> this.warn('unexpected_else');
}
Voila. The JSLint code really is good, clean stuff that's easy to customize. But I am required to say that you really should take JSLint's advice, and in this case, I'd tend to agree. But inherited code? Comment the line out and keep moving along.

Indent code in Dreamweaver

I've searched a lot for this and can't find how to Indent code in dreamweaver...
COMMAND-OPT+] - I've found this on google but it didn't work with me, I'm using a mac book air and to achieve ] I have to do alt+9 ( ] -> alt+9
I just want to indent automatically a bunch of code.. I know dreamweaver has automatic indenting but that just works when I'm writing code, but when I copy piece of code that are not indented like I do, ( I use tabs ), it doesn't indent them. I have to do it manually
Thanks
I typically use the formatting tool at http://www.freeformatter.com/html-formatter.html#ad-output. If you're using a copied block of code, you could format it with this tool and paste it accordingly into your existing code. An extra step, but well worth it in my experience.

Resources