Skip to content

Fix Code Model bug reported by @carlos-j-quintero - #488

Merged
DustinCampbell merged 15 commits into
dotnet:masterfrom
DustinCampbell:codemodelfixes
Feb 13, 2015
Merged

DustinCampbell merged 15 commits into
dotnet:masterfrom
DustinCampbell:codemodelfixes

Conversation

@DustinCampbell

Copy link
Copy Markdown
Member

Issue #143: VB Code Model should not throw COMExceptions for property or event accessors
Issue #146: Rework how VB parameter names are handled by Code Model. The parameter name should be the identifier name and not include a type character, ? or ().
Issue #147: C# Code Model should not throw when FunctionKind is accessed for an explicitly-implemented interface method.
Issue #148: VB Code Model should include Declare Subs and Functions.
Issue #149: VB Code Model should return vsCMFunctionDestructor when FunctionKind is accessed for an Overrides Finalize() method.
Issue #150: VB Code Model should return the appropriate EnvDTE80.vsCMFunction2 values for event AddHandler, RemoveHandler and RaiseEvent accessors.
Issue #151: VB CodeModel events (both simple and custom), auto-properties, and delegates should populate the Attributes property.

VB CodeModel now returns proper EnvDTE80.vsCMFunction2 values for
AddHandler, RemoveHandler and RaiseEvent accessors.
VB CodeModel now returns vsCMFunctionDestructor for Overrides Finalize()
members
C# CodeModel FunctionKind should not throw on an explicit interface
implementation of a method.
It turns out that there was a fundamental problem with how parameter
names were handled in VB Code Model. Essentially, the CodeParameter
object was created with the modified identifier of the name. So, it
included the ? or () if they were declared and the type character if it
was declared. This made a bit of a mess when it came time to look of the
underlying node. This should fix several problems (not all reported), so
I went ahead and added several unit tests.
VB code model should include Declare Sub and Function
This should return vsCMFunctionSub for Subs and vsCMFunctionFunction for
Functions
VB CodeModel GetStartPoint and GetEndPoint should not throw for property
or event accessors.
VB CodeModel events (both simple and custom), auto-properties, and
delegates should populate the Attributes property.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's an oddly cased method name. What is the translation for that?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah okay, it's a mapping of COM error codes.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. This is all fun COM stuff. 😄

@DustinCampbell DustinCampbell added this to the 1.0-rc2 milestone Feb 13, 2015
@jaredpar

Copy link
Copy Markdown
Member

LGTM

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: we probably don't need the this. anymore given we're doing _ qualification.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. That's just muscle memory on my part.

@jasonmalinowski

Copy link
Copy Markdown
Member

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants