Compartilhar via


Proposal.TryCreateProposal Método

Definição

Sobrecargas

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

Tente criar uma proposta com um ou mais edits, uma caret posição e um opcional completionState.

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

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

Tente criar uma proposta com um ou mais edits, uma caret posição e um opcional completionState.

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

Parâmetros

description
String

Uma descrição da intenção da proposta. Pode ser nulo.

edits
IReadOnlyList<ProposedEdit>

Uma edição proposta para a proposta.

caret
VirtualSnapshotPoint

O local do cursor no momento em que a proposta foi gerada.

completionState
CompletionState

O estado de conclusão no momento em que a proposta foi gerada.

flags
ProposalFlags

Sinalizadores associados à proposta.

commitAction
Func<Boolean>

Uma ação a ser executada quando a proposta é aceita. Se for nulo, edits será aplicado. Caso contrário, a ação será executada (e nenhuma edição será executada pelo serviço de sugestão e o valor retornado será passado para o manipulador de comandos.

proposalId
String

Um identificador exclusivo associado à proposta de uso com telemetria.

acceptText
String

Texto localizado mostrado ao lado do botão aceitar na barra de dicas. Se for nulo, uma cadeia de caracteres localizada semelhante a "para aceitar" será usada.

nextText
String

Texto localizado mostrado ao lado do próximo botão de sugestão na barra de dicas. Se for nulo, uma cadeia de caracteres localizada semelhante a "próxima sugestão" será usada.

scope
NormalizedSnapshotSpanCollection

Escopo do código associado à proposta.

Retornos

nulo se a proposta não for válida pelas regras definidas em ValidateEdits(IReadOnlyList<ProposedEdit>, VirtualSnapshotPoint, CompletionState).

Aplica-se a

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

Parâmetros

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

Retornos

Aplica-se a

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

Parâmetros

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

Retornos

Aplica-se a