Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

CommentInfo Structure

Provides the characters that define comments for a language service.

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   Microsoft.VisualStudio.Package.LanguageService.14.0 (in Microsoft.VisualStudio.Package.LanguageService.14.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.12.0 (in Microsoft.VisualStudio.Package.LanguageService.12.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)

public struct CommentInfo

The CommentInfo type exposes the following members.

  NameDescription
Public propertyBlockEndSpecifies the string of characters that define the end of a block comment.
Public propertyBlockStartSpecifies the string of characters that define the start of a block comment.
Public propertyLineStartSpecifies the string of characters that define the start of a line comment.
Public propertyUseLineCommentsSpecifies whether line comments are supported.
Top

  NameDescription
Public methodEqualsIndicates whether this instance and a specified object are equal. (Inherited from ValueType.)
Public methodGetHashCodeReturns the hash code for this instance. (Inherited from ValueType.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodToStringReturns the fully qualified type name of this instance. (Inherited from ValueType.)
Top

Comments are lines or blocks of code that a compiler or interpreter ignores. There are two types of comments supported in the managed package framework language service classes:

  1. Block Comments:

    These are comments with beginning and ending delimiters and can part of a line or multiple lines. For example, in C#, block comments start with /* and end with */.

  2. Line Comments:

    These are comments that have a beginning delimiter and go to the end of the line. For example, in C#, line comments start with //. In Visual Basic, a line comment starts with '.

Notes to Implementers

If your language defines comments other than with the characters used by C#, you must derive a class from the Source class, override the GetCommentFormat method to instantiate a CommentInfo class and fill it in with the comment characters for your language.

Notes to Callers

An instance of the CommentInfo class is created and returned from the GetCommentFormat method on the Source class. The base class instance of CommentInfo is filled in with C#/C++-style comment characters.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2015 Microsoft