Add RefactorTriggerReason by jessetrinity · Pull Request #38378 · microsoft/TypeScript

Adds RefactorTriggerReason proposed in #35096. Partially covers cases for refactor discoverability #37895.

This change allows the user to send the code action command (ctrl + . in VS and VSCode) to request available refactors at a cursor location (empty span) rather than having to select the entire span of the code to be refactored. The intent is to make refactors more discoverable by allowing a user to "ask" if a refactor is available, rather than having to know in advance that a refactor is applicable to a particular span.

In the future we may want to offer more refactors when the code action command is sent while non-empty span is selected. This change enables that behavior but intentionally does not implement it.