IntelliSense: aria-valuemax and data-ng-style aaaargh? - visual-studio-2013

While typing code in a Razor (.cshtml) file using Visual Studio 2013 (Update 4) with ReSharper 8.2.3 (updated by suggestion from this question), my IntelliSense is doing stuff that is driving me crazy. I am a heavy user of the IntelliSense+Tab key when typing to speed up my coding, but some common keywords keep defaulting to suggestions that aren't as intuitive as you'd think. Examples:
<input type="whatever" value="something" /> prefers aria-valuemax instead of value:
<input type="whatever" style="yada yada" /> prefers data-ng-style instead of style:
I know this is a niggling thing, but it is driving me nuts, and it seems to me that IntelliSense should be preferring value and style here simply because what I'm typing does not start with aria and data in the respective examples. Does anyone know how to turn this behavior off?

This is the AngularJS plugin for ReSharper. The latest version is a bit more sane with respect to item ordering and will choose style over data-hg-style. However, most of this goodness comes from ReSharper itself, and the latest version of the plugin requires ReSharper 9.1.

Related

In Razor Pages with Visual Studio 2019, editing a tag attribute will scramble all tag helper attribute values

I'm making a web application using ASP.NET Core 2.2 and trying out Razor Pages more or less for the first time. When using "asp-for" attributes in order to bind an HTML input to a PageModel property, everything works just fine, but then when editing any attribute in any HTML element in the script that also has an "asp-for" attribute defined, all "asp-for" values for every other element but the one I'm editing are scrambled/wiped out.
I'm using the latest version of Visual Studio 2019 Community Edition and all extensions are up to date. ASP.NET Core 2.2 and all included packages are their respective latest stable versions.
I've tried disabling all extensions one by one, restarting the application each time to see if one of them is causing any strange behaviour- I'm not using many to begin with though, mostly just GitHub integration and "Format on Save" at the moment.
I've also tried going through the preferences and unchecking many of the validation options for HTML and C#, and things like automatic quotations for new attributes and closing bracket insertions... basically, anything that I thought could potentially have an impact. Nothing has worked.
An example would be something like:
<div>
<table>
<tr>
<td>Entry ID:</td>
<td><input type="text" asp-for="EntryID" /></td>
</tr>
<tr>
<td>Entry Name:</td>
<td><input type="text" asp-for="EntryName" /></td>
</tr>
</table>
</div>
When editing any of the attributes for any element with an asp-for attached, the asp-for value for the other tags will be scrambled. This happens both when I use the backspace key or the delete key, so it doesn't appear to be keyboard-shortcut related.
Here's a gif of the issue (not enough reputation to post images apparently- apologies).
https://drive.google.com/file/d/1f1gZSvGrQ8ehpTNwKOA2YbCkfLhx_o-M
If anyone has any ideas, I'd be quite grateful. This is really killing productivity and I haven't really come up with any ways to consistently get around the issue- usually when deleting the entire attribute all at once (which still scrambles other values), I can hit Undo once and it'll undo the scrambling but not the deletion itself. That's not 100% though, so it's just a big headache all around.
UPDATE 7/31: I've gone ahead and reported this to Microsoft as per Peter B's suggestion. A link to the report can be had here if anyone comes along with the same issue and are wondering at the progress there.
Your gif shows it happening for the id attribute, but you shouldn't try to specify the id because the Input Tag Helper already does it for you:
The Input Tag Helper:
* Generates the id and name HTML attributes for the expression name specified in the asp-for attribute. [...]
Source:
https://learn.microsoft.com/en-us/aspnet/core/mvc/views/working-with-forms?view=aspnetcore-2.2
I agree that it seems to be acting a bit weird. If it persists, you can try reporting the weird behaviour, as described here: https://learn.microsoft.com/en-us/visualstudio/ide/how-to-report-a-problem-with-visual-studio?view=vs-2019

Change VS 2015 to use EcmaScript 6?

I am using visual studios 2015 to write react code. I am trying to understand ReactJs.net as well.
When I made my app.js folder and put this code in
import React from 'react';
const App = () => (
<div>
<h2>User List</h2>
<UserList />
<hr />
<h2>User Details</h2>
<UserDetails />
</div>
);
export default App;
everything is underlined and I see this message
"EcmaScrpit6 feature. Your current language level is EcmaScrpit5"
How do I change so I don't get this message anymore?
Old post but here's the answer since this issue does arise now and then: This is a ReSharper error that results from scanning your Javascript code. If you place the cursor over the code with squiggly red lines under it and press alt-Enter to bring up the ReSharper context menu, you will be offered the opportunity to 'Change to ...', whatever the feature you are using requires, e.g. ECMAScript 2015 or whatever. Make sure you do not exceed whatever you have configured in your Typescript config (tsconfig.json) compiler options and double-check browser compatibility before you change to a new higher ECMAScript level in your Javascript code.
If you want to manually manage what ReSharper complains about, Click Extensions/ReSharper/Options in Visual Studio to bring up the ReSharper options dialog. Scroll down to Code Editing->Javascript and click Inspections. You will see a drop-down with the label 'JavaScript language level:' there. Select whatever ECMAScript level you want there and save the settings. Done.

Zen coding support for CSS in Web Essentials 2012 for Visual Studio

i'Ve installed web essentials 2012 for VS2012.
But it seems it doesen't support zen coding for css??
or am i missing something??
please help..
thanks.
Web Essentials only supports ZenCoding for HTML. I decided to wait with the CSS implementation because of the CSS editors rich Intellisense and snippet support. They would most likely conflict with ZenCoding
Here's a sample to try :
h1{Good Example}#test.classname+#sibling1{div sibling1 text}+#sibling2{div sibling2 text}+h2{header2 text}+ul>li>a[href="http://stackoverflow.com"]{stackoverflow link}^li>a[href="http://codeproject.com"]{codeproject link}
Hit [TAB] Key to Expand
Remember to hit [tab] key after typing the sample, to expand the zen code to real HTML.
The sample above will expand to the following:
It will render in the browser to look like this:

How to change the z-order of classes in the Visual Studio Class Designer?

Maybe I am misunderstanding what the Class Designer in Visual Studio was intended for, but I am really struggling with expanded classes being displayed behind other classes on the canvas.
I would like to have two collapsed classes, one above the other. Then when I expand the class above it should display above the class below, so that the class below does not obstruct the members of the class above.
I realise that adding my classes in the right order will do this, but I don't want to re-add all controls when I want to change layout. Where is the "Send to Back / Send to Front" button??
Not sure this is still an issue but I just had a similar problem when visualizing things in "UML-like" structures in VS 2013.
I found that a more or less simple way might be to change the order in the .layout file:
The example hopefully shows how to do:
First example - Action is "under" the Object:
<actionShape Id="..." absoluteBounds="..." customColor="...">
<opaqueActionMoniker Id="..." LastKnownName="Action1" />
</actionShape>
<objectNodeShape Id="..." absoluteBounds="..." customColor="White">
<objectNodeMoniker Id="..." LastKnownName="Object" />
</objectNodeShape>
Second Example: I changed the order. The Action is above the Object:
<objectNodeShape Id="..." absoluteBounds="..." customColor="White">
<objectNodeMoniker Id="..." LastKnownName="Object" />
</objectNodeShape>
<actionShape Id="..." absoluteBounds="..." customColor="...">
<opaqueActionMoniker Id="..." LastKnownName="Action1" />
</actionShape>
I know, this is probably not the best way to do but it's the best I found.
Hopefully it helps to anyone.
Sorry for digging up an old post, but from the looks of it there aren't any such buttons, nor have they been added in Visual Studio 2012. Based on what I found in the MSDN forums here, this has been brought up before. I'm not sure if either of the posters in that thread actually went on to add the suggestion in Microsoft Connect, since it seems to be all VS 2012 now, but I've added a request for it here. Hopefully they get around to it eventually.

Is there a way in Sublime Text 2 to support JavaScript completion of objects/functions defined in other files?

If I am editing a .js file in Sublime Text 2 that makes use of a library defined in a separate .js file, is there a way to support tab completion of objects/functions defined in the external library file?
Something analogous to the following from Visual Studio:
/// <reference path="/js/some-library.min.js" />
which enables IntelliSense over the library/plugin code.
I haven't tried it myself yet, but there's SublimeCodeIntel: https://github.com/Kronuz/SublimeCodeIntel#readme
The OP in this thread: http://www.sublimetext.com/forum/viewtopic.php?f=3&t=5319 seems to be complaining that it's pulling suggestions from outside the current file, which may mean it's doing what you want.
I was looking for the exact same thing, and I can confirm that SublimeCodeIntel works well. However, Sublime Text seems slightly less responsive when using SublimeCodeIntel, which is a drawback.
Another cool thing coming from a Visual Studio environment is the support for "Go to definition" in this plugin.
Another option is TernJS:
http://emmet.io/blog/sublime-tern/
I haven't yet used it, but it looks promising. Editor slowdown seems to be an issue with any code completion plugin; sounds like authors are still working out kinks in scraping and caching related files for code completion. The TernJS page addresses this issue and offers some config options for managing how it handles related files.

Resources