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

Autocompletion menu functionality is broken, text is deleted instead of inserted #1316

Open
eduarddejong opened this issue Dec 17, 2023 · 27 comments
Labels
Milestone

Comments

@eduarddejong
Copy link

eduarddejong commented Dec 17, 2023

When inserting code from the IntelliSense menu, all code from the text cursor to the beginning is completely deleted.
Nothing is inserted at all.

The most difficult thing is that it's really hard to avoid, since the menu opens itself frequently and typing characters leads to auto selecting text options in the menu, which already makes the experience really buggy.
(That problem exists much longer, in VS and VS Code insertions are never automatically made by typing, only by explicitly confirming the selected item by pressing Enter, but on SharpLab this does not function properly.
However, the deletion issue is is new, I haven't noticed that earlier.)

Thanks for this great extension anyway, it's otherwise really useful!

Browser: Firefox

@JasonBock
Copy link

Thankfully someone else noticed this. I haven't been to sharplab.io in a while, and when I tried to use it today, I wondered if my keyboard was possessed :). Whatever this behavior is, it's making sharplab.io unusable.

@jnm2
Copy link

jnm2 commented Dec 28, 2023

This also seems to happen when typing <, >, or ;, without me seeing autocomplete being involved.

@JasonBock
Copy link

This also seems to happen when typing <, >, or ;, without me seeing autocomplete being involved.

Yeah something seems very borked on the site :(

@ashmind
Copy link
Owner

ashmind commented Jan 4, 2024

Thanks for reporting! Unfortunately I can't reproduce it (including on Firefox).

Is this on specific branch (main vs Default)?
Can you maybe share a recording of the problem?

@jnyrup
Copy link

jnyrup commented Jan 4, 2024

This example is reproducible for me:
https://sharplab.io/#v2:EYLgtghglgdgNAFxAJwK4wD4AEBMBGAWAChiAxAe3IAoBKAbmKwBYACC6m4gb2Jb5ZgBTAO4sAgrQB0AIQjIqMVABsl9XvyGiJNGRABeC5aoZEAvsQskrlm9bu2H9p45fO3rj+6+fHAZwRoAMYI4izc/GFEEVgAzCzMLLLyWHgADCz+yJxR/Dw5EXwpAJxUAERJpWr5BcVlFVUR5vnqhXEJsgYp6ZnZEXkF/LXl+pUmA4V4JcN6oy0sTaZAA

What I notice:
The glitch only seems to happen when running the code and when editing the code makes a "visual jump" during execution.
I suspect this is somehow related to the insertion of the three icons
image

In this video, see how after commenting out some code, repeatedly pressing right-arrow to move the cursor through the lines, shows that the righmost column on each line where the cursor is placed, corresponds to the righmost column on the line below.
https://github.com/ashmind/SharpLab/assets/919634/2c2c69bc-52ae-4515-a015-1b83795fee73

@ashmind
Copy link
Owner

ashmind commented Jan 5, 2024

Thanks, I can reproduce this.
It might be a bit tricky to resolve (likely an issue in editor component internals), but I'll take a look when I am able.

@eduarddejong
Copy link
Author

By the way, mabe it's also good to check the Visual Basic experience.

Issues are very easy to notice with it.

@PrashantUnity
Copy link

PrashantUnity commented Feb 14, 2024

today it won't let me type any thing. Whenever there comes any Auto Suggestion it removes everything upto that point.

One things i also noticed that . Sometimes on reloading full page it works perfectly.

Thus Issue i found while i am using Chrome
But i haven't any issue while using Opera

Bug.mp4

@Phyyl
Copy link

Phyyl commented Apr 16, 2024

Same issue here but in Chrome.

@jcouv
Copy link

jcouv commented Apr 17, 2024

@ashmind If it's tricky to fix, might disabling the completion be a workable mitigation?

@vladd
Copy link

vladd commented Jun 3, 2024

Looks like it works now? Using newest Firefox.

@dongle-the-gadget
Copy link

Nope, still deletes code here. On iOS 18 Safari

@jnm2
Copy link

jnm2 commented Jun 13, 2024

It depends on which branch you have selected. It deletes code constantly for me with main selected.

@siegfriedpammer
Copy link

Still an issue... please add an option to disable code completion.

@B1Z0N
Copy link

B1Z0N commented Sep 4, 2024

It's broken. Can we fix this somehow? I can invest time, but please we need it fixed so badly...

@canton7
Copy link

canton7 commented Sep 4, 2024

It depends on which branch you have selected. It deletes code constantly for me with main selected.

See above. Select a branch other than main, and it works fine.

@dusrdev
Copy link

dusrdev commented Nov 17, 2024

@ashmind hey, any update? This is still broken and makes the website pretty much unusable, I have to use several ctrl+z's every time I press enter because it deletes the entire page...

@ashmind
Copy link
Owner

ashmind commented Nov 18, 2024

@dusrdev No update as of this moment, it is certainly on my list, but I haven't done any SharpLab work for a while, and this is one of the harder problems. Even disabling autocomplete is not trivial, but it is likely I'll start with that either way.

@ashmind ashmind added this to the 98 milestone Nov 18, 2024
@DCote3B
Copy link

DCote3B commented Nov 20, 2024

Still happening on various branches on Chrome for me. Sometimes (not always) reloading the page helps.

@EMWJP-U
Copy link

EMWJP-U commented Dec 16, 2024

Still happening. Also using chrome. Its impossible to type anything, entire code is deleted. I think is not related to SharpLab by the way, in VS2022 type renaming is broken too, move type to another file is broken too. Its related to Roslyn.

In last two days they commited/merged lot of commits with checks failed and weird commit messages such as "Simplify" and "Unify", and many these changes mess with completition provider.

@ChadNedzlek
Copy link

Wow. You weren't kidding. There are THOUSANDS of commits with nonsense messages in the last month, all by the same person.

@CyrusNajmabadi
Copy link

CyrusNajmabadi commented Jan 5, 2025

in VS2022 type renaming is broken too, move type to another file is broken too. Its related to Roslyn.

None of this impacts the completion behavior. If you have issues with rename and/or 'move type to file' please file issues with Roslyn so we can look into it.

Wow. You weren't kidding. There are THOUSANDS of commits with nonsense messages in the last month, all by the same person.

As mentioned already: Roslyn follows a PR based strategy, where the PR is reviewed and merged in. The individual commits are up to each developer as to how they like to manage it.

@CyrusNajmabadi
Copy link

CyrusNajmabadi commented Jan 5, 2025

In last two days they commited/merged lot of commits with checks failed

Could you point to any PRs merged where the PR merge commit was failing checks? That should almost never happen (only in critical emergencies where we are actually unblocking something else). I'm unaware of anything like that happening for a very long time now.

@CyrusNajmabadi
Copy link

CyrusNajmabadi commented Jan 5, 2025

@ashmind how are you handling completion? Where do you retrieve them? And how to you apply them back to your buffer?

@EMWJP-U
Copy link

EMWJP-U commented Jan 6, 2025

@CyrusNajmabadi
image
image

@canton7
Copy link

canton7 commented Jan 6, 2025

@EMWJP-U Err, those are intermediate commits on a branch, which was then merged to main. dotnet/roslyn#76611. The checks were all green at the point of merge. Took about 2 clicks to find that out from cold.

@CyrusNajmabadi
Copy link

@EMWJP-U I asked:

Could you point to any PRs merged where the PR merge commit was failing checks?

None of those are the merge commit. They are intermediate points in time where the developer chose to commit.

Note: these show up as failures because when we push more commits to GitHub, the existing tests are cancelled (which are reported as failures). We do this to save time and costs as we have a fixed size pool of testing machines, and we want them testing the code that will actually be merged in.

You are:

  1. Equating cancelled tests with failed tests.
  2. Equating intermediate commit points with the final merged pr commit.

As mentioned, Roslyn follows a PR merge oriented approach to development. The PR is the unit of relevance to the team. And once that is approved and is passing all tests, it can be merged in. Individual commits are organized by developers however they want. For me, as I often have numerous interdependent branches I'm working on simultaneously, I often have many commits to make cross Branch merges easier. Other devs follow other approaches.

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

No branches or pull requests