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.

1.17.0 "Emmet: Expand Abbreviation" no longer working in cshtml files

See original GitHub issue

Environment data

dotnet --info output: .NET Core SDK (reflecting any global.json): Version: 2.1.403 Commit: 04e15494b6

Runtime Environment: OS Name: Windows OS Version: 10.0.17134 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\2.1.403\

Host (useful for support): Version: 2.1.5 Commit: 290303f510

.NET Core SDKs installed: 1.1.10 [C:\Program Files\dotnet\sdk] 2.1.202 [C:\Program Files\dotnet\sdk] 2.1.302 [C:\Program Files\dotnet\sdk] 2.1.400 [C:\Program Files\dotnet\sdk] 2.1.401 [C:\Program Files\dotnet\sdk] 2.1.402 [C:\Program Files\dotnet\sdk] 2.1.403 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 1.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 1.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.3-servicing-26724-03 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download

VS Code version: 1.28.2 (user setup) C# Extension version: 1.17.0

Steps to reproduce

  1. Make sure the following setting is present: “emmet.includeLanguages”: { “razor”: “html” },
  2. Try typing “div” and hit tab

Expected behavior

div is replaced by <div></div>

Actual behavior

no replacement occurs

Remarks

The setting “razor.disabled”: true did not restore functionality, but disabling the extension altogether did restore functionality.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
nicknguyencommented, Feb 28, 2019

Did you mean to suggest changing “emmet.includeLanguages”: { “razor”: “html” } to “emmet.includeLanguages”: { “aspnetcorerazor”: “html” } as a fix? Because it kind of worked! Emmet expansion for tags, such as div and span has its functionality restored. However, emmet espansion for “.alert”, which is expected to expand to <div class="alert"></div> does not have its functionality restored. It works in html, but not in cshtml. Is there some work-around where I can continue to have 1.17 installed and just give up its new cshtml functionality in favor of the previous emmet functionality? In any case, I will file this in the place you suggested.

It is very annoying because I am using . for classes a lot. Any idea, how to make it work?

This works for me as a workaround using version 1.32.0-insider:

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

This issue still exists in this nightly build.

4reactions
cda-1commented, Nov 1, 2018

Did you mean to suggest changing

“emmet.includeLanguages”: { “razor”: “html” }

to

“emmet.includeLanguages”: { “aspnetcorerazor”: “html” }

as a fix? Because it kind of worked!

Emmet expansion for tags, such as div and span has its functionality restored. However, emmet espansion for “.alert”, which is expected to expand to <div class="alert"></div> does not have its functionality restored. It works in html, but not in cshtml.

Is there some work-around where I can continue to have 1.17 installed and just give up its new cshtml functionality in favor of the previous emmet functionality?

In any case, I will file this in the place you suggested.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can Visual Studio Code use Emmet completion in razor ...
My issue is that Emmet works correctly in HTML files, but will not work in razor CSHTML files. I've found: To enable the...
Read more >
Emmet in Visual Studio Code
To enable the Emmet abbreviation expansion in file types where it is not available by default, use the emmet.includeLanguages setting. Make sure to...
Read more >
VS Code tips — Enable emmet abbreviations in any language ...
Like using Emmet abbreviations in VS Code for html or css? You can enable them in other languages with " emmet.includeLanguages" setting.
Read more >
Emmet not working in VS Code ?— Here's how you can fix this ...
Step 5: Save the file. Now if you try to apply Emmet in your code, it will work smoothly!! That's how I fixed...
Read more >
Emmet - Package Control
Most likely, you've updated Tab key handler for expand_abbreviation_by_tab action from Emmet v1 in your key bindings file: simply remove it, it no...
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