Home Dashboard Directory Help
Search

Reference Highlighting, Rename, and Find All References fail in VS 2012 VB with Addhandler by LMKz


Status: 

Closed
 as Fixed Help for as Fixed


2
0
Sign in
to vote
Type: Bug
ID: 771987
Opened: 11/22/2012 11:40:42 AM
Access Restriction: Public
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description



In some situations (seems to be when using some internal framework types such as Geolocator), symbols referenced from AddHandler are not included in Reference Highlighting (and similarly are not included if you use the Rename... context menu option). Hence using Rename leaves your code riddled with errors.

See here for actual screenshot : http://imgur.com/ZqI8i

Observe Reference Highlighting (orange) is not applied to variable "locfinder" when used with AddHandler.

Works OK with c#.
Details
Sign in to post a comment.
Posted by Microsoft on 7/11/2013 at 11:50 AM
Hi,

Just to close the loop, we have applied a fix that corrects the lambda scenario. Thanks very much for your persistence!

Kind Regards,
Dustin Campbell
Visual Studio Managed Languages
Posted by Microsoft on 7/3/2013 at 12:13 PM
Thanks a lot LMKz for your help! I can reproduced the issue now. We will investigate the issue further.

Jeremy Meng
Visual Studio Managed Languages
Posted by LMKz on 7/2/2013 at 11:40 PM
... Even your own example clearly shows the bug. Syntax highlighting/Find all references doesn't work on Debug or Writeline in Debug.Writeline("hello").

Can't wait to see this finally fixed.
Posted by LMKz on 7/2/2013 at 5:53 PM
Hi, any variable referenced inside the anon functions will be excluded from find ref etc, as in:

Sub Method()
        Me.locFinder = New Geolocator()

        locFinder.DesiredAccuracy = PositionAccuracy.High
        locFinder.ReportInterval = 1000
        locFinder.MovementThreshold = 1000
        dim foo = "hello"
        AddHandler Me.locFinder.PositionChanged, Sub(sender, e)
                                                     Debug.WriteLine(foo)
                                                 End Sub

        AddHandler Me.locFinder.StatusChanged, Sub(sender, e)
                                                 Debug.WriteLine("hello")
                                             End Sub
    End Sub

I can't test this at the moment as I'm at work, but this was the type of scenario that failed. If that doesn't work comment back and I will post repro when at home cheers.
Posted by Microsoft on 7/2/2013 at 5:09 PM
Hi LMKz,

Thanks a lot for reporting back. The fix to this issue is not included in Visual Studio 2012 update 3, but is already included in Visual Studio 2013 Preview. We tried to but couldn't reproduce the issue internally on the released Visual Studio 2013 Preview build. Would it be possible that you provide us a minimal sample project that demonstrates this issue?

By the way, here's the scenario we tried:
On Windows 8.1 preview (Visual Studio 2013 only supports Windows Store App project for Windows 8.1.)
1. Create a VB Windows Store Blank App project.
2. Open MainPage.xaml.vb
3. Paste the following code in the body of Class MainPage

    Private locFinder As Geolocator
    Sub Method()
        Me.locFinder = New Geolocator()

        locFinder.DesiredAccuracy = PositionAccuracy.High
        locFinder.ReportInterval = 1000
        locFinder.MovementThreshold = 1000

        AddHandler Me.locFinder.PositionChanged, Sub(sender, e)

                                                 End Sub

        AddHandler Me.locFinder.StatusChanged, Sub(sender, e)
                                                 Debug.WriteLine("hello")
                                             End Sub
    End Sub
4. Try Rename Refactoring/Highlighting References/Find All References on "locFinder"

All work fine. We might have missed certain steps so the issue doesn't reproduce.

Thanks!
Jeremy Meng
Managed Languages team, Visual Studio, Microsoft
Posted by LMKz on 7/1/2013 at 2:34 PM
This is still broken in VS2012.3 AND in Visual Studio 2013 preview!
Posted by LMKz on 4/23/2013 at 2:23 PM
Bah humbug... this just screwed me over again, trying to do "Find all references" on a property, nothing found :(


Don't want to sound like a broken record, but it would be better to stop putting new features into VS and focus on the bugs! Dreams are free...
Posted by Microsoft on 4/22/2013 at 9:36 AM
Hi,

Unfortunately, we aren't able to fix this issue in a Visual Studio update. This simply does not meet the bar. However, we *greatly* appreciate you reporting this problem and we have fixed it, but with Update 2 already we aren't able to get it into an update.

Kind Regards,
Dustin Campbell
Visual Studio Managed Languages
Posted by LMKz on 4/4/2013 at 12:26 PM
Hi, I've re-opened this issue, as I've been working on a larger Windows Store app and finding this bug REALLY frustrating as it means you can't rely on reference highlighting or rename.

Hoping you will reconsider fixing this before vNext, as we are mandated to use VB.Net at work so can't just switch to c# to avoid this.

When I look at some of the obscure bugs that have been fixed in Update 2 I think this surely makes the bar.

Thanks
Posted by Microsoft on 2/25/2013 at 7:18 AM
Hi,

I definitely appreciate your passion about this particular issue. However, the bar for getting fixes into an update before the next VS release is very high. While this bug is certainly serious, it's impact isn't as widespread or severe enough to be fixed in an update prior to the next release. Note that we *have* fixed VB bugs in recent VS updates, but those have generally been crashing problems encountered by many users.

Please continue to report issues! Your feedback is critical for us to make the product as good as we can.

Kind Regards,
Dustin Campbell
Visual Studio Managed Languages
Posted by LMKz on 2/24/2013 at 11:43 AM
Just want to lodge my opinion that this fix should be in an update rather than vNext, as it is a major bug that severely hinders refactoring in VB.

But obviously I am the only person coding in VB as no one else has even noticed this major howler (including MS themselves).
Posted by Microsoft on 2/12/2013 at 8:04 AM
Hi,

Thanks for contacting us about this issue. We have corrected the problem and you should see the fix in the next release of Visual Studio.

Kind Regards,
Dustin Campbell
Visual Studio Managed Languages
Posted by Microsoft on 11/22/2012 at 11:31 PM
Thank you for submitting feedback on Visual Studio and .NET Framework. Your issue has been routed to the appropriate VS development team for investigation. We will contact you if we require any additional information.
Posted by Microsoft on 11/22/2012 at 11:51 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.