You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The initial indent feature introduced in version 0.40.2 includes the ability to be turned off with using the setting "volar.format.initialIndent". However, this setting is only effective when formatting an entire document. While typing code, the setting is ignored.
The result is that unnecessary indents are added to new lines while typing.
Link to details of original suggested feature and development: #1806
Demo of this problem occurring in version 0.40.13:
The text was updated successfully, but these errors were encountered:
michaeldaw
changed the title
The setting "" is ignored in script setup files
The setting volar.format.initialIndent is ignored in script setup files
Sep 8, 2022
From what I can tell through experimentation, the indentation rules in the file vue-language-configuration.json introduced in 0.40.2 result in the situation where an extra indent is added after a line that includes < and >, which means a line in the script setup section like the following will get an unwanted indent on the next line:
const variable = ref<number>(0);
or
const variable: Array<string> = [];
etc.
The user probably wouldn't see this unless using Typescript.
You can see this happen at the end of the gif I uploaded in the original post at the very end.
Removing the "increaseIndentPattern" line in that file restores the original functionality, but of course ruins whatever functionality this line is meant to provide. I'm afraid I'm not well enough versed in Regex to know how to specifically modify that pattern to stop this extra indent from happening while retaining the intended indent rules for HTML.
The initial indent feature introduced in version 0.40.2 includes the ability to be turned off with using the setting "volar.format.initialIndent". However, this setting is only effective when formatting an entire document. While typing code, the setting is ignored.
The result is that unnecessary indents are added to new lines while typing.
Link to details of original suggested feature and development: #1806
Demo of this problem occurring in version 0.40.13:
The text was updated successfully, but these errors were encountered: