EnvDTE.CodeElement wrong start line for duplicated "using" statement - by Carlos J. Quintero

Status : 

 


1
0
Sign in
to vote
ID 765375 Comments
Status Active Workarounds
Type Bug Repros 0
Opened 9/29/2012 9:28:45 AM
Access Restriction Public

Description

When a C# code file contains a duplicated "using" statement (which causes a warning but it is legal), the EnvDTE.CodeElement of the second statement returns the StartLine of the first one.
Sign in to post a comment.
Posted by Microsoft on 12/20/2012 at 9:30 AM
Hi Carlos,

Nice to hear from you! Unfortunately, the C# code model simply looks up elements in the file by name + signature (with an additional special case for partial classes), so only the first element will be found. This should also be the case for any element with a duplicate name + signature in the same file (other than partial classes). Addressing this would require reworking Code Model quite a bit and it seems to really be an edge case.

Kind Regards,
Dustin Campbell
Visual Studio Managed Languages
Posted by Microsoft on 9/30/2012 at 11:06 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Microsoft on 9/30/2012 at 6:23 PM
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)