question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add settings to allow initial indentation for script and style

See original GitHub issue

Volar uses the VS Code settings for indentation of code, but it doesn’t put an initial indent in for the script or style tags in vue files. Could you add in a couple of settings that allows us to have that indent? I know the Vue default style may not have it, but to my eyes it looks horrible having opening and close tags with no indent. I’d like to have the indent option for auto-formatting.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:16 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
michaeldawcommented, Sep 8, 2022

Yes, formatting the document after the fact removes the indentation, but having to type “enter + backspace” every time the user would have normally just had to type “enter” harms productivity.

This feature isn’t complete as long as this bug exists, so I thought it would be better to detail the problem here rather than create a new issue. But I’ll open a new issue if that’s appropriate.

0reactions
jez9999commented, Sep 8, 2022

I think if you select all and format selection it will remove the indentation. The specific bug seems to be the indentation given when you hit Enter, which does seem to give indentation if these are set to false. Perhaps worth opening an issue on that specific behaviour?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add settings to allow initial indentation for script and style
The issue is that VS2022 indents the script tag in the .vue files since it just sees it as an XML/HTML file and...
Read more >
Indent script and style tags content in *.vue files · Issue #3888
"auto" - Avoid top-level indent for scripts and styles inside Vue files. This is the default value and reflects current behavior.
Read more >
Indent the second line in Word
Setting an Indent style · Select the text where you want to add a hanging indent. · Go to Home > Paragraph dialog...
Read more >
How to change indentation in Visual Studio Code?
Edit 1 · Step 1: Click on Preferences > Settings · Step 2: The setting you are looking for is "Detect Indentation", begin...
Read more >
Code Style. JavaScript | IntelliJ IDEA Documentation
File | Settings | Editor | Code Style | JavaScript for Windows and Linux ... Configure or accept default prefixes that will be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found