Skip to content

Conversation

@mahmoudsalah1993
Copy link
Contributor

…urrent file or run test at cursor to work

Resolves #205998

When having a test file with detected tests in a diff view, the File shows test icons, but running Run tests in current file or Run tests at cursor from the command palette or shortcut, both commands fail silently. Instead resolve the underlying modified editor to run the appropriate test.

return;
}

if (isDiffEditor(activeControl)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR assumes that the modified editor in the diff editor is always the one where tests are present, but this may not be the case.

I think we may want to useICodeEditorService.getActiveCodeEditor() instead. The thing to check for there is whether the editor is embedded, via if (editor instanceof EmbeddedCodeEditorWidget) { editor = editor.getParentEditor() }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Removed checks for isCodeEditor given the change now uses activeCodeEditor.

@connor4312
Copy link
Member

Lgtm however there is a compilation error

@connor4312 connor4312 enabled auto-merge (squash) February 26, 2024 15:59
@vscodenpa vscodenpa added this to the March 2024 milestone Feb 26, 2024
@connor4312 connor4312 merged commit 0bdc2f0 into microsoft:main Feb 26, 2024
@microsoft microsoft locked and limited conversation to collaborators Jun 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

4 participants