Caveat: Not sure if I fully understand what I'm doing here.
My expectation by setting preserveFocus to false was that focus would move to the Test View (initially) and I could start to navigate around there using the keyboard. Instead, when preserveFocus seems to only control toggling whether or not the Test Results View is shown automatically. Focus remains wherever the run was started (e.g., I invoked the command either through the command palette or a key binding from an editor, focus remained in the editor regardless of the setting).
Per instructions in the TPI, I added a new command in package.json.
When running the extension and invoking the command through the command palette, toggling preserveFocus to true and false simply controlled whether or not the Test Results View was automatically opened. I did not observe any change in focus.
Thinking I may be inadvertently messing with focus by invoking the command palette, I bound the command to a key which resulted in exactly the same behavior.
If the goal of the new param is to automatically show the Test Results View, perhaps it should be named something more like showTestResults.
Testing #213601
Caveat: Not sure if I fully understand what I'm doing here.
My expectation by setting
preserveFocus
tofalse
was that focus would move to the Test View (initially) and I could start to navigate around there using the keyboard. Instead, whenpreserveFocus
seems to only control toggling whether or not the Test Results View is shown automatically. Focus remains wherever the run was started (e.g., I invoked the command either through the command palette or a key binding from an editor, focus remained in the editor regardless of the setting).Per instructions in the TPI, I added a new command in
package.json
.I updated how the 'Run in Electron' profile was created so that I could reference it:
Then, I added a command handler to the
activate
function inextension.ts
:When running the extension and invoking the command through the command palette, toggling
preserveFocus
totrue
andfalse
simply controlled whether or not the Test Results View was automatically opened. I did not observe any change in focus.Thinking I may be inadvertently messing with focus by invoking the command palette, I bound the command to a key which resulted in exactly the same behavior.
If the goal of the new param is to automatically show the Test Results View, perhaps it should be named something more like
showTestResults
.