Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Modern completion API

Amadeusz Wieczorek edited this page May 4, 2018 · 5 revisions

Contents #

Microsoft.VisualStudio.Language # =

CodeElementKinds # =

Namespace

Microsoft.VisualStudio.Language.Intellisense

Summary

Represents the kind of code elements in a document.

Class constants # =

Summary

Kind is a class.

Constructor constants # =

Summary

Kind is a constructor.

Container constants # =

Summary

Kind is a type container.

Remarks

A type container can be any of File, Module, Package, or Namespace. Code should use one of the concrete values if needed.

Enum constants # =

Summary

Kind is an enum.

Event constants # =

Summary

Kind is an event.

Field constants # =

Summary

Kind is a field.

File constants # =

Summary

Kind is a file.

Function constants # =

Summary

Kind is a function.

Interface constants # =

Summary

Kind is an interface.

Invalid constants # =

Summary

Invalid kind.

Member constants # =

Summary

Kind is a type member.

Remarks

A Member kind can be any of MethodPropertyEventFieldConstructorFunction

Method constants # =

Summary

Kind is a method.

Module constants # =

Summary

Kind is a module.

Namespace constants # =

Summary

Kind is a namespace.

Package constants # =

Summary

Kind is a package.

Property constants # =

Summary

Kind is a property.

Struct constants # =

Summary

Kind is a struct.

Type constants # =

Summary

Kind is a type (Class, Interface, Struct, or Enum).

Unspecified constants # =

Summary

Unspecified kind.

CodeLensDataPointDescriptor # =

Namespace

Microsoft.VisualStudio.Language.CodeLens.Remoting

Summary

Represents a descriptor for a CodeLens data point.

Remarks

This type is used for the object representing a data point returned from the remote data point provider.

Data property # =

Summary

Additional data of the data point. Reserved for customization.

Description property # =

Summary

The description text that displays in the UI indicator of the data point.

ImageId property # =

Summary

The image content of the data point.

IntValue property # =

Summary

The integer content of the data point.

ProviderUniqueId property # =

Summary

The data point provider's unique identifier.

TooltipText property # =

Summary

The tooltip text for the UI indicator of the data point.

CodeLensDataPointProviderDescriptor # =

Namespace

Microsoft.VisualStudio.Language.CodeLens.Remoting

Summary

Represents a data model describing IAsyncCodeLensDataPointProviders.

Remarks

When requested, the remote CodeLens service returns an object of CodeLensDataPointProviderDescriptor for each provider it hosts.

ContentTypes property # =

Summary

List of supported content types.

DetailsTemplateName property # =

Summary

What template to use for presenting the detail in the detail popup. Defaults to use a GridView to present detail data.

LocalizedName property # =

Summary

The localized name of the data point provider.

OptionUserModifiable property # =

Summary

Determines if the provider can be modified in the tool's option setting.

OptionUserVisible property # =

Summary

Determines if the provider is visible in the tool's option setting.

Priority property # =

Summary

An Int32 value indicating the order of the indicator. Lower value indicators will come first in the default ordering in indicator adornments in editor.

ProviderUniqueId property # =

Summary

The uniquely-identifying name of the data point provider.

CodeLensDescriptor # =

Namespace

Microsoft.VisualStudio.Language.CodeLens.Remoting

Summary

Represents a data model describing the code element in a document on which CodeLens data point indicators would be requested.

ApplicableToSpan property # =

Summary

A Span identifying the place of the code element with which a data point is associated.

ElementDescription property # =

Summary

A text description for the code element with which a data point is associated.

Remarks

Language services use this property to pass the text of the code element to data points.

FilePath property # =

Summary

Full path to the document on which data points are requested.

Kind property # =

Summary

The CodeElementKinds of the code element with which a data point is associated.

ProjectGuid property # =

Summary

A Guid identifying the project to which the document belongs.

CodeLensDetailEntryCommand # =

Namespace

Microsoft.VisualStudio.Language.CodeLens.Remoting

Summary

Represents a navigation command invokable from the details pane.

Remarks

A command can only have either the CommandName or the pair of CommandSet and CommandId, depending on the platform on which the code runs:

CommandId property # =

Summary

The command Id.

CommandName property # =

Summary

The command name.

CommandSet property # =

Summary

The command group Guid.

CodeLensDetailEntryDescriptor # =

Namespace

Microsoft.VisualStudio.Language.CodeLens.Remoting

Summary

Defines a row entry in CodeLensDetailsDescriptor.

EntryData property # =

Summary

Additional data asociated with the entry. Reserved for customization.

Fields property # =

Summary

A list of field values in the entry.

Remarks

The order of Fields in an entry must be the same as the order of Headers in the CodeLensDetailsDescriptor.

NavigationCommand property # =

Summary

Navigation command associated with the entry.

NavigationCommandArgs property # =

Summary

Arguments for the navigation command.

Tooltip property # =

Summary

Tooltip for the entry.

CodeLensDetailEntryField # =

Namespace

Microsoft.VisualStudio.Language.CodeLens.Remoting

Summary

Defines a field of a CodeLensDetailEntryDescriptor.

FieldData property # =

Summary

Additional data associated with this field. Reserved for customization.

ImageId property # =

Summary

The image content of the field.

Text property # =

Summary

The text string content of the field.

CodeLensDetailHeaderDescriptor # =

Namespace

Microsoft.VisualStudio.Language.CodeLens.Remoting

Summary

Defines a header object for CodeLensDetailsDescriptor.

DisplayName property # =

Summary

The localized name of the header when displayed.

IsVisible property # =

Summary

Indicates whether this column should display in the grid view.

Tag property # =

Summary

Stores custom information that can be used to customize the column.

UniqueName property # =

Summary

The header's unique name.

Width property # =

Summary

The desired width of this header when displayed in the detail popup.

Remarks

If Width <= 1.0, this value is used as a multifier for the percentage of remaining width in the grid view, excluding all fixed width columns, should be allocated to this column. A value of 1.0 means 100% of remaining width is allocated to this column.

CodeLensDetailPaneCommand # =

Namespace

Microsoft.VisualStudio.Language.CodeLens.Remoting

Summary

Represents a navigation command in the detail pane.

CommandArgs property # =

Summary

The command arguments.

CommandDisplayName property # =

Summary

The command text displayed in the pane.

CommandId property # =

Summary

The navigation command.

CodeLensDetailsDescriptor # =

Namespace

Microsoft.VisualStudio.Language.CodeLens.Remoting

Summary

Represents a descriptor for the detail of a data point.

Remarks

When GetDetailsAsync is called, the data point returns a CodeLensDetailsDescriptor object providing the data point details that will be presented in the details popup.

DetailsData property # =

Summary

Custom details data.

Entries property # =

Summary

Defines rows (entries) of the detail list.

Headers property # =

Summary

Defines the headers of the detail list.

PaneNavigationCommands property # =

Summary

Defines the additional navigation commands in the details pane

CodeLensServiceProtocolNames # =

Namespace

Microsoft.VisualStudio.Language.CodeLens.Remoting

Summary

Defines the names of the protocols for CodeLens ServiceHub service.

CanCreateDataPoint constants # =

Summary

Protocol for querying a CodeLens provider if it supports to create a data point.

Remarks

CodeLensServiceName constants # =

Summary

The name of the default SeviceHub service.

GetCodeLensData constants # =

Summary

Protocol for retrieving data from a CodeLens data point.

Remarks

Protocol params and return: params: CodeLensDescriptor and the provider name. return: CodeLensDataPointDescriptor

GetCodeLensDetail constants # =

Summary

Protocol for retrieving details of a CodeLens data point.

Remarks

Protocol params and return: params: CodeLensDescriptor and the provider name. return: CodeLensDetailsDescriptor

GetCodeLensProviders constants # =

Summary

Protocol for getting CodeLens providers hosted by the service.

Remarks

Protocol params and return: params: none return: CodeLensDataPointProviderDescriptor

NotifyInvalidation constants # =

Summary

A protocol that the service can use to notify the CodeLens infrastructure that the remote CodeLens data in the data point source has been invalidated.

Remarks

Protocol params and return: params: CodeLensDescriptor and the provider name return: none.

CommitBehavior # =

Namespace

Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion

Summary

Instructs the editor how to behave after invoking the custom commit method.

None constants # =

Summary

Use the default behavior

RaiseFurtherCommandHandlers constants # =

Summary

Raises further invocation of the ReturnKey and Tab command handlers. By default, editor doesn't invoke ReturnKey and Tab command handlers after committing completion session.

SuppressFurtherCommandHandlers constants # =

Summary

Surpresses further invocation of the TypeChar command handlers. By default, editor invoke these command handlers to enable features such as brace completion.

CommitResult # =

Namespace

Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion

Summary

Tracks whether the commit occured, and provides instructions for behavior after committing.

#ctor(isHandled,behavior) constructor # =

Summary

Creates a CommitResult with specified properties.

Parameters
Name Type Description
isHandled System.Boolean Whether the commit occured
behavior Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CommitBehavior Desired behavior after committing

Handled constants # =

Summary

Marks this commit as handled. No other IAsyncCompletionCommitManager will be asked to commit.

Unhandled constants # =

Summary

Marks this commit as unhandled. Another IAsyncCompletionCommitManager will be asked to commit.

Behavior property # =

Summary

Desired behavior after committing, respected even when IsHandled is unset.

IsHandled property # =

Summary

Whether the commit occured. If true, no other IAsyncCompletionCommitManager will be asked to commit. If false, another IAsyncCompletionCommitManager will be asked to commit.

CompletionClosedEventArgs # =

Namespace

Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion

Summary

This class is used to notify completion's logic when the UI closes

#ctor(textView) constructor # =

Summary

Constructs instance of CompletionClosedEventArgs.

Parameters
Name Type Description
textView Microsoft.VisualStudio.Text.Editor.ITextView ITextView that hosted this completion UI

TextView property # =

Summary

ITextView that hosted completion UI

CompletionContext # =

Namespace

Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion

Summary

This type is used to transfer data from IAsyncCompletionSource to IAsyncCompletionBroker and further to IAsyncCompletionItemManager

#ctor(items) constructor # =

Summary

Constructs CompletionContext with specified CompletionItems. Completion will use default selection and no suggestion mode, unless overriden by another IAsyncCompletionSource

Parameters
Name Type Description
items System.Collections.Immutable.ImmutableArray{Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionItem} Available completion items

#ctor(items,useSoftSelection,useSuggestionMode,suggestionModeDescription) constructor # =

Summary

Constructs CompletionContext with CompletionItems with specified suggestion mode and soft selection properties.

Parameters
Name Type Description
items System.Collections.Immutable.ImmutableArray{Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionItem} Available completion items
useSoftSelection System.Boolean Whether UI should use soft selection
useSuggestionMode System.Boolean Whether UI should enter suggestion mode
suggestionModeDescription System.String Explains why suggestion mode is active. It is displayed when applicableSpan is empty. Otherwise, UI displays content of applicableSpan. May be null.

#ctor(items,useSoftSelection,suggestionModeOptions) constructor # =

Summary

Construsts CompletionContext with specified CompletionItems. Completion will use specified selection mode, and if SuggestionModeOptions is not null, it will use suggestion mode with specified options.

Parameters
Name Type Description
items System.Collections.Immutable.ImmutableArray{Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionItem} Available completion items
useSoftSelection System.Boolean Whether UI should use soft selection. Default is false. Usually it is true when suggestionModeOptions is set
suggestionModeOptions Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.SuggestionItemOptions Whether there should be completion item

#ctor(items,useSoftSelection,suggestionModeOptions) constructor # =

Summary

Construsts CompletionContext with specified CompletionItems. Completion will use specified selection mode, and if SuggestionModeOptions is not null, it will use suggestion mode with specified options.

Parameters
Name Type Description
items System.Collections.Immutable.ImmutableArray{Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionItem} Available completion items
useSoftSelection Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.InitialSelectionOption Whether UI should use soft selection. Default is false. Usually it is true when suggestionModeOptions is set
suggestionModeOptions Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.SuggestionItemOptions Whether there should be completion item

Default constants # =

Summary

Empty completion context, when IAsyncCompletionSource offers no items pertinent to given location.

Items property # =

Summary

Set of completion items available at a location

SuggestionModeOptions property # =

Summary

When set, uses suggestion mode with options specified in this object. When null, this context does not provide a suggestion mode item.

UseSoftSelection property # =

Summary

When set to true, the completion list will be initially soft-selected. Soft selection means that typing commit characters will not commit the item. The item may be committed only by using TAB or double-clicking. Soft selection is represented by a border around the item, without a background fill. Selecting another item automatically disables soft selection and enables full selection.

CompletionFilter # =

Namespace

Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion

Summary

Identifies a filter that toggles exclusive display of CompletionItems that reference it.

Example

static CompletionFilter MyFilter = new CompletionFilter("My items", "m", MyItemsImageMoniker);

Remarks

These instances should be singletons. All CompletionItems that should be filtered using the same filter button must use the same reference to the instance of CompletionFilter.

#ctor(displayText,accessKey,image) constructor # =

Summary

Constructs an instance of CompletionFilter.

Parameters
Name Type Description
displayText System.String Name of this filter
accessKey System.String Key used in a keyboard shortcut that toggles this filter.
image Microsoft.VisualStudio.Text.Adornments.ImageElement Image that represents this filter

AccessKey property # =

Summary

Key used in a keyboard shortcut that toggles this filter.

DisplayText property # =

Summary

Name of this filter.

Image property # =

Summary

ImageElement that represents this filter.

CompletionFilterChangedEventArgs # =

Namespace

Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion

Summary

This class is used to notify completion's logic of selection change in the filter UI

#ctor(filters) constructor # =

Summary

Constructs instance of CompletionFilterChangedEventArgs.

Parameters
Name Type Description
filters System.Collections.Immutable.ImmutableArray{Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionFilterWithState} Current state of the filters

Filters property # =

Summary

Current state of the filters

CompletionFilterReason # =

Namespace

Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion

Summary

Describes the kind of action that triggered completion to filter.

Deletion constants # =

Summary

Completion was triggered via an action deleting a character from the document.

FilterChange constants # =

Summary

Update was triggered by changing filters

Initial constants # =

Summary

Completion was triggered by a direct invocation of the completion feature using the Edit.ListMember command.

Insertion constants # =

Summary

Completion was triggered via an action inserting a character into the document.

CompletionFilterWithState # =

Namespace

Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion

Summary

Immutable data transfer object used to communicate between the completion session and completion UI

#ctor(filter,isAvailable) constructor # =

Summary

Constructs a new instance of CompletionFilterWithState.

Parameters
Name Type Description
filter Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionFilter Reference to CompletionFilter
isAvailable System.Boolean Whether this CompletionFilter is available

#ctor(filter,isAvailable,isSelected) constructor # =

Summary

Constructs a new instance of CompletionFilterWithState when selected state is known.

Parameters
Name Type Description
filter Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionFilter Reference to CompletionFilter
isAvailable System.Boolean Whether this CompletionFilter is available
isSelected System.Boolean Whether this CompletionFilter is selected

Filter property # =

Summary

Reference to the completion filter

IsAvailable property # =

Summary

Whether the filter is available. Filter should be available when there are visible CompletionItems that define this Filter in their Filters

IsSelected property # =

Summary

Whether the filter is selected by the user.

ToString() method # =

Summary

Override for nice debugger display

Parameters

This method has no parameters.

WithAvailability(isAvailable) method # =

Summary

Returns instance of CompletionFilterWithState with specified IsAvailable

Returns

Updated instance of CompletionFilterWithState

Parameters
Name Type Description
isAvailable System.Boolean Value to use for IsAvailable

WithSelected(availability) method # =

Summary

Returns instance of CompletionFilterWithState with specified IsSelected

Returns

Updated instance of CompletionFilterWithState

Parameters
Name Type Description
availability System.Boolean Value to use for IsSelected

CompletionItem # =

Namespace

Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion

Summary

This class, returned from IAsyncCompletionSource, represents a single entry to be displayed in the completion UI. This class implements IPropertyOwner

#ctor(displayText,source,icon,suffix) constructor # =

Summary

Creates a completion item whose DisplayText, InsertText, SortText and FilterText are all the same, there is an image, and there are no filter, suffix nor attribute images associated with this item.

Parameters
Name Type Description
displayText System.String Text to use in the UI, when sorting, filtering and completing
source Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.IAsyncCompletionSource Reference to IAsyncCompletionSource that created this item
icon Microsoft.VisualStudio.Core.Imaging.AccessibleImageId Image displayed in the UI

#ctor(displayText,source,icon,filters) constructor # =

Summary

Creates a completion item whose DisplayText, InsertText, SortText and FilterText are all the same, there is an image, filters, and there are no suffix nor attribute images associated with this item.

Parameters
Name Type Description
displayText System.String Text to use in the UI, when sorting, filtering and completing
source Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.IAsyncCompletionSource Reference to IAsyncCompletionSource that created this item
icon Microsoft.VisualStudio.Core.Imaging.AccessibleImageId Image displayed in the UI
filters System.Collections.Immutable.ImmutableArray{Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionFilter} ImmutableArray of references to CompletionFilters applicable to this item

#ctor(displayText,source,icon,filters,suffix) constructor # =

Summary

Creates a completion item whose DisplayText, InsertText, SortText and FilterText are all the same, there is an image, filters, suffix, and there are no attribute images associated with this item.

Parameters
Name Type Description
displayText System.String Text to use in the UI, when sorting, filtering and completing
source Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.IAsyncCompletionSource Reference to IAsyncCompletionSource that created this item
icon Microsoft.VisualStudio.Core.Imaging.AccessibleImageId Image displayed in the UI
filters System.Collections.Immutable.ImmutableArray{Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionFilter} ImmutableArray of references to CompletionFilters applicable to this item
suffix System.String Additional text to display in the UI

#ctor(displayText,source,icon,filters,suffix,insertText,sortText,filterText,attributeIcons) constructor # =

Summary

Creates a completion item, allowing customization of all of its properties.

Parameters
Name Type Description
displayText System.String Text used in the UI
source Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.IAsyncCompletionSource Reference to IAsyncCompletionSource that created this item
icon Microsoft.VisualStudio.Core.Imaging.AccessibleImageId Image displayed in the UI
filters System.Collections.Immutable.ImmutableArray{Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionFilter} ImmutableArray of references to CompletionFilters applicable to this item
suffix System.String Additional text to display in the UI
insertText System.String Text inserted when completing this item
sortText System.String Text used by IAsyncCompletionItemManager when sorting against other items
filterText System.String Text used by IAsyncCompletionItemManager when matching against the applicable span
attributeIcons System.Collections.Immutable.ImmutableArray{Microsoft.VisualStudio.Core.Imaging.AccessibleImageId} Additional images to display in the UI

#ctor(displayText,source) constructor # =

Summary

Creates a completion item whose DisplayText, InsertText, SortText and FilterText are all the same, and there are no icon, filter, suffix nor attribute icons associated with this item.

Parameters
Name Type Description
displayText System.String Text to use in the UI, when sorting, filtering and completing
source Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.IAsyncCompletionSource Reference to IAsyncCompletionSource that created this item

#ctor(displayText,source,icon,suffix) constructor # =

Summary

Creates a completion item whose DisplayText, InsertText, SortText and FilterText are all the same, there is an image, and there are no filter, suffix nor attribute images associated with this item.

Parameters
Name Type Description
displayText System.String Text to use in the UI, when sorting, filtering and completing
source Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.IAsyncCompletionSource Reference to IAsyncCompletionSource that created this item
icon Microsoft.VisualStudio.Text.Adornments.ImageElement Image displayed in the UI

#ctor(displayText,source,icon,filters) constructor # =

Summary

Creates a completion item whose DisplayText, InsertText, SortText and FilterText are all the same, there is an image, filters, and there are no suffix nor attribute images associated with this item.

Parameters
Name Type Description
displayText System.String Text to use in the UI, when sorting, filtering and completing
source Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.IAsyncCompletionSource Reference to IAsyncCompletionSource that created this item
icon Microsoft.VisualStudio.Text.Adornments.ImageElement Image displayed in the UI
filters System.Collections.Immutable.ImmutableArray{Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionFilter} ImmutableArray of references to CompletionFilters applicable to this item

#ctor(displayText,source,icon,filters,suffix) constructor # =

Summary

Creates a completion item whose DisplayText, InsertText, SortText and FilterText are all the same, there is an image, filters, suffix, and there are no attribute images associated with this item.

Parameters
Name Type Description
displayText System.String Text to use in the UI, when sorting, filtering and completing
source Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.IAsyncCompletionSource Reference to IAsyncCompletionSource that created this item
icon Microsoft.VisualStudio.Text.Adornments.ImageElement Image displayed in the UI
filters System.Collections.Immutable.ImmutableArray{Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionFilter} ImmutableArray of references to CompletionFilters applicable to this item
suffix System.String Additional text to display in the UI

#ctor(displayText,source,icon,filters,suffix,insertText,sortText,filterText,attributeIcons) constructor # =

Summary

Creates a completion item, allowing customization of all of its properties.

Parameters
Name Type Description
displayText System.String Text used in the UI
source Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.IAsyncCompletionSource Reference to IAsyncCompletionSource that created this item
icon Microsoft.VisualStudio.Text.Adornments.ImageElement Image displayed in the UI
filters System.Collections.Immutable.ImmutableArray{Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionFilter} ImmutableArray of references to CompletionFilters applicable to this item
suffix System.String Additional text to display in the UI
insertText System.String Text inserted when completing this item
sortText System.String Text used by IAsyncCompletionItemManager when sorting against other items
filterText System.String Text used by IAsyncCompletionItemManager when matching against the applicable span
attributeIcons System.Collections.Immutable.ImmutableArray{Microsoft.VisualStudio.Text.Adornments.ImageElement} Additional images to display in the UI

AttributeIcons property # =

Summary

Additional images to display in the UI. Usually, these images are displayed on the far right side of the UI.

DisplayText property # =

Summary

Text used in the UI

Filters property # =

Summary

ImmutableArray of references to CompletionFilters applicable to this item

FilterText property # =

Summary

Text used by IAsyncCompletionItemManager when matching against the applicable span

Icon property # =

Summary

Image displayed in the UI

InsertText property # =

Summary

Text inserted when completing this item

Properties property # =

Summary

The collection of properties controlled by the property owner. See Properties

SortText property # =

Summary

Text used by IAsyncCompletionItemManager when sorting against other items

Source property # =

Summary

Reference to the instance that will provide tooltip and custom commit method. Usually it is the same instance as the one that created this CompletionItem

Suffix property # =

Summary

Additional text to display in the UI, after DisplayText. This text has less emphasis than DisplayText and is usually right-aligned.

CompletionItemEventArgs # =

Namespace

Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion

Summary

This class is used to notify of an operation that affects a single CompletionItem.

#ctor() constructor # =

Summary

Constructs instance of CompletionItemEventArgs.

Parameters

This constructor has no parameters.

Item property # =

Summary

Relevant item

CompletionItemSelectedEventArgs # =

Namespace

Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion

Summary

This class is used to notify completion's logic of selecting through the UI

#ctor(selectedItem,suggestionModeSelected) constructor # =

Summary

Constructs instance of CompletionItemSelectedEventArgs.

Parameters
Name Type Description
selectedItem Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionItem User-selected item
suggestionModeSelected System.Boolean Whether the selected item is a suggestion mode item

SelectedItem property # =

Summary

Selected item. Might be null if there is no selection

SuggestionModeSelected property # =

Summary

Whether selected item is a suggestion mode item

CompletionItemSelection # =

Namespace

Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion

NoChange constants # =

Summary

Don't change the current selection mode.

Selected constants # =

Summary

Set selection mode to regular selection: item is committed using Tab, mouse, enter and commit characters.

SoftSelected constants # =

Summary

Set selection mode to soft selection: item is committed only using Tab or mouse.

CompletionItemsWithHighlightEventArgs # =

Namespace

Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion

Summary

This class is used to notify of an operation that affects multiple CompletionItemWithHighlights.

#ctor() constructor # =

Summary

Constructs instance of CompletionItemEventArgs.

Parameters

This constructor has no parameters.

Items property # =

Summary

Relevant items

CompletionItemWithHighlight # =

Namespace

Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion

Summary

Wraps CompletionItem with information about highlighted parts of its DisplayText.

#ctor(completionItem) constructor # =

Summary

Constructs CompletionItemWithHighlight without any highlighting. Used when the CompletionItem appears in the completion list without being a text match.

Parameters
Name Type Description
completionItem Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionItem Instance of the CompletionItem

#ctor(completionItem,highlightedSpans) constructor # =

Summary

Constructs CompletionItemWithHighlight with given highlighting. Used when text used to filter the completion list can be found in the DisplayText.

Parameters
Name Type Description
completionItem Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionItem Instance of the CompletionItem
highlightedSpans System.Collections.Immutable.ImmutableArray{Microsoft.VisualStudio.Text.Span} Spans of DisplayText to highlight

CompletionItem property # =

Summary

The completion item

HighlightedSpans property # =

Summary

Which parts of DisplayText to highlight

CompletionPresentationViewModel # =

Namespace

Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion

Summary

This class contains completion items, filters and other pieces of information used by ICompletionPresenter to render the completion UI.

#ctor(items,filters,applicableSpan,useSoftSelection,useSuggestionMode,selectSuggestionMode,selectedItemIndex,suggestionModeItem) constructor # =

Summary

Constructs CompletionPresentationViewModel

Parameters
Name Type Description
items System.Collections.Immutable.ImmutableArray{Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionItemWithHighlight} Completion items to display with their highlighted spans
filters System.Collections.Immutable.ImmutableArray{Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionFilterWithState} Completion filters with their available and selected state
applicableSpan Microsoft.VisualStudio.Text.ITrackingSpan Span pertinent to the completion session
useSoftSelection System.Boolean Controls whether selected item should be soft selected
useSuggestionMode System.Boolean Controls whether suggestion mode item is visible
selectSuggestionMode System.Boolean Controls whether suggestion mode item is selected
selectedItemIndex System.Int32 Controls which item is selected. Use -1 in suggestion mode
suggestionModeItem Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionItem Suggestion mode item to display

ApplicableSpan property # =

Summary

Span pertinent to the completion session.

Filters property # =

Summary

Completion filters with their available and selected state.

Items property # =

Summary

Completion items to display with their highlighted spans.

SelectedItemIndex property # =

Summary

Controls which item is selected. Use -1 in suggestion mode.

SelectSuggestionMode property # =

Summary

Controls whether suggestion mode item is selected.

SuggestionItemOptions property # =

Summary

How to display the suggestion mode completion.

SuggestionModeItem property # =

Summary

Suggestion mode item to display.

UseSoftSelection property # =

Summary

Controls whether selected item should be soft selected.

UseSuggestionMode property # =

Summary

Controls whether suggestion mode item is visible.

CompletionTrigger # =

Namespace

Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion

Summary

What triggered the completion, but not where it happened. The reason we don't expose location is that for each extension, we map the point to a buffer with matching content type.

#ctor(reason,character) constructor # =

Summary

Creates a CompletionTrigger associated with a text edit

Parameters
Name Type Description
reason Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionTriggerReason The kind of action that triggered completion to start
character System.Char Character that triggered completion

#ctor(reason) constructor # =

Summary

Creates a CompletionTrigger not associated with a text edit

Parameters
Name Type Description
reason Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionTriggerReason The kind of action that triggered completion to start

Character property # =

Summary

The text edit associated with the triggering action.

Reason property # =

Summary

The reason that completion was started.

CompletionTriggeredEventArgs # =

Namespace

Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion

Summary

This class is used to notify about new IAsyncCompletionSession being triggered

#ctor(completionSession,textView) constructor # =

Summary

Constructs instance of CompletionItemSelectedEventArgs.

Parameters
Name Type Description
completionSession Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.IAsyncCompletionSession Newly created IAsyncCompletionSession
textView Microsoft.VisualStudio.Text.Editor.ITextView ITextView where completion was triggered

CompletionSession property # =

Summary

Newly created IAsyncCompletionSession.

TextView property # =

Summary

ITextView where completion was triggered.

CompletionTriggerReason # =

Namespace

Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion

Summary

Describes the kind of action that initially triggered completion to open.

Deletion constants # =

Summary

Completion was triggered via an action deleting a character from the document.

Insertion constants # =

Summary

Completion was triggered via an action inserting a character into the document.

Invoke constants # =

Summary

Completion was triggered by a direct invocation of the completion feature using the Edit.ListMember command.

InvokeAndCommitIfUnique constants # =

Summary

Completion was triggered with a request to commit if a single item would be selected using the Edit.CompleteWord command.

Snippets constants # =

Summary

Completion was triggered for snippets only.

DetailsTemplateNameAttribute # =

Namespace

Microsoft.VisualStudio.Language.CodeLens.Remoting

Summary

A MEF attribute specifying a template for presenting details of data points from a IAsyncCodeLensDataPointProvider.

#ctor() constructor # =

Summary

Initializes a new instance of DetailsTemplateNameAttribute.

Parameters

This constructor has no parameters.

DetailsTemplateName property # =

Summary

The name of the template for presenting the data point's details.

FilteredCompletionModel # =

Namespace

Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion

Summary

This class, returned from IAsyncCompletionItemManager, contains completion items to display in the UI, recommended item to display, selection mode and available filters.

#ctor(items,selectedItemIndex) constructor # =

Summary

Constructs FilteredCompletionModel without completion filters.

Parameters
Name Type Description
items System.Collections.Immutable.ImmutableArray{Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionItemWithHighlight} Items to display in the completion UI.
selectedItemIndex System.Int32 Recommended item index to select.

#ctor(items,selectedItemIndex,filters) constructor # =

Summary

Constructs FilteredCompletionModel with completion filters.

Parameters
Name Type Description
items System.Collections.Immutable.ImmutableArray{Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionItemWithHighlight} Items to display in the completion UI.
selectedItemIndex System.Int32 Recommended item index to select.
filters System.Collections.Immutable.ImmutableArray{Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionFilterWithState} Completion filters with their availability and selection state.

#ctor(items,selectedItemIndex,filters,selectionMode,uniqueItem) constructor # =

Summary

Constructs FilteredCompletionModel with completion filters, indication regarding selection mode and the unique item

Parameters
Name Type Description
items System.Collections.Immutable.ImmutableArray{Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionItemWithHighlight} Items to display in the completion UI.
selectedItemIndex System.Int32 Recommended item index to select.
filters System.Collections.Immutable.ImmutableArray{Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionFilterWithState} Completion filters with their availability and selection state.
selectionMode Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionItemSelection Allows IAsyncCompletionItemManager to influence the selection mode.
uniqueItem System.Boolean Provides CompletionItem to commit using "commit if unique" command despite displaying more than one item.

CenterSelection property # =

Summary

Whether selected item should be displayed in the center of the list. Usually, this is true

Filters property # =

Summary

Completion filters with their availability and selection state.

Items property # =

Summary

Items to display in the completion UI.

SelectedItemIndex property # =

Summary

Recommended item index to select. Presence of a suggestion mode item may override

SelectionMode property # =

Summary

Controls the selection mode of the selected item.

UniqueItem property # =

Summary

Optionally, provides an item that should be committed using the "commit if unique" command.

IAsyncCodeLensDataPoint # =

Namespace

Microsoft.VisualStudio.Language.CodeLens.Remoting

Summary

Represents an async CodeLens data point.

Descriptor property # =

Summary

The CodeLensDescriptor object that uniquely identifies the data point.

GetDataAsync() method # =

Summary

Gets lens data from the data point.

Returns

A CodeLensDataPointDescriptor object representing the lens data from the data point.

Parameters

This method has no parameters.

GetDetailsAsync() method # =

Summary

Gets lens details from the data point.

Returns

A CodeLensDetailEntryDescriptor object representing the lens details of the data point.

Parameters

This method has no parameters.

IAsyncCodeLensDataPointProvider # =

Namespace

Microsoft.VisualStudio.Language.CodeLens.Remoting

Summary

Represents a provider which creates IAsyncCodeLensDataPoint instances from an CodeLensDescriptor.

Remarks

This is a MEF component part, and should be exported with the following metadata:

[Export(typeof(IAsyncCodeLensDataPointProvider))]
                 [Name("nameOfTheProvider")]
                 [ContentType("csharp")]

The following metadata are optional:

<see cref="T:Microsoft.VisualStudio.Utilities.PriorityAttribute" /><see cref="T:Microsoft.VisualStudio.Utilities.LocalizedNameAttribute" /><see cref="T:Microsoft.VisualStudio.Utilities.OptionUserVisibleAttribute" /><see cref="T:Microsoft.VisualStudio.Utilities.OptionUserModifiableAttribute" /><see cref="T:Microsoft.VisualStudio.Language.CodeLens.Remoting.DetailsTemplateNameAttribute" />

CanCreateDataPointAsync(descriptor) method # =

Summary

Determines if this provider can create an IAsyncCodeLensDataPoint for the specified CodeLensDescriptor.

Returns

true if a data point can be created from the descriptor; false otherwise.

Parameters
Name Type Description
descriptor Microsoft.VisualStudio.Language.CodeLens.Remoting.CodeLensDescriptor The descriptor to check.

CreateDataPointAsync(descriptor) method # =

Summary

Creates an IAsyncCodeLensDataPoint, on request, from a given descriptor.

Returns

An IAsyncCodeLensDataPoint created from the descriptor.

Parameters
Name Type Description
descriptor Microsoft.VisualStudio.Language.CodeLens.Remoting.CodeLensDescriptor The descriptor to use.

IAsyncCompletionBroker # =

Namespace

Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion

Summary

Represents a class that manages the completion feature. The editor uses this class to trigger completion and obtain instance of IAsyncCompletionSession which contains methods and events relevant to the active completion session.

Example

[Import] IAsyncCompletionBroker CompletionBroker { get; set; }

GetSession(textView) method # =

Summary

Returns IAsyncCompletionSession if active or null if not

Parameters
Name Type Description
textView Microsoft.VisualStudio.Text.Editor.ITextView View that hosts completion and relevant buffers

IsCompletionActive(textView) method # =

Summary

Returns whether completion is active in given view

Parameters
Name Type Description
textView Microsoft.VisualStudio.Text.Editor.ITextView View that hosts completion and relevant buffers

IsCompletionSupported(textView) method # =

Summary

Returns whether there are any completion item sources available for the top buffer in the provided view.

Parameters
Name Type Description
textView Microsoft.VisualStudio.Utilities.IContentType View to check for available completion source exports

TriggerCompletion(textView,triggerLocation,typeChar) method # =

Summary

Activates completion and returns IAsyncCompletionSession. If completion was already active, returns the existing session without changing it. Must be invoked on UI thread.

Parameters
Name Type Description
textView Microsoft.VisualStudio.Text.Editor.ITextView View that hosts completion and relevant buffers
triggerLocation Microsoft.VisualStudio.Text.SnapshotPoint Location of completion on the view's top buffer. Used to pick relevant IAsyncCompletionSources and IAsyncCompletionItemManager
typeChar System.Char Character that triggered completion, or default

IAsyncCompletionCommitManager # =

Namespace

Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion

Summary

Represents a class that provides means to commit CompletionItems and other information relevant to the completion feature at a specific SnapshotPoint.

Remarks

Instances of this class should be created by IAsyncCompletionCommitManagerProvider, which is a MEF part.

PotentialCommitCharacters property # =

Summary

Returns characters that may commit completion. When completion is active and a text edit matches one of these characters, ShouldCommitCompletion is called to verify that the character is indeed a commit character at a given location. Called on UI thread.

ShouldCommitCompletion(typeChar,location) method # =

Summary

Returns whether this character is a commit character in a given location. If every character returned by PotentialCommitCharacters should always commit the active completion session, return true. Called on UI thread.

Returns

True if this character should commit the active session.

Parameters
Name Type Description
typeChar System.Char Character typed by the user
location Microsoft.VisualStudio.Text.SnapshotPoint Location in the snapshot of the view's topmost buffer. The character is not inserted into this snapshot.

TryCommit(view,buffer,item,applicableSpan,typedChar,token) method # =

Summary

Requests commit of specified CompletionItem. Called on UI thread.

Returns

Instruction for the editor how to proceed after invoking this method

Parameters
Name Type Description
view Microsoft.VisualStudio.Text.Editor.ITextView View that hosts completion and relevant buffers
buffer Microsoft.VisualStudio.Text.ITextBuffer Reference to the buffer with matching content type to perform text edits etc.
item Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionItem Which completion item is to be applied
applicableSpan Microsoft.VisualStudio.Text.ITrackingSpan Span augmented by completion, on the view's top buffer
typedChar System.Char Text change associated with this commit
token System.Threading.CancellationToken Cancellation token

IAsyncCompletionCommitManagerProvider # =

Namespace

Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion

Summary

Provides instances of IAsyncCompletionItemManager which filters and sorts available CompletionItems given the current state of the editor.

Example

[Export(typeof(IAsyncCompletionCommitManagerProvider))] [Name(nameof(MyCompletionCommitManagerProvider))] [ContentType("text")] [TextViewRoles(PredefinedTextViewRoles.Editable)] [Order(Before = "OtherCompletionCommitManager")] public class MyCompletionCommitManagerProvider : IAsyncCompletionCommitManagerProvider

Remarks

This is a MEF component and should be exported with [ContentType] and [Name] attributes and optional [Order] and [TextViewRoles] attributes. An instance of IAsyncCompletionItemManager is selected first by matching ContentType with content type of the view's top buffer, and then by Order. Only one IAsyncCompletionItemManager is used in a given view.

GetOrCreate(textView) method # =

Summary

Creates an instance of IAsyncCompletionCommitManager for the specified ITextView.

Returns

Instance of IAsyncCompletionItemManager

Parameters
Name Type Description
textView Microsoft.VisualStudio.Text.Editor.ITextView Text view that will host the completion. Completion acts on buffers of this view.

IAsyncCompletionItemManager # =

Namespace

Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion

Summary

Represents a class that filters and sorts available CompletionItems given the current state of the editor. It also declares which completion filters are available for the returned subset of CompletionItems. All methods are called on background thread.

Remarks

Instances of this class should be created by IAsyncCompletionItemManagerProvider, which is a MEF part.

SortCompletionListAsync(initialList,triggerReason,snapshot,applicableSpan,view,token) method # =

Summary

This method is first called before completion is about to appear, and then on subsequent typing events and when user toggles completion filters. The result of this method will be used in subsequent invocations of UpdateCompletionListAsync User's input is tracked by ITrackingSpan on a ITextSnapshot in a ITextView.

Returns

Instance of FilteredCompletionModel that contains completion items to render, filters to display and recommended item to select

Parameters
Name Type Description
initialList System.Collections.Immutable.ImmutableArray{Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionItem} Set of CompletionItems to filter and sort
triggerReason Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionTriggerReason The CompletionTriggerReason completion was initially triggered.
snapshot Microsoft.VisualStudio.Text.ITextSnapshot Text snapshot of the view's top buffer
applicableSpan Microsoft.VisualStudio.Text.ITrackingSpan Span which tracks the location of the completion session and user's input
view Microsoft.VisualStudio.Text.Editor.ITextView Instance of ITextView that hosts the completion
token System.Threading.CancellationToken Cancellation token that may interrupt this operation

UpdateCompletionListAsync(sortedList,initialTrigger,updateTrigger,snapshot,applicableSpan,selectedFilters,view,token) method # =

Summary

This method is first called before completion is about to appear, and then on subsequent typing events and when user toggles completion filters. user's input tracked with ITrackingSpan on given ITextSnapshot and a collection of CompletionFilterWithStates that indicate user's filter selection.

Returns

Instance of FilteredCompletionModel that contains completion items to render, filters to display and recommended item to select

Parameters
Name Type Description
sortedList System.Collections.Immutable.ImmutableArray{Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionItem} Set of CompletionItems to filter and sort, originally returned from SortCompletionListAsync
initialTrigger Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionTrigger The CompletionTriggerReason completion was initially triggered.
updateTrigger Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.UpdateTrigger The CompletionFilterReason completion is being updated.
snapshot System.Boolean Text snapshot of the view's top buffer
applicableSpan System.Boolean Span which tracks the location of the completion session and user's input
selectedFilters Microsoft.VisualStudio.Text.ITextSnapshot Filters, their availability and selection state
view Microsoft.VisualStudio.Text.ITrackingSpan Instance of ITextView that hosts the completion
token System.Collections.Immutable.ImmutableArray{Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionFilterWithState} Cancellation token that may interrupt this operation

IAsyncCompletionItemManagerProvider # =

Namespace

Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion

Summary

Provides instances of IAsyncCompletionItemManager which filters and sorts available CompletionItems given the current state of the editor.

Example

[Export(typeof(IAsyncCompletionItemManagerProvider))] [Name(nameof(MyCompletionItemManagerProvider))] [ContentType("text")] [TextViewRoles(PredefinedTextViewRoles.Editable)] [Order(Before = "OtherCompletionItemManager")] public class MyCompletionItemManagerProvider : IAsyncCompletionItemManagerProvider

Remarks

This is a MEF component and should be exported with [ContentType] and [Name] attributes and optional [Order] and [TextViewRoles] attributes. An instance of IAsyncCompletionItemManager is selected first by matching ContentType with content type of the view's top buffer, and then by Order. Only one IAsyncCompletionItemManager is used in a given view.

GetOrCreate(textView) method # =

Summary

Creates an instance of IAsyncCompletionItemManager for the specified ITextView.

Returns

Instance of IAsyncCompletionItemManager

Parameters
Name Type Description
textView Microsoft.VisualStudio.Text.Editor.ITextView Text view that will host the completion. Completion acts on buffers of this view.

IAsyncCompletionSession # =

Namespace

Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion

Summary

Represents a class that tracks completion within a single ITextView. Constructed and managed by an instance of IAsyncCompletionBroker

ApplicableSpan property # =

Summary

Gets span applicable to this completion session. The span is defined on the session's TextBuffer.

IsDismissed property # =

Summary

Returns whether session is dismissed. When session is dismissed, all work is canceled.

TextView property # =

Summary

Returns the ITextView this session is active on.

Commit(typedChar,token) method # =

Summary

Commits the currently selected CompletionItem. Must be called on UI thread.

Returns

Instruction for the editor how to proceed after invoking this method

Parameters
Name Type Description
typedChar System.Char The text edit which caused this action. May be default(char).
token System.Threading.CancellationToken Token used to cancel this operation

CommitIfUnique(token) method # =

Summary

Commits the single CompletionItem or opens the completion UI. Must be called on UI thread.

Returns

Whether the unique item was committed.

Parameters
Name Type Description
token System.Threading.CancellationToken Token used to cancel this operation

Dismiss() method # =

Summary

Stops the session and hides associated UI. May be called from any thread.

Parameters

This method has no parameters.

GetBuilderItems() method # =

Summary

Gets suggestion items visible in the UI. This is a blocking call. As a side effect, prevents the UI from displaying.

Parameters

This method has no parameters.

GetItems() method # =

Summary

Gets items visible in the UI. This is a blocking call. As a side effect, prevents the UI from displaying.

Parameters

This method has no parameters.

GetSelectedItem() method # =

Summary

Gets currently selected item. This is a blocking call. As a side effect, prevents the UI from displaying.

Parameters

This method has no parameters.

OpenOrUpdate(trigger,triggerLocation,token) method # =

Summary

Request completion to be opened or updated in a given location, the completion items to be filtered and sorted, and the UI updated. Must be called on UI thread. Enqueues work on a worker thread.

Parameters
Name Type Description
trigger Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionTrigger What caused completion
triggerLocation Microsoft.VisualStudio.Text.SnapshotPoint Location of the trigger on the subject buffer
token System.Threading.CancellationToken Token used to cancel this and other queued operation.

ShouldCommit(typedChar,triggerLocation,token) method # =

Summary

Returns whether given text edit should result in committing this session. Since this method is on a typing hot path, it uses PotentialCommitCharacters to quickly return if typedChar is not a potential commit character. Else, we map triggerLocation to subject buffers and query ShouldCommitCompletion. Must be called on UI thread.

Returns
Parameters
Name Type Description
typedChar System.Char The text edit which caused this action. May be null.
triggerLocation Microsoft.VisualStudio.Text.SnapshotPoint Location on the view's top buffer
token System.Threading.CancellationToken Token used to cancel this operation

IAsyncCompletionSource # =

Namespace

Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion

Summary

Represents a class that provides CompletionItems and other information relevant to the completion feature at a specific SnapshotPoint.

Remarks

Instances of this class should be created by IAsyncCompletionSourceProvider, which is a MEF part.

GetCompletionContextAsync(trigger,triggerLocation,applicableSpan) method # =

Summary

Called once per completion session to fetch the set of all completion items available at a given location. Called on a background thread.

Returns

A struct that holds completion items and applicable span

Parameters
Name Type Description
trigger Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionTrigger What caused the completion
triggerLocation Microsoft.VisualStudio.Text.SnapshotPoint Location where completion was triggered, on the subject buffer that matches this IAsyncCompletionSource's content type
applicableSpan Microsoft.VisualStudio.Text.SnapshotSpan Location where completion will take place, on the view's top buffer

GetDescriptionAsync(item) method # =

Summary

Returns tooltip associated with provided completion item. The returned object will be rendered by IViewElementFactoryService. See its documentation for supported types. Called on a background thread, so UIElement may not be returned.

Returns

Return type is pending what we agree to describe GUI in cross platform fashion

Parameters
Name Type Description
item Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionItem

TryGetApplicableSpan(typeChar,triggerLocation,applicableSpan) method # =

Summary

Provides the span applicable to the prospective session. Called on UI thread and expected to return very quickly, based on syntactic information. This method is called sequentially on available IAsyncCompletionSources until one of them returns true. Returning false does not exclude this source from participating in completion session. If no IAsyncCompletionSources return true, there will be no completion session.

Returns

Whether completion should use the supplied applicable span.

Parameters
Name Type Description
typeChar System.Char Character typed by the user
triggerLocation Microsoft.VisualStudio.Text.SnapshotPoint Location on the subject buffer that matches this IAsyncCompletionSource's content type
applicableSpan Microsoft.VisualStudio.Text.SnapshotSpan@ Applicable span for the prospective completion session. You may set it to default(SnapshotSpan) if returning false.

IAsyncCompletionSourceProvider # =

Namespace

Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion

Summary

Provides instances of IAsyncCompletionSource which filters and sorts available CompletionItems given the current state of the editor.

Example

[Export(typeof(IAsyncCompletionSourceProvider))] [Name(nameof(MyCompletionSource))] [ContentType("text")] [TextViewRoles(PredefinedTextViewRoles.Editable)] public class MyCompletionSource : IAsyncCompletionSource

Remarks

This is a MEF component and should be exported with [ContentType] and [Name] attributes and optional [TextViewRoles] attribute. Completion feature will request data from all exported IAsyncCompletionSources whose ContentType matches content type of any buffer in the completion's trigger location.

GetOrCreate(textView) method # =

Summary

Creates an instance of IAsyncCompletionSource for the specified ITextView. Called on the UI thread.

Returns

Instance of IAsyncCompletionSource

Parameters
Name Type Description
textView Microsoft.VisualStudio.Text.Editor.ITextView Text view that will host the completion. Completion acts on buffers of this view.

IAsyncQuickInfoBroker # =

Namespace

Microsoft.VisualStudio.Language.Intellisense

Summary

Controls invocation and dismissal of Quick Info tooltips for ITextView instances.

Remarks

This type can be called from any thread and will marshal its work to the UI thread as required.

GetSession(textView) method # =

Summary

Gets the current IAsyncQuickInfoSession for the ITextView.

Returns

The session, or null if there is no active session.

Parameters
Name Type Description
textView Microsoft.VisualStudio.Text.Editor.ITextView The ITextView for which to lookup the session.
Remarks

Quick info is considered to be active if there is a visible, calculating, or recalculating quick info session.

TriggerQuickInfoAsync(cancellationToken,textView,triggerPoint,options) method # =

Summary

Triggers Quick Info tooltip in the specified ITextView at the caret or optional triggerPoint.

Returns

An IAsyncQuickInfoSession tracking the state of the session or null if there are no items.

Parameters
Name Type Description
cancellationToken Microsoft.VisualStudio.Text.Editor.ITextView If canceled before the method returns, cancels any computations in progress.
textView Microsoft.VisualStudio.Text.ITrackingPoint The ITextView for which Quick Info is to be triggered.
triggerPoint Microsoft.VisualStudio.Language.Intellisense.QuickInfoSessionOptions The ITrackingPoint in the view's text buffer at which Quick Info should be triggered.
options System.Threading.CancellationToken Options for customizing Quick Info behavior.
Exceptions
Name Description
System.OperationCanceledException cancellationToken was canceled by the caller or the operation was interrupted by another call to TriggerQuickInfoAsync

IAsyncQuickInfoSession # =

Namespace

Microsoft.VisualStudio.Language.Intellisense

Summary

Tracks state of a visible or calculating Quick Info session.

ApplicableToSpan property # =

Summary

The span of text to which this Quick Info session applies.

Content property # =

Summary

The ordered, merged collection of content to be displayed in the Quick Info.

Remarks

This field is originally null and is updated with the content once the session has finished querying the providers.

HasInteractiveContent property # =

Summary

Indicates that this Quick Info has interactive content that can request to stay open.

Options property # =

Summary

Specifies attributes of the Quick Info session and Quick Info session presentation.

State property # =

Summary

The current state of the Quick Info session.

TextView property # =

Summary

The ITextView for which this Quick Info session was created.

DismissAsync() method # =

Summary

Dismisses the Quick Info session, if applicable. If the session is already dismissed, this method no-ops.

Returns

A task tracking the completion of the operation.

Parameters

This method has no parameters.

GetTriggerPoint(textBuffer) method # =

Summary

Gets the point at which the Quick Info tip was triggered in the ITextView.

Returns

A ITrackingPoint indicating the point over which Quick Info was invoked.

Parameters
Name Type Description
textBuffer Microsoft.VisualStudio.Text.ITextBuffer The ITextBuffer relative to which to obtain the point.
Remarks

Returned ITrackingPoint is on the buffer requested by the caller.

GetTriggerPoint(snapshot) method # =

Summary

Gets the point at which the Quick Info tip was triggered in the ITextView.

Returns

The point over which Quick Info was invoked or null if it does not exist in snapshot.

Parameters
Name Type Description
snapshot Microsoft.VisualStudio.Text.ITextSnapshot The ITextSnapshot relative to which to obtain the point.
Remarks

Returned point is on the buffer requested by the caller.

IAsyncQuickInfoSource # =

Namespace

Microsoft.VisualStudio.Language.Intellisense

Summary

Source of Quick Info tooltip content item, proffered to the IDE by a IAsyncQuickInfoSourceProvider.

Remarks

This class is always constructed and disposed on the UI thread and called on a non-UI thread. Callers that require the UI thread must explicitly marshal there with SwitchToMainThreadAsync. Content objects are resolved into UI constructs via the IViewElementFactoryService.

GetQuickInfoItemAsync(session,cancellationToken) method # =

Summary

Gets Quick Info item and tracking span via a QuickInfoItem.

Returns

item and a tracking span for which these item are applicable.

Parameters
Name Type Description
session Microsoft.VisualStudio.Language.Intellisense.IAsyncQuickInfoSession An object tracking the current state of the Quick Info.
cancellationToken System.Threading.CancellationToken Cancels an in-progress computation.
Remarks

This method is always called on a background thread. Multiple elements can be be returned by a single source by wrapping them in a ContainerElement.

IAsyncQuickInfoSourceProvider # =

Namespace

Microsoft.VisualStudio.Language.Intellisense

Summary

A MEF component part that is proffered to the IDE to construct an IAsyncQuickInfoSource.

Example

[Export(typeof(IAsyncQuickInfoSourceProvider))] [Name("Foo QuickInfo Provider")] [Order(After = "default")] [ContentType("text")]

Remarks

This class is always constructed and called on the UI thread.

TryCreateQuickInfoSource(textBuffer) method # =

Summary

Creates an IAsyncQuickInfoSource for the specified ITextBuffer.

Returns

An instance of IAsyncQuickInfoSource for textBuffer or null if no source could be created.

Parameters
Name Type Description
textBuffer Microsoft.VisualStudio.Text.ITextBuffer The ITextBuffer for which this source produces items.

ICodeLensDescriptor # =

Namespace

Microsoft.VisualStudio.Language.CodeLens

Summary

Represents an object describing a code element at the location where an ICodeLensTag will be created.

ApplicableSpan property # =

Summary

The Span of the element.

ElementDescription property # =

Summary

A short description of the element for which this descriptor is created.

FilePath property # =

Summary

The absolute file path of the document in which the descriptor is created.

Kind property # =

Summary

The CodeElementKinds of the element.

ProjectGuid property # =

Summary

The containing project of the document. Can be Empty if the document is a solution's miscellaneous file, or if it does not need to be specified.

ICodeLensTag # =

Namespace

Microsoft.VisualStudio.Language.CodeLens

Summary

An ITag indicating the place where CodeLens indicators should be created.

Descriptor property # =

Summary

The descriptor for this tag.

ICompletionPresenter # =

Namespace

Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion

Summary

Represents a class that manages user interface for the completion feature. All methods are called on UI thread.

Remarks

Instances of this class should be created by ICompletionPresenterProvider, which is a MEF part.

Close() method # =

Summary

Hides the completion UI

Parameters

This method has no parameters.

Open(presentation) method # =

Summary

Opens the UI and displays provided data

Parameters
Name Type Description
presentation Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionPresentationViewModel

Update(presentation) method # =

Summary

Displays provided data on the UI

Parameters
Name Type Description
presentation Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionPresentationViewModel

ICompletionPresenterProvider # =

Namespace

Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion

Summary

Represents a class that produces instances of ICompletionPresenter

Example

[Export(typeof(ICompletionPresenterProvider))] [Name(nameof(MyCompletionPresenterProvider))] [ContentType("any")] [TextViewRoles(PredefinedTextViewRoles.Editable)] [Order(Before = KnownCompletionNames.DefaultCompletionPresenter)] public class MyCompletionPresenterProvider : ICompletionPresenterProvider

Remarks

This is a MEF component and should be exported with [ContentType] and [Name] attributes and optional [Order] attribute. An instance of ICompletionPresenterProvider is selected first by matching ContentType with content type of the view's top buffer, and then by Order. Only one ICompletionPresenterProvider is used in a given view.

ResultsPerPage property # =

Summary

Declares size of the jump when user presses PageUp and PageDown keys.

Remarks

This value needs to be known before the UI is created, hence it is defined on this class instead of ICompletionPresenter. Note that ICompletionPresenter is just a view that doesn't participate in keyboard scrolling

GetOrCreate(textView) method # =

Summary

Returns instance of ICompletionPresenter that will host completion for given ITextView

Returns

Instance of ICompletionPresenter

Parameters
Name Type Description
textView Microsoft.VisualStudio.Text.Editor.ITextView Text view that will host the completion. Completion acts on buffers of this view.
Remarks

It is encouraged to reuse the UI over creating new UI each time this method is called.

IInteractiveQuickInfoContent # =

Namespace

Microsoft.VisualStudio.Language.Intellisense

Summary

Represents an interactive Quick Info content. This interface can be used to add an interactive content such as hyperlinks to the Quick Info popup. If any object implementing this interface is provided to IAsyncQuickInfoSource via GetQuickInfoItemAsync, the Quick Info presenter will allow to interact with this content, particulartly it will keep Quick Info popup open when mouse is over it and will allow this content to recieve mouse events.

IsMouseOverAggregated property # =

Summary

Gets a value indicating whether the mouse pointer is located over this interactive Quick Info content, including any parts that are out of the Quick Info visual tree (such as popups).

KeepQuickInfoOpen property # =

Summary

Gets whether the interactive Quick Info content wants to keep current Quick Info session open. Until this property is true, the IAsyncQuickInfoSession containing this content won't be dismissed even if mouse is moved somewhere else. This is useful in very rare scenarios when an interactive Quick Info content handles all input interaction, while needs to keep this IAsyncQuickInfoSession open (the only known example so far is LightBulb in its expanded state hosted in Quick Info).

ILegacyQuickInfoBrokerSupport # =

Namespace

Microsoft.Internal.VisualStudio.Language.Intellisense

Summary

This interface supports the product infrastructure and should not be used.

TriggerQuickInfoAsync() method # =

Summary

This method supports the product infrastructure and should not be used.

Parameters

This method has no parameters.

ILegacyQuickInfoRecalculateSupport # =

Namespace

Microsoft.Internal.VisualStudio.Language.Intellisense

Summary

This interface supports the product infrastructure and should not be used.

ILegacyQuickInfoSource # =

Namespace

Microsoft.Internal.VisualStudio.Language.Intellisense

Summary

This interface supports the product infrastructure and should not be used.

AugmentQuickInfoSession() method # =

Summary

This interface supports the product infrastructure and should not be used.

Parameters

This method has no parameters.

ILegacyQuickInfoSourcesSupport # =

Namespace

Microsoft.Internal.VisualStudio.Language.Intellisense

Summary

This interface supports the product infrastructure and should not be used.

LegacySources property # =

Summary

This interface supports the product infrastructure and should not be used.

InitialSelectionOption # =

Namespace

Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion

NoSelection constants # =

Summary

There is no selected item. Completion UI will initially not appear. Pressing Tab will dismiss the invisible session. This option is used only in narrow corner cases.

RegularSelection constants # =

Summary

Item is selected. It will be committed by pressing a commit character, e.g. a token delimeter, Tab, Enter and mouse click.

SoftSelection constants # =

Summary

Item is soft selected. It will be committed only by pressing Tab or clicking the item.

LegacyQuickInfoMetadata # =

Namespace

Microsoft.Internal.VisualStudio.Language.Intellisense

Summary

This interface supports the product infrastructure and should not be used.

Remarks

This is a MEF metadata view, similar to IContentTypeMetadata, however it uses an explicit metadata class to allow it to be internal. Internal MEF metadata view interfaces are supported but are currently suffering from intermittent type load exceptions resulting from a bug in either the CLR or VS MEF.

PredefinedCompletionNames # =

Namespace

Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion

Summary

Provides names used by the Async Completion feature.

CompletionCommandHandlers constants # =

Summary

Name of the completion's ICommandHandler. Use to order your MEF part.

DefaultCompletionItemManager constants # =

Summary

Name of the default IAsyncCompletionItemManagerProvider. Use to order your MEF part.

DefaultCompletionPresenter constants # =

Summary

Name of the default ICompletionPresenterProvider. Use to order your MEF part.

SuggestionModeInCompletionOptionName constants # =

Summary

Name of the editor option that stores user's preference for the completion mode.

SuggestionModeInDebuggerCompletionOptionName constants # =

Summary

Name of the editor option that stores user's preference for the completion mode during debugging.

QuickInfoItem # =

Namespace

Microsoft.VisualStudio.Language.Intellisense

Summary

The result generated by an IAsyncQuickInfoSource.

#ctor(applicableToSpan,item) constructor # =

Summary

Constructs a new instance of QuickInfoItem.

Parameters
Name Type Description
applicableToSpan Microsoft.VisualStudio.Text.ITrackingSpan The span to which item is applicable.
item System.Object The Quick Info item.
Exceptions
Name Description
System.ArgumentNullException Thrown if item is null.

ApplicableToSpan property # =

Summary

The ITrackingSpan to which Item is applicable.

Remarks

This parameter can be null.

Item property # =

Summary

The item to be displayed in the Quick Info IToolTipPresenter.

QuickInfoSessionOptions # =

Namespace

Microsoft.VisualStudio.Language.Intellisense

Summary

Options for customization of Quick Info behavior.

None constants # =

Summary

No options.

TrackMouse constants # =

Summary

Dismisses Quick Info when the mouse moves away.

QuickInfoSessionState # =

Namespace

Microsoft.VisualStudio.Language.Intellisense

Summary

Defines the possible IAsyncQuickInfoSession states.

Calculating constants # =

Summary

Session is currently computing Quick Info content.

Created constants # =

Summary

Session has been created but is not yet active.

Dismissed constants # =

Summary

Session has been dismissed and is no longer active.

Visible constants # =

Summary

Computation is complete and session is visible.

QuickInfoSessionStateChangedEventArgs # =

Namespace

Microsoft.VisualStudio.Language.Intellisense

Summary

Arguments for the event.

#ctor(oldState,newState) constructor # =

Summary

Creates a new instance of QuickInfoSessionStateChangedEventArgs.

Parameters
Name Type Description
oldState Microsoft.VisualStudio.Language.Intellisense.QuickInfoSessionState The state before the transition.
newState Microsoft.VisualStudio.Language.Intellisense.QuickInfoSessionState The state after the transition.

NewState property # =

Summary

The state after the transition.

OldState property # =

Summary

The state before the transition.

SuggestionItemOptions # =

Namespace

Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion

Summary

Instructs the editor if and how to display the suggestion mode completion. Suggestion mode displays a single CompletionItem whose DisplayText and InsertText is equal to text typed by the user so far. This class specifies the tooltip to use for this item, and DisplayText when user has not typed anything.

#ctor(displayTextWhenEmpty,toolTipText) constructor # =

Summary

Creates instance of SuggestionModeOptions with specified text. Provide this instance to CompletionContext to activate suggestion mode.

Parameters
Name Type Description
displayTextWhenEmpty System.String DisplayText for the suggestion item when user has not typed anything
toolTipText System.String Tooltip for the suggestion item

UpdateTrigger # =

Namespace

Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion

Summary

What triggered updating of completion.

#ctor(reason,character) constructor # =

Summary

Creates a UpdateTrigger associated with a text edit

Parameters
Name Type Description
reason Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionFilterReason The kind of action that triggered completion to update
character System.Char Character that triggered the update

#ctor(reason) constructor # =

Summary

Creates a CompletionTrigger not associated with a text edit

Parameters
Name Type Description
reason Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.CompletionFilterReason The kind of action that triggered completion to update

Character property # =

Summary

The text edit associated with the triggering action.

Reason property # =

Summary

The reason that completion was updated.

Clone this wiki locally