Proposal.TryCreateProposal Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
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
.
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.
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".
Á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
- edits
- IReadOnlyList<ProposedEdit>
- caret
- VirtualSnapshotPoint
- completionState
- CompletionState
- flags
- ProposalFlags
- 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
- edits
- IReadOnlyList<ProposedEdit>
- caret
- VirtualSnapshotPoint
- completionState
- CompletionState
- flags
- ProposalFlags
- proposalId
- String
- acceptText
- String
- previewText
- String
- nextText
- String
- undoDescription
- String