-
Notifications
You must be signed in to change notification settings - Fork 28.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
for diff editors, resolve the modified editor to allow run tests in c… #206026
for diff editors, resolve the modified editor to allow run tests in c… #206026
Conversation
…urrent file or run test at cursor to work
if (!activeEditorPane || !activeControl) { | ||
return; | ||
} | ||
|
||
if (isDiffEditor(activeControl)) { |
There was a problem hiding this comment.
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() }
There was a problem hiding this comment.
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.
Lgtm however there is a compilation error |
…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
orRun tests at cursor
from the command palette or shortcut, both commands fail silently. Instead resolve the underlying modified editor to run the appropriate test.