Comments (14)
@Hrolgar Yes actually. In my case it was the experimental Razor editor that was causing the problem, so if you have that on, try turning it off, restart VS and see if that fixes it.
from zencodingvs.
I'm having the same issue as well. Any luck yet?
from zencodingvs.
Is there any fix for this yet? I've had to go from VSCode to VS19 for work purposes. Hard to live without emmet. This extension seems like it would do the trick for me.
from zencodingvs.
@TheBinaryGuy that did the trick!
I can't tell you how happy I am now! Cheers man!
from zencodingvs.
@Hrolgar No worries, glad it helped.
from zencodingvs.
Works for me as well. What features are we missing by turning that experimental editor off?
from zencodingvs.
@dealdiane I haven't looked into the new editor as much, I only occasionally use Razor nowadays. But here's a blog post from Microsoft if you want to read more about it: https://devblogs.microsoft.com/aspnet/improvements-to-the-new-razor-editor-in-visual-studio/
from zencodingvs.
I have it turned off already but it still doesn't work.
Edit:
I realised it was due to being inside a razor code block as in this issue #7 outside a block works as expected.
from zencodingvs.
Also not working in VS2022 (Preview 7.0), even if the language server option is enabled. Seems to work for pure html files sometimes, but also krasches VS totally sometimes.
from zencodingvs.
@johandanforth what file extension do you expect it to work on that it doesn't?
from zencodingvs.
Hej @madskristensen . I tried it on a .cshtml file in the ~/Views/Home/ directory of a vanilla .net 6 MVC project. Nothing happens. Also tried "tabbing" inside and outside div elements. Nothing.
Then I created a new .html file, and there it worked. I tried to enable the experimental setting for html/css language service, but there was no change. But after enabling that option, VS2022 froze and crashed when I tried a simple "div-tab" in the html-file. Actually something is not fully alright with the extension, Vs freeze/die/restart a couple of times now that I try it some more. I've just forked the code and trying to figure out what's happening with the razor pages not working.
from zencodingvs.
@madskristensen I got a little longer. I went into tools->options->text editor->Html->Advanced and selected to "Use legacy Razor editor for ASP.NET Core" and restarted. Now ZenCoding kicks in, expands a simple "div" or whatever, but then it crashes, every time (se uploaded images). When using the "new" razor editor (whatever that is), it seems it is of another ContentType than "HTMLX", right? I don't know anything about these things really, but to create a IVsTextViewCreationListener you have to specify the ContenType for the specific kind of "page editor" with something like:
[Export(typeof(IVsTextViewCreationListener))]
[ContentType("HTML")]
[ContentType("HTMLX")]
[TextViewRole(PredefinedTextViewRoles.Document)]
public class CommandRegistration : IVsTextViewCreationListener
{
//... and so on
}
but the ExpandCommand in ZenCodingVS is never executing for razor pages in ASP.NET Core in VS2022.
from zencodingvs.
Adding the "RAZOR" content type to the CommandRegistration
class got ZenCoding working, but it crashes and restarts eventually for no reason. Guess one have to look at activity logs or such, which I'm not familiar with.
namespace ZenCodingVS
{
[Export(typeof(IVsTextViewCreationListener))]
[ContentType("HTML")]
[ContentType("HTMLX")]
[ContentType("RAZOR")]
[TextViewRole(PredefinedTextViewRoles.Document)]
public class CommandRegistration : IVsTextViewCreationListener
{
[Import]
public IVsEditorAdaptersFactoryService EditorAdaptersFactoryService { get; set; }
from zencodingvs.
I ran devenv.exe with logging, and got an activity log for you @madskristensen if it may help you.
activitylog.zip
from zencodingvs.
Related Issues (20)
- Tab competing class(#) or id(.) with name of tags doesn't work properly. HOT 3
- IntelliSense implementation as a proposal
- Expanding inputs whit type doesn't work whell with repetitions
- Unable to find settings in Tools -> Options
- Does not install on vstudio code 1.49.2
- Visual Studio 2022 Support HOT 2
- VS 2019 Crashes out on tab HOT 2
- Does not work in Visual Studio 2022 HOT 7
- Latest update causing VS crashes when attempting to use ZenCoding HOT 4
- Undo Command - (Ctrl + Z) Doesn't work after using ZenCoding "syntax" (like emmet) HOT 1
- Does not expand some valid input HOT 4
- Extension cannot be installed on VS2017 HOT 2
- Typing #jim>a{test $} starts debugging
- Typing #jim>span produces #jim><span></span>
- ZenCoding extension does not work with visual studio 2017 anymore. HOT 4
- ZenCoding with .js files
- Extension doesn't work inside a razor code block HOT 1
- Support .tsx files HOT 1
- `tr>th` works incorrectly HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zencodingvs.