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

JS Editing: Editor jumping up and down typing (after a short pause in typing) - seems related to the collapse imports at the top of the file. #1508

Open
jridge-ezclocker opened this issue Apr 1, 2024 · 6 comments

Comments

@jridge-ezclocker
Copy link

The JS editor will collapse imports when opened. With imports collapsed, I begin editing some of the JS code and after pausing typing the editor jumps up/down (which appears to be the expanding/collapsing imports refreshing for some reason) and causes the editor to scroll into the wrong position. Even when just typing a space - this happens. It makes editing JS files in eclipse impossible - so I'm using a different IDE now (VSCode).

The collapsing of imports seems very bugged and might be the root of the problem. The imports never stay 'un-folded' and 'un-folding' them tends to never work property without typing a space at the end of a import line (see some example screen shots below). This code folding issue might well need to be written up as a different issue - just let me know.

Imports Collapsed
collapse-imports

After Click + on the Collapsed Import Line you can see they do not fully expand and clicking fold/unfold doesn't correct the problem:
failed-expanded-imports

In order to see imports, I have to type a space at the end of one of the visible lines. Then they will mostly appear, although sometimes they immediately collapse again. Always collapsing after typing or copying in a new import (even when I haven't finished typing it in). Very frustrating.

As a side point: I do not want the imports folded to begin with but do not see anything that will disable the functionality (please guide me if there is somewhere I can disable that).

I do have other plugins installed - I removed one (AnyEdit) that I suspected might be causing an issue but it had not effect on the problem after removing (still existed). I can provide the plugins listed in case you need to review or ask me to remove one and check the results. In general it Spring Tools, DevStyle, AspectJ Tools, SonarLint, and JAutoDoc.

@angelozerr
Copy link
Contributor

I remember that I had this problem when I have implemented CodeMining.

Perhaps I'm wrong, but I suspect that it is a problem with Eclipse Platform Text which doesn't compute correctly the top position of the editor.

@ultraswank
Copy link

ultraswank commented Apr 2, 2024

Came here to report the same thing. None of the Eclipse Editor options to disable folding seem to have any impact. Neither does disabling CodeMining.

@jridge-ezclocker
Copy link
Author

jridge-ezclocker commented Apr 3, 2024

I remember that I had this problem when I have implemented CodeMining.

Perhaps I'm wrong, but I suspect that it is a problem with Eclipse Platform Text which doesn't compute correctly the top position of the editor.

I think it is possible the problem is in the Generic text editor and not specific to WildWebDeveloper. Should I report the same defect in https://github.com/eclipse-platform/eclipse.platform.ui or is there a way to @ that team to this defect?

I see this (related to folded code) reported: eclipse-platform/eclipse.platform.ui#1182 - reading that report it does seem to act like what I see with the imports at the top of a JS file. I'll add a reference to this bug report in the one I linked just in case.

@mickaelistria
Copy link
Contributor

I think it is possible the problem is in the Generic text editor and not specific to WildWebDeveloper. Should I report the same defect in https://github.com/eclipse-platform/eclipse.platform.ui or is there a way to @ that team to this defect?

If you can reproduce it for the generic editor in general and provide a test case that reproduces it without requiring anything else than the generic editor, then a report to eclipse.platform.ui is really welcome.
However, if you cannot reproduce it with plain generic editor nor provide a self-contained test case to report it, then it's probably not worth reporting.
Note that I've extensively used generic editor with JDT-LS, and couldn't see this problem although JDT-LS provide folding ranges, so it doesn't seem obvious that it's a generic editor problem to me.

@Kiiv
Copy link

Kiiv commented Apr 4, 2024

Same problem here. Can't tell if its new or if it's related to latest Eclipse version because I'm juste starting to work on TypeScript files.

Unfortunately I can't test the latest snapshot because of a hash problem (#1505).

@wesleybl
Copy link

wesleybl commented May 6, 2024

As said here: eclipse/lsp4e#895 (comment)

To disable import collapses, simply install the latest version of lsp4e.

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

No branches or pull requests

6 participants