【问题标题】:How to wrap html attributes in Visual Studio?如何在 Visual Studio 中包装 html 属性?
【发布时间】:2021-04-13 12:12:02
【问题描述】:

与在带有 html.format.wrapAttributes = "auto" 的 Visual Studio Code 中一样,我想在保存时自动包装每行的 html 属性。

例如,这个:

<div class="mt-1">
  <span class="form-alert-label" *ngIf="displayMessage.address">
    {{displayMessage.address | translate}}
  </span>
</div>

会变成:

<div class="mt-1">
  <span class="form-alert-label" 
        *ngIf="displayMessage.address">
    {{displayMessage.address | translate}}
  </span>
</div>

我猜这不是 Visual Studio 中内置的东西,但可能有一个扩展可以做到这一点,有什么建议吗?

【问题讨论】:

    标签: visual-studio visual-studio-2019 visual-studio-extensions


    【解决方案1】:

    也许Resharper Extension 可以实现您的需求。但它是付费扩展,新用户可以免费使用 30 天。

    显示it could wrap HTML attributes from this link

    如果这不符合您的要求,您应该suggest your idea to the DC Forum

    【讨论】:

    • 感谢您的回答。太糟糕了,这个版本在 VS Code 中可用,但在 VS 中不可用。我正在寻找一个免费的选项,但谢谢:)。我向论坛发送了一个请求。
    • 其实,we cannot get this so far and cannot get any tips currently and I suggest you could accept this answer to tell other community members this is s feature request。您可以在此处分享请求,以便任何对它感兴趣的人(包括我们)对其进行投票,从而引起 Microsoft 的更多关注,帮助您尽快获得想要的东西。
    • 这里是想要关注状态的人的链接:developercommunity2.visualstudio.com/t/…
    • @CedricArnould,我已经为你的票投了票,希望它能引起微软的更多关注。由于这些是我们所能做的,您可以标记此答案以提供正确的指导。在此先感谢,祝您有美好的一天!
    猜你喜欢
    • 2010-09-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-06-15
    • 1970-01-01
    相关资源
    最近更新 更多