Easy pick codelenses with keyboard shortcut#91232
Conversation
Signed-off-by: Gustavo Sampaio <[email protected]>
55cf235 to
e9ddb0f
Compare
|
Figured out what was going on. Tests for monaco are ok. Thanks anyway |
Signed-off-by: Gustavo Sampaio <[email protected]>
| } | ||
| } | ||
|
|
||
| export class ShowLensesInCurrentLineCommand extends Command { |
There was a problem hiding this comment.
Use EditorCommand instead of the generic command. It will already have the correct editor.
There was a problem hiding this comment.
Nice! Changed to use it. Thanks @jrieken
|
|
||
| public getLenses(): CodeLensWidget[] { | ||
| return this._lenses; | ||
| } |
There was a problem hiding this comment.
Why expose the widgets and not the model itself?
There was a problem hiding this comment.
We need the line number of the widget on line 421:
const activeLensesWidgets = codelensController.getLenses().filter(lens => lens.getLineNumber() === lineNumber);
There was a problem hiding this comment.
Ah, the live/updated line numbers... That makes good sense. Thanks for clarifying
|
|
||
| const commandArguments: Map<string, any[] | undefined> = new Map(); | ||
|
|
||
| const picker = quickInputService.createQuickPick(); |
There was a problem hiding this comment.
You can use IQuickInputService#pick instead of createQuickPick. For simple cases like this you don't to write that much code
|
Thanks |
Signed-off-by: Gustavo Sampaio [email protected]
This PR closes #41579
This adds a new command that when invoked, shows in a quickpick all the codelenses available in the current line. This makes it easier to "activate"/run a codelens with keyboard. One can set a keybinding for that command and easily switch between the available codelenses with the keyboard.
This is my first pr! I appreciate any suggestions or comments on where to improve this.