Aspnetcore: With C# 1.17.0 installed, "Emmet: Expand Abbreviation" no longer working in cshtml files

Created on 1 Nov 2018  路  3Comments  路  Source: dotnet/aspnetcore

Is this a Bug or Feature request?:

Bug

Steps to reproduce

  1. Make sure the following setting is present:
    "emmet.includeLanguages": {
    "razor": "html"
    },
  2. Open a .cshtml file
  3. Try typing "div" and hit tab

Description of the problem:

Expected behavior:
div is replaced by <div></div>

Actual behavior:
no replacement occurs

Additional information

If the setting:

"emmet.includeLanguages": {
"razor": "html"
}

is changed to:

"emmet.includeLanguages": {
"aspnetcorerazor": "html"
}

partial functionality is restored.

div expands to <div></div>, but
.alert does not expand to <div class="alert"></div> as expected.

Each of these expansions works correctly in a pure html file.

Please also provide the following to help debug the issue:

(I omitted these items because I don't think they are applicable)

area-razor.tooling bug investigate

All 3 comments

I made a Blazor VS Code Snippets extension. When I use the language as razor it doesn't work with the C# extension installed. When I use aspnetcorerazor, it does work. Should I be using aspnetcorerazor?

@scottsauber The aspnetcorerazor language identifier is the lang ID added by the latest 1.17 C# extension. It replaces the default Razor support from Microsoft.VSCode. This'll change in the future when we change the Microsoft/vscode to have more of the goods in this repo.

So, the answer is: Your extension should probably apply to both Razor and aspnetcorerazor so it works in both scenarios.

Awesome thanks @NTaylorMullen!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ermithun picture ermithun  路  3Comments

guardrex picture guardrex  路  3Comments

githubgitgit picture githubgitgit  路  3Comments

farhadibehnam picture farhadibehnam  路  3Comments

markrendle picture markrendle  路  3Comments