redhat-developer / vscode-xml

Editing XML in Visual Studio Code made easy
Eclipse Public License 2.0
261 stars 82 forks source link

Large XML Files crash language server #696

Open lunarwtr opened 2 years ago

lunarwtr commented 2 years ago

I would like to see the vscode extension have a configuration to prevent loading & subsequently crashing due to large xml files. If a file is greater than a defaulted size.. don't try to send to language server and show a message perhaps show a vscode notification as to why.

angelozerr commented 2 years ago

If a file is greater than a defaulted size.. don't try to send to language server and show a message perhaps show a vscode notification as to why.

This feature should be part in vscode-languageclient https://github.com/microsoft/vscode-languageserver-node I think.

angelozerr commented 2 years ago

@lunarwtr could you share your big XML please.

lunarwtr commented 2 years ago

https://github.com/LotroCompanion/lotro-data/blob/master/quests/quests.xml

lunarwtr commented 2 years ago

I don't expect it to provide language support on a file so big.. I'd expect language server to bail out since a limit has been reached. Instead it crashes and won't relaunch until vscode restarted.

angelozerr commented 2 years ago

I don't expect it to provide language support on a file so big.. I'd expect language server to bail out since a limit has been reached. Instead it crashes and won't relaunch until vscode restarted.

I can open it without crash and outline is filled too. Are you editing (type some content) this file to crash the language server?

lunarwtr commented 2 years ago

crashes immediately on loading file. Ensure you haven't' customized language server settings (i.e. greater memory etc.) Just default settings upon extension install.

image

fbricon commented 2 years ago

Yeah I see the same JVM crash, when Lemminx runs in the JVM. If you set "xml.server.preferBinary": true in your settings.json, the binary will start, complain about outline limited to 5000 items, but completion/validation will work, albeit pretty slowly.

angelozerr commented 2 years ago

Please note that next release should improve memory.