次の方法で共有


Proposal.TryCreateProposal メソッド

定義

オーバーロード

TryCreateProposal(String, IReadOnlyList<ProposedEdit>, VirtualSnapshotPoint, CompletionState, ProposalFlags, Func<Boolean>, String, String, String, NormalizedSnapshotSpanCollection)

1 つ以上editsの 、位置、および省略可能completionStateな を指定してcaret、提案を作成してみてください。

public static Microsoft.VisualStudio.Language.Proposals.ProposalBase? TryCreateProposal(string? description, System.Collections.Generic.IReadOnlyList<Microsoft.VisualStudio.Language.Proposals.ProposedEdit> edits, Microsoft.VisualStudio.Text.VirtualSnapshotPoint caret, Microsoft.VisualStudio.Language.Proposals.CompletionState? completionState = default, Microsoft.VisualStudio.Language.Proposals.ProposalFlags flags = Microsoft.VisualStudio.Language.Proposals.ProposalFlags.None, Func<bool>? commitAction = default, string? proposalId = default, string? acceptText = default, string? nextText = default, Microsoft.VisualStudio.Text.NormalizedSnapshotSpanCollection? scope = default);
static member TryCreateProposal : string * System.Collections.Generic.IReadOnlyList<Microsoft.VisualStudio.Language.Proposals.ProposedEdit> * Microsoft.VisualStudio.Text.VirtualSnapshotPoint * Microsoft.VisualStudio.Language.Proposals.CompletionState * Microsoft.VisualStudio.Language.Proposals.ProposalFlags * Func<bool> * string * string * string * Microsoft.VisualStudio.Text.NormalizedSnapshotSpanCollection -> Microsoft.VisualStudio.Language.Proposals.ProposalBase
Public Shared Function TryCreateProposal (description As String, edits As IReadOnlyList(Of ProposedEdit), caret As VirtualSnapshotPoint, Optional completionState As CompletionState = Nothing, Optional flags As ProposalFlags = Microsoft.VisualStudio.Language.Proposals.ProposalFlags.None, Optional commitAction As Func(Of Boolean) = Nothing, Optional proposalId As String = Nothing, Optional acceptText As String = Nothing, Optional nextText As String = Nothing, Optional scope As NormalizedSnapshotSpanCollection = Nothing) As ProposalBase

パラメーター

description
String

提案の意図の説明。 null を使用できます。

edits
IReadOnlyList<ProposedEdit>

提案の編集候補。

caret
VirtualSnapshotPoint

提案が生成された時点でのキャレットの場所。

completionState
CompletionState

提案が生成された時点の完了状態。

flags
ProposalFlags

提案に関連付けられているフラグ。

commitAction
Func<Boolean>

提案が受け入れられたときに実行するアクション。 null の場合は、 edits が適用されます。 それ以外の場合、アクションが実行されます (修正候補サービスによる編集は行われず、返された値はコマンド ハンドラーに渡されます。

proposalId
String

テレメトリで使用する提案に関連付けられている一意の識別子。

acceptText
String

ヒント バーの [承諾] ボタンの横に表示されるローカライズされたテキスト。 null の場合は、"受け入れる" のようなローカライズされた文字列が使用されます。

nextText
String

ヒント バーの次の候補ボタンの横に表示されるローカライズされたテキスト。 null の場合は、"次の候補" のようなローカライズされた文字列が使用されます。

scope
NormalizedSnapshotSpanCollection

提案に関連付けられているコードのスコープ。

戻り値

で定義 ValidateEdits(IReadOnlyList<ProposedEdit>, VirtualSnapshotPoint, CompletionState)されている規則で提案が無効な場合は null。

適用対象

TryCreateProposal(String, IReadOnlyList<ProposedEdit>, VirtualSnapshotPoint, CompletionState, ProposalFlags, Func<Boolean>, String, String, String, String, NormalizedSnapshotSpanCollection)

public static Microsoft.VisualStudio.Language.Proposals.ProposalBase? TryCreateProposal(string? description, System.Collections.Generic.IReadOnlyList<Microsoft.VisualStudio.Language.Proposals.ProposedEdit> edits, Microsoft.VisualStudio.Text.VirtualSnapshotPoint caret, Microsoft.VisualStudio.Language.Proposals.CompletionState? completionState, Microsoft.VisualStudio.Language.Proposals.ProposalFlags flags, Func<bool>? commitAction, string? proposalId, string? acceptText, string? previewText, string? nextText, Microsoft.VisualStudio.Text.NormalizedSnapshotSpanCollection? scope);
static member TryCreateProposal : string * System.Collections.Generic.IReadOnlyList<Microsoft.VisualStudio.Language.Proposals.ProposedEdit> * Microsoft.VisualStudio.Text.VirtualSnapshotPoint * Microsoft.VisualStudio.Language.Proposals.CompletionState * Microsoft.VisualStudio.Language.Proposals.ProposalFlags * Func<bool> * string * string * string * string * Microsoft.VisualStudio.Text.NormalizedSnapshotSpanCollection -> Microsoft.VisualStudio.Language.Proposals.ProposalBase
Public Shared Function TryCreateProposal (description As String, edits As IReadOnlyList(Of ProposedEdit), caret As VirtualSnapshotPoint, completionState As CompletionState, flags As ProposalFlags, commitAction As Func(Of Boolean), proposalId As String, acceptText As String, previewText As String, nextText As String, scope As NormalizedSnapshotSpanCollection) As ProposalBase

パラメーター

description
String
completionState
CompletionState
commitAction
Func<Boolean>
proposalId
String
acceptText
String
previewText
String
nextText
String

戻り値

適用対象

TryCreateProposal(String, IReadOnlyList<ProposedEdit>, VirtualSnapshotPoint, CompletionState, ProposalFlags, Func<Boolean>, String, String, String, String, String, NormalizedSnapshotSpanCollection)

public static Microsoft.VisualStudio.Language.Proposals.ProposalBase? TryCreateProposal(string? description, System.Collections.Generic.IReadOnlyList<Microsoft.VisualStudio.Language.Proposals.ProposedEdit> edits, Microsoft.VisualStudio.Text.VirtualSnapshotPoint caret, Microsoft.VisualStudio.Language.Proposals.CompletionState? completionState, Microsoft.VisualStudio.Language.Proposals.ProposalFlags flags, Func<bool>? commitAction, string? proposalId, string? acceptText, string? previewText, string? nextText, string? undoDescription, Microsoft.VisualStudio.Text.NormalizedSnapshotSpanCollection? scope);
static member TryCreateProposal : string * System.Collections.Generic.IReadOnlyList<Microsoft.VisualStudio.Language.Proposals.ProposedEdit> * Microsoft.VisualStudio.Text.VirtualSnapshotPoint * Microsoft.VisualStudio.Language.Proposals.CompletionState * Microsoft.VisualStudio.Language.Proposals.ProposalFlags * Func<bool> * string * string * string * string * string * Microsoft.VisualStudio.Text.NormalizedSnapshotSpanCollection -> Microsoft.VisualStudio.Language.Proposals.ProposalBase
Public Shared Function TryCreateProposal (description As String, edits As IReadOnlyList(Of ProposedEdit), caret As VirtualSnapshotPoint, completionState As CompletionState, flags As ProposalFlags, commitAction As Func(Of Boolean), proposalId As String, acceptText As String, previewText As String, nextText As String, undoDescription As String, scope As NormalizedSnapshotSpanCollection) As ProposalBase

パラメーター

description
String
completionState
CompletionState
commitAction
Func<Boolean>
proposalId
String
acceptText
String
previewText
String
nextText
String
undoDescription
String

戻り値

適用対象