Closed jiyuhan closed 5 years ago
@lostintangent @rdoubleui @line-o @waderyan can someone take a look at this issue? It seems very consistent, and it crashes the whole plugin.
Can you share what your editor.tabSize
setting is?
Assuming the tabSize setting is a valid positive integer, there may be some invalid or otherwise unexpected syntax in the XML file causing the indentLevel to fall below 0. Here is the line throwing the error:
return ((options.editorOptions.insertSpaces) ? " ".repeat(options.editorOptions.tabSize) : "\t").repeat(indentLevel);
If you can share a copy of the XML being formatted, I can probably narrow it down to what the formatter is choking on. I should have time later this evening to take a look.
@DotJoshJohnson Do you have an email I can send the file to? It's a pretty big file.
I had the same issue. Here's an example that triggers this:
<?xml version="1.0" encoding="UTF-8"?>
<test1>
TEST <test2>aaa</test2>
</test1>
or a more realistic example:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="UTF-8" indent="yes" />
<xsl:template match="/">
<file>
<xsl:apply-templates />
</file>
</xsl:template>
<xsl:template match="*">
<xsl:message terminate="no">
WARNING: Unmatched element: <xsl:value-of select="name()"/>
</xsl:message>
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Is there anyone working on this issue?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue is being automatically closed because it has not had recent activity. Thank you for your contributions.
Has there been any investigation in to this issue? Since this one was automatically closed by a bot should a new issue be opened instead? There is a very simple example of how to reproduce this issue in comment https://github.com/DotJoshJohnson/vscode-xml/issues/257#issuecomment-462768486.
I've just had this too; going to uninstall.
I'm still seeing this error.
Come on. Please fix it
Version 1.34.0 (1.34.0) mac os
I am seeing this issue as well. VS Code - 1.34.0 Win 10 Pro
Same error, different traceback
at String.repeat (<anonymous>)
at V2XmlFormatter._getIndent (/home/vojd/.vscode-oss/extensions/dotjoshjohnson.xml-2.5.0/out/formatting/formatters/v2-xml-formatter.js:208:106)
at V2XmlFormatter.formatXml (/home/vojd/.vscode-oss/extensions/dotjoshjohnson.xml-2.5.0/out/formatting/formatters/v2-xml-formatter.js:169:39)
at XmlFormattingEditProvider.provideDocumentRangeFormattingEdits (/home/vojd/.vscode-oss/extensions/dotjoshjohnson.xml-2.5.0/out/formatting/xml-formatting-edit-provider.js:39:41)
at XmlFormattingEditProvider.provideDocumentFormattingEdits (/home/vojd/.vscode-oss/extensions/dotjoshjohnson.xml-2.5.0/out/formatting/xml-formatting-edit-provider.js:12:21)
at define.provideDocumentFormattingEdits.o.asPromise (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:555:286)
at t.asPromise.Promise (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:55:720)
at new Promise (<anonymous>)
at Object.t.asPromise (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:55:692)
at P.provideDocumentFormattingEdits (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:555:257)
at define.$provideDocumentFormattingEdits._withAdapter.e (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:570:430)
at W._withAdapter (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:565:723)
at W.$provideDocumentFormattingEdits (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:570:408)
at d._doInvokeHandler (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:623:396)
at d._invokeHandler (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:623:88)
at d._receiveRequest (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:621:730)
at d._receiveOneMessage (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:620:605)
at define.constructor._protocol.onMessage.e (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:618:791)
at u.fire (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:50:207)
at v.fire (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:186:579)
at i.constructor.e.onMessage.e (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:783:484)
at u.fire (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:50:207)
at v.fire (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:186:579)
at x._receiveMessage (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:191:17)
at define.constructor._socketDisposables.push._socketReader.onMessage.e (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:188:116)
at u.fire (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:50:207)
at f.acceptChunk (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:184:17)
at define.constructor._register._socket.onData.e (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:183:372)
at Socket.t (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:192:491)
at Socket.emit (events.js:182:13)
at addChunk (_stream_readable.js:283:12)
at readableAddChunk (_stream_readable.js:264:11)
at Socket.Readable.push (_stream_readable.js:219:10)
at Pipe.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
vscode, about:
Version: 1.38.1
Commit: b37e54c98e1a74ba89e03073e5a3761284e3ffb0
Date: 2019-09-16T10:22:16.623Z
Electron: 4.2.11
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Linux x64 4.19.79-1-MANJARO
uname -a
Linux vojd-pc 4.19.79-1-MANJARO #1 SMP PREEMPT Fri Oct 11 19:57:09 UTC 2019 x86_64 GNU/Linux
Just had this too. Nothing helps
uninstalling DotJoshJohnson formatter
Same problem here. Please re-open.
Description
When I was formatting an xml using
ALT + SHIFT + F
, it stops responding. Nothing, no errors being thrown out as a pop-up.Screenshots VS Code Output - Extension Host
Extension Version
v2.4.0
I believeVS Code Version
1.30.2
Operating System
Windows 10
Additional Information
file name:
Spring.Data.xml
file length: 10922 lines