Skip to content
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

Issue: Incorrect editor.selection.isEmpty Behavior in Jupyter Notebooks #14476

Closed
garyb9 opened this issue Nov 18, 2024 · 0 comments · Fixed by #14480
Closed

Issue: Incorrect editor.selection.isEmpty Behavior in Jupyter Notebooks #14476

garyb9 opened this issue Nov 18, 2024 · 0 comments · Fixed by #14480
Assignees

Comments

@garyb9
Copy link

garyb9 commented Nov 18, 2024

Description:

When working with a Jupyter Notebook in Theia and using the vscode.window.activeTextEditor API to log editor.selection.isEmpty, the result is inconsistent with the behavior in VS Code. The isEmpty property incorrectly returns true in Theia for a non-empty selection, whereas in VS Code, it correctly returns false.

Steps to Reproduce:
1. Open a Jupyter Notebook in Theia.
2. Select two lines of text within a single cell.
3. Log the editor.selection.isEmpty property:

const editor = vscode.window.activeTextEditor;
console.log(`isEmpty: ${editor.selection.isEmpty}`);

Note - this only happens when selecting bottom to top

Expected Behavior (VS Code):

When selecting two lines in a cell, editor.selection.isEmpty should return false because the selection is not empty.

Observed Behavior (Theia):

For the same file and same selection, editor.selection.isEmpty incorrectly evaluates to true, even though there is a visible selection spanning multiple lines.

Reference this issue with the same setup:
#14475

Impact:

This inconsistency affects extensions or code relying on the editor.selection.isEmpty property for determining whether a selection exists in Jupyter notebooks. This can lead to incorrect functionality in scenarios that depend on non-empty selections.

Additional Context:

This issue appears specific to Jupyter notebooks and does not occur with standard text files. It might be related to how Theia handles notebook-specific editors versus standard text editors.

Request:

Please investigate this discrepancy and align the behavior of editor.selection.isEmpty in Jupyter notebooks with the expected behavior in VS Code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants