Directive attributes are hard to type in editor
See original GitHub issueWhile the new directive attributes feature is great, it feels like the editor experience needs a lot more review and polish. Trying to type them is quite a bizarre and hostile experience currently 😃
Examples:
- Try typing
<input @bind="@someText" @bind:ev. It will prompt you to auto-complete@bind:event, which is perfect, but then if you press tab to accept the suggestion, it replaces what you just typed with<input @bind="@someText" @bind="", which is not at all what you want. Note that it only does this if you’ve just typed out all of what I wrote here, and not if you go back and edit an existing<input>. - Try pasting this into a
.razorfile:<input @bind="@someText" />. For some reason it inserts a space between@andbind, so you get<input @ bind="@someText" />. Was this recently fixed? I remember hearing something about this. - Try typing
<div @bindand then press the=character. For some reason it transforms what you typed into this:<div bind-="". I know it’s strange to try doing abindon adiv, but this still is an editor bug. Maybe it surfaces in other ways too. - While I was doing some of the above (don’t remember what triggered it exactly), VS reported an exception. The log file contains a lot of entries like this:
<entry>
<record>1127</record>
<time>2019/06/05 12:12:27.457</time>
<type>Error</type>
<source>Editor or Editor Extension</source>
<description>System.ArgumentException: An entry with the same key already exists.
 at System.Collections.Specialized.ListDictionary.Add(Object key, Object value)
 at System.Collections.Specialized.HybridDictionary.Add(Object key, Object value)
 at Microsoft.VisualStudio.Utilities.PropertyCollection.AddProperty(Object key, Object property)
 at Microsoft.VisualStudio.Language.Intellisense.Implementation.ShimCompletionSessionExtensions.ToLegacy(IAsyncCompletionSession session, SnapshotPoint triggerLocation)
 at Microsoft.VisualStudio.Language.Intellisense.Implementation.CompletionBroker.CreateCompletionSession(ITextView textView, ITrackingPoint triggerPoint, Boolean trackCaret)
 at Microsoft.VisualStudio.Language.Intellisense.Implementation.CompletionBroker.TriggerCompletion(ITextView textView)
 at Microsoft.WebTools.Languages.Shared.Editor.Completion.CompletionController.TriggerCompletion()
 at Microsoft.WebTools.Languages.Shared.Editor.Completion.CompletionController.ShowCompletion(Boolean autoShownCompletion)
 at Microsoft.WebTools.Languages.Shared.Editor.Completion.CompletionController.OnPostTypeChar(Char typedCharacter)
 at Microsoft.WebTools.Languages.Html.Editor.Completion.HtmlCompletionController.OnPostTypeChar(Char typedCharacter)
 at Microsoft.WebTools.Languages.Shared.Editor.Completion.TypingCommandHandler.OnPostTypeChar(Char typedChar)
 at Microsoft.WebTools.Languages.Shared.Editor.Completion.TypingCommandHandler.PostProcessInvoke(CommandResult result, Guid group, Int32 id, Object inputArg, Object& outputArg)
 at Microsoft.WebTools.Languages.Html.Editor.Commands.HtmlTypingCommandHandler.PostProcessInvoke(CommandResult result, Guid group, Int32 id, Object inputArg, Object& outputArg)
 at Microsoft.WebTools.Languages.Shared.Editor.Controller.Controller.Invoke(Guid group, Int32 id, Object inputArg, Object& outputArg)
 at Microsoft.WebTools.Languages.Html.Editor.Commands.HtmlMainController.Invoke(Guid group, Int32 id, Object inputArg, Object& outputArg)
 at Microsoft.VisualStudio.Html.Interop.CommandTargetToOleShim.Exec(Guid& guidCommandGroup, UInt32 commandID, UInt32 commandExecOpt, IntPtr variantIn, IntPtr variantOut)
 at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.InnerExec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
 at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.InnerExec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
 at Microsoft.VisualStudio.Editor.Implementation.SimpleTextViewWindow.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
 at Microsoft.VisualStudio.Editor.Implementation.VsKeyboardFilter.SendCommand(Guid cmdGroup, UInt32 cmdID, Object inParam)
 at Microsoft.VisualStudio.Editor.Implementation.VsKeyboardFilter.TextInput(TextCompositionEventArgs args)
 at Microsoft.VisualStudio.Text.Editor.Implementation.KeyProcessorDispatcher.<>c.<DispatchTextInputEvents>b__6_0(KeyProcessor p, TextCompositionEventArgs args)
 at Microsoft.VisualStudio.Text.Editor.Implementation.KeyProcessorDispatcher.<>c__DisplayClass10_1`1.<Dispatch>b__0()
 at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint(Object errorSource, Action call)
--- End of stack trace from previous location where exception was thrown ---
 at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)</description>
</entry>
- Try using the cursors to select an item from the completion list. First, it shows two separate completion lists next to each other. Then, when you press enter, it ignores the item you chose, and uses the first one that was previously highlighted! Example where I try to pick
onblurbut it completes asonabort:

Note: This is all using VS 29004.115.d16.2 (i.e., int.d16.2 channel)
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
Add and compile attributes to angularjs directive
I've tried a bunch of different things: adding the attribute in link: , in compile: and even using $compile($element[0]['my-dir'])($scope) after ...
Read more >Attribute Directives - ts - GUIDE
An Attribute directive changes the appearance or behavior of a DOM element. ... for Angular and using it could cause bugs that are...
Read more >Attributes Directives - Angular
Attributes directives – This type of directive changes the appearance or behavior of an element, component, or another directive.
Read more >Attribute directives - Angular
An Attribute directive changes the appearance or behavior of a DOM element. Try the Attribute Directive example / descargar ejemplo .
Read more >Translate attributes with translate directive · Issue #568
Actually, the only way to translate elements attributes is through the translate filter. Is there a particular reason to not having a ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@mkArtakMSFT this doesn’t meet the bar for preview7. Heck this could come in post-3.0 😄
I’m closing this now, given the scenario to be fixed is a corner case one.