"Try this" support #
This implements a mechanism for tactics to print a message saying Try this: ,
where is a link to a replacement tactic. Users can either click on the link
in the suggestion (provided by a widget), or use a code action which applies the suggestion.
This is a widget which is placed by TryThis.addSuggestion; it says Try this:
where is a link which will perform the replacement.
Equations
- One or more equations did not get rendered due to their size.
Instances For
This is a code action provider that looks for TryThisInfo nodes and supplies a code action to
apply the replacement.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Replace subexpressions like ?m.1234 with ?_ so it can be copy-pasted.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Delaborate e into an expression suitable for use in refine.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Add a "try this" suggestion. This has three effects:
- An info diagnostic is displayed saying
Try this: - A widget is registered, saying
Try this:with a link onto apply the suggestion - A code action
Apply 'Try this'is added, which will apply the suggestion.
The parameters are:
ref: the span of the info diagnosticsuggestion: the replacement syntaxsuggestionForMessage?: the message to display in the info diagnostic (only). The widget message uses onlysuggestion. If not provided,suggestionis used in both places.origSpan?: a syntax object whose span is the actual text to be replaced bysuggestion. If not provided it defaults toref.extraMsg: an extra piece of message text to apply to the widget message (only).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Add a exact e or refine e suggestion.
The parameters are:
ref: the span of the info diagnostice: the replacement expressionorigSpan?: a syntax object whose span is the actual text to be replaced bysuggestion. If not provided it defaults toref.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Add a term suggestion.
The parameters are:
ref: the span of the info diagnostice: the replacement expressionorigSpan?: a syntax object whose span is the actual text to be replaced bysuggestion. If not provided it defaults toref.
Equations
- One or more equations did not get rendered due to their size.