eclipse-theia / theia

Eclipse Theia is a cloud & desktop IDE framework implemented in TypeScript.
http://theia-ide.org
Eclipse Public License 2.0
20.11k stars 2.5k forks source link

[plugin] onWillSave callback never resolves #4463

Closed akosyakov closed 5 years ago

akosyakov commented 5 years ago

Saving exp is very slow with https://marketplace.visualstudio.com/items?itemName=ms-vscode.Go and https://github.com/demo-apps/go-gin-app repo

Also auto formatting on save does not work always, but fails with

root ERROR Error: onWillSave listener loop timeout
    at https://3000-d776232d-4e50-43fd-b267-1d7ef7c1bf5d.ws-eu0.gitpod.io/19.bundle.js:807:36
lmcbout commented 5 years ago

I also see the same loop timeout when saving a file with the extension ".go" . I am testing on ubuntu.

akosyakov commented 5 years ago

@lmcbout please file issues for any quirky behaviour :)

akosyakov commented 5 years ago

in VS Code saving is slow as well, about 3s but formatting is applied

marcdumais-work commented 5 years ago

@akosyakov

Maybe related: ~1 year ago Simon made some performance-enhancing change to our fork of go-language-server, that's used in the Theia go extension: https://github.com/theia-ide/go-language-server/pull/20

IIUC the MS version of this LS would include multiple unwarranted references to the source file in (some) LS responses, that would get expanded to the full content of the file being edited. This would generate a lot of load and make the whole application seem slow.

akosyakov commented 5 years ago

@marechal-p I remember that we introduced timeout for the whole save operation. I don't see such in VS Code. I can find only formatOnSaveTimeout timeout. Do I miss something? I want to align it, otherwise go never manages to fit in our timeout.

akosyakov commented 5 years ago

@marcdumais-work go VS Code extension does not use LS, but relies on some binaries which can be slow

akosyakov commented 5 years ago

@marechal-p I will remove the general timeout and introduce a timeout per a save participant similar to VS Code:

paul-marechal commented 5 years ago

@akosyakov sounds good to me.

akosyakov commented 5 years ago

The error actually is not related to go, but general issue with onWillSave event in the plugin system. It just does not seem to resolve ever.

Go works properly, it should auto format only on the manual save. It's the same in VS Code.