ProposalBrokerBase.RequestProposals 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
向所有適用的 ProposalSourceBase和 caret
completionState
要求提案。
允許 groupingDelay
先從第一個 ProposalSourceBase 完成傳遞,再放棄其他來源。
public abstract Microsoft.VisualStudio.Threading.AsyncQueue<Microsoft.VisualStudio.Language.Proposals.ProposalCollectionBase> RequestProposals(Microsoft.VisualStudio.Text.VirtualSnapshotPoint caret, Microsoft.VisualStudio.Language.Proposals.CompletionState? completionState, Microsoft.VisualStudio.Language.Proposals.ProposalScenario scenario, char triggeringCharacter, TimeSpan groupingDelay, System.Threading.CancellationToken cancel);
abstract member RequestProposals : Microsoft.VisualStudio.Text.VirtualSnapshotPoint * Microsoft.VisualStudio.Language.Proposals.CompletionState * Microsoft.VisualStudio.Language.Proposals.ProposalScenario * char * TimeSpan * System.Threading.CancellationToken -> Microsoft.VisualStudio.Threading.AsyncQueue<Microsoft.VisualStudio.Language.Proposals.ProposalCollectionBase>
Public MustOverride Function RequestProposals (caret As VirtualSnapshotPoint, completionState As CompletionState, scenario As ProposalScenario, triggeringCharacter As Char, groupingDelay As TimeSpan, cancel As CancellationToken) As AsyncQueue(Of ProposalCollectionBase)
參數
- caret
- VirtualSnapshotPoint
- completionState
- CompletionState
- scenario
- ProposalScenario
- triggeringCharacter
- Char
- groupingDelay
- TimeSpan
- cancel
- CancellationToken
傳回
AsyncQueue<T>的 ProposalCollectionBase。 Complete() 當所有 ProposalSourceBase完成時,都會在佇列上呼叫 。
備註
加入佇列提案的演算法如下所示:
1. Call <xref data-throw-if-not-resolved="true" uid="Microsoft.VisualStudio.Language.Proposals.ProposalSourceBase.RequestProposalsAsync(Microsoft.VisualStudio.Text.VirtualSnapshotPoint,Microsoft.VisualStudio.Language.Proposals.CompletionState,Microsoft.VisualStudio.Language.Proposals.ProposalScenario,System.Char,System.Threading.CancellationToken)"></xref> for each source.
2. Wait until one source returns with a non-null/empty result.
3. Wait an additional <code data-dev-comment-type="paramref">groupingDelay</code> to allow other sources to generate results.
4. Enqueue all sources that generated results using the ordering specified by their <xref data-throw-if-not-resolved="true" uid="Microsoft.VisualStudio.Language.Proposals.ProposalSourceProviderBase"></xref>.
5. Enqueue remaining results in their order of completion.