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

Replace all can freeze all editors. #5740

Open
lmcbout opened this issue Jul 17, 2019 · 2 comments
Open

Replace all can freeze all editors. #5740

lmcbout opened this issue Jul 17, 2019 · 2 comments
Labels
performance issues related to performance search in workspace issues related to the search-in-workspace

Comments

@lmcbout
Copy link
Contributor

lmcbout commented Jul 17, 2019

Description

When I launch "replace all", the front-end stop working, cannot save any editors until I reload the front-end. Happen on CPP project. JAVA and TS project report an error on the dev tools, but keep working.

Using "Replace all" command with formatOnSave set to true
Theia and VSCODE have the "AutoSave = off"
I tested with CPP, JAVA and TS projects.

CPP project

Theia:

  No Re-format
  No save after replace all
  In dev tools : root ERROR onWillSave listeners should provide edits, not directly alter the document
  Also notice that sometimes, I saw document "formatOnSave" event triggers an error
  --> When the error occurs, you can edit but you cannot save any files.
  Need to restart the front-end 

VSCode:

  Re-format 
  Save after replace all is done

JAVA and Typescript project

Theia:

  Not saved automatically
  RE-format applied after manual save only
  
  On manual save, the following error:
     logger-protocol.ts:112 root ERROR onWillSave listeners should provide edits, not directly alter the document.

VSCode:

 replace all + RE-format + Save

Reproduction Steps

open a CPP project
Open the preferences setting -> make sure the "editor.formatOnSave = off
Open a file and modify the format of the file, insert some empty chars, ... + save the file DO NOT CLOSE the file.
Now re-adjust the preference to have the "editor.formatOnSave" = true
Reload the front-end
Select the "Search " view, enter some text that shows in a few files and a replacement
Press the "Replace all" buttons
Select the initial file you open, try to save the new contents
--> Unable to save the content of the first editor and unable to save from any other editors either until you reload the front-end.

OS and Theia version:
Theia 0.8.0
Ubuntu 16.04

Diagnostics:
Theia:

FormatOnSaveAfterReplaceAll

VScode:

VSCodeReplaceAllAndFormatOnSave

@vince-fugnitto
Copy link
Member

I don't think it's useful to address this issue at the moment as #5600 is likely to address it anyways.
It be better to see if the issue still exists after #5600 is merged.

It is also likely a duplicate of #5454.
Performing replace-all which affects 100 files for instance will slow down the frontend until it's unusable.

@lmcbout
Copy link
Contributor Author

lmcbout commented Jul 17, 2019

@vince-fugnitto
Testing on master where the video were recorded. After issue #5454, this problem will become more visible .When I reviewed #5454 , this is how I started to investigate this issue. I reported #5671 because I though it was mainly dependent of it, but with a deeper investigation, it is already on master branch and also on the issue #5454. When "monaco.editor.formatOnSave" = true, if a file is open and need to be re-format when the command "replace all" modify the file, it makes it easier to reproduce this current issue.

#5454 Performing replace-all which affects 100 files for instance will slow down the frontend until it's unusable.

It is not only because you can have a 100 modified files, you cannot save any files until you reload the front-end. You can open a new file, edit it, but never be able to save and close it. It is not because the front-end is trying to process the data.

@vince-fugnitto vince-fugnitto added search in workspace issues related to the search-in-workspace performance issues related to performance labels Sep 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance issues related to performance search in workspace issues related to the search-in-workspace
Projects
None yet
Development

No branches or pull requests

2 participants