Compartir a través de


Proposal.TryCreateProposal Método

Definición

Sobrecargas

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

Intente crear una propuesta dada una o varias edits, una caret posición y una 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)

Intente crear una propuesta dada una o varias edits, una caret posición y una 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

Descripción de la intención de la propuesta. Puede ser NULL.

edits
IReadOnlyList<ProposedEdit>

Una edición propuesta para la propuesta.

caret
VirtualSnapshotPoint

Ubicación del símbolo de intercalación en el momento en que se generó la propuesta.

completionState
CompletionState

Estado de finalización en el momento en que se generó la propuesta.

flags
ProposalFlags

Marcas asociadas a la propuesta.

commitAction
Func<Boolean>

Acción que se va a realizar cuando se acepta la propuesta. Si es null, edits se aplicará. De lo contrario, la acción se ejecuta (y el servicio de sugerencias no realiza modificaciones y el valor devuelto se pasará al controlador de comandos.

proposalId
String

Identificador único asociado a la propuesta de uso con telemetría.

acceptText
String

Texto localizado que se muestra junto al botón Aceptar en la barra de sugerencias. Si es null, se usará una cadena localizada similar a "to accept".

nextText
String

Texto localizado que se muestra junto al botón de sugerencia siguiente en la barra de sugerencias. Si es null, se usará una cadena localizada similar a la "sugerencia siguiente".

scope
NormalizedSnapshotSpanCollection

Ámbito del código asociado a la propuesta.

Devoluciones

null si la propuesta no es válida por las reglas definidas en ValidateEdits(IReadOnlyList<ProposedEdit>, VirtualSnapshotPoint, CompletionState).

Se aplica 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

Devoluciones

Se aplica 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

Devoluciones

Se aplica a