GithubHelp home page GithubHelp logo

Comments (14)

TheBinaryGuy avatar TheBinaryGuy commented on August 23, 2024 3

@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.

image

from zencodingvs.

TheBinaryGuy avatar TheBinaryGuy commented on August 23, 2024

I'm having the same issue as well. Any luck yet?

from zencodingvs.

Hrolgar avatar Hrolgar commented on August 23, 2024

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.

Hrolgar avatar Hrolgar commented on August 23, 2024

@TheBinaryGuy that did the trick!
I can't tell you how happy I am now! Cheers man!

from zencodingvs.

TheBinaryGuy avatar TheBinaryGuy commented on August 23, 2024

@Hrolgar No worries, glad it helped. 👍

from zencodingvs.

dealdiane avatar dealdiane commented on August 23, 2024

Works for me as well. What features are we missing by turning that experimental editor off?

from zencodingvs.

TheBinaryGuy avatar TheBinaryGuy commented on August 23, 2024

@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.

aryehsilver avatar aryehsilver commented on August 23, 2024

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.

johandanforth avatar johandanforth commented on August 23, 2024

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.

madskristensen avatar madskristensen commented on August 23, 2024

@johandanforth what file extension do you expect it to work on that it doesn't?

from zencodingvs.

johandanforth avatar johandanforth commented on August 23, 2024

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.

Skärmbild 2021-11-05 225409

from zencodingvs.

johandanforth avatar johandanforth commented on August 23, 2024

@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.

zencoding3 - options
.
zencoding1
zencoding2

from zencodingvs.

johandanforth avatar johandanforth commented on August 23, 2024

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.

johandanforth avatar johandanforth commented on August 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.