redhat-developer / redhat-developer/lsp4ij

`didClose` and `didOpen` events go out of balance when dragging an editor window from the main IDE view to another view

Open
#1,383 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
344
Forks
113
Avg merge
5h 22m
Merged PRs (30d)
15

Description

The out-of-balance causes similar problems to #574.


"Dragging an editor window from the main IDE view to another view" is shown below.

This is the initial state of the main IDE view:

Image

After dragging file2.py out to another IDE view:

Image

This dragging event only triggers a single textDocument/didClose event, so the language server now thinks file2.py is closed.

[Trace - 09:42:09] Sending notification 'textDocument/didClose'


For this particular example, where only one file2.py view is present, I expected either one of these after dragging:

  • Neither didClose nor didOpen events should trigger
  • Both didClose and didOpen events should trigger

However, in the scenario where there was another open editor window of file2.py (so 2 or more views of file2.py in total), then dragging file2.py out should not trigger any didOpen or didClose events (currently, LSP4IJ behaves correctly in this scenario).


I do not know when this problem started occurring; it may have started before the latest release of LSP4IJ. This bug reproduction is for the latest release (v0.18).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in LSP4IJ v0.18 by dragging file2.py from the main IDE view to another view, and inspect the textDocument/didOpen and textDocument/didClose trace. Done means the move no longer leaves the language server believing the file is closed, while the behavior remains correct when multiple views of file2.py are open.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.