Git Product home page Git Product logo

htmlcssclasscompletion's Introduction

htmlcssclasscompletion's People

Contributors

kevin-mueller avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

markz878 aycippo

htmlcssclasscompletion's Issues

Option to disable/enable refresh on save.

It would be great if there existed an option to disable or enable the "refresh on save for .html and .css". On large projects, every time I save, it takes a few seconds (5s to 10s) to refresh. During this time, visual studio is "froozen". By having this option, I can choose when I want to re-scan.

Otherwise, nice work!!

The extension is crashing Visual Studio 2022 at random points

It haunted me for awhile but then I've looked into Event Viewer and found this:

Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException
   at MoreLinq.MoreEnumerable+<>c__DisplayClass72_0+<<Flatten>g___|0>d.MoveNext()
   at System.Linq.Enumerable+WhereSelectEnumerableIterator`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
   at System.Linq.Enumerable+WhereEnumerableIterator`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
   at System.Collections.Generic.List`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]..ctor(System.Collections.Generic.IEnumerable`1<System.__Canon>)
   at System.Linq.Enumerable.ToList[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Generic.IEnumerable`1<System.__Canon>)
   at HtmlCssClassCompletion22.ElementCatalog+<>c__DisplayClass9_0+<<GetProjectPathsWithReferencesAsync>b__0>d.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
   at HtmlCssClassCompletion22.ElementCatalog+<GetProjectPathsWithReferencesAsync>d__9.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
   at HtmlCssClassCompletion22.ElementCatalog+<RefreshClassesAsync>d__8.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
   at HtmlCssClassCompletion22.HtmlCssClassCompletion22Package+<OnAfterDocumentSaved>d__2.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)

Since MoreLinq is only used by this extension I believe it's a culprit.

Update when deleting css files

I noticed, after installing the extension I don't get any suggestions any more at all (not even the few measly buggy ones).
But after SCANNING I get them all. That's nice, since VS is extremely buggy and inconsistent (I get different suggestions each time I open VS and mostly BS is missing - w/o the extension).
But I noticed, when I delete a .css file, the suggestions stick - even after re-scanning. Only after closing VS, re-open and re-scan, it's correct again.
Also, when re-naming or deleting classes inside a css file, it's the same. RE-scanning w/o closing does not remove invalidated classes from the suggestion.

Scanning gives NullReferenceException

Getting NullReferenceException when running Tools->Scan all projects for CSS classes.
Using Visual Studio 2022, full program info:

Microsoft Visual Studio Community 2022 (64-bit) - Current
Version 17.1.4

This is the exception I get:

System.NullReferenceException: Object reference not set to an instance of an object.
   at HtmlCssClassCompletion22.ElementCatalog.<>c__DisplayClass9_0.<<GetProjectPathsWithReferencesAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Threading.JoinableTask.<JoinAsync>d__76.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at HtmlCssClassCompletion22.ElementCatalog.<GetProjectPathsWithReferencesAsync>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at HtmlCssClassCompletion22.ElementCatalog.<RefreshClassesAsync>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at HtmlCssClassCompletion22.RefreshCssClassesCommand.<ExecuteAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Community.VisualStudio.Toolkit.BaseCommand.<>c__DisplayClass8_0.<<Execute>b__0>d.MoveNext()

Also saw other people having issues scanning:

Unfortunately, scanning isn't working either on startup or when I click Tools -> Scan all Projects for css classes.
I'm using VS2022 and am having Blazor app with lots of css files and it would be really appreciated if your extension worked.

Originally posted by @dev-elena in #4 (comment)

Its not Working

The Tool dosnt work in my Visual Studio with Blazor Server Projects.

When I click "Scann all Projects...." nothing happend.

Using Win 11, VS v. 17.2.6

Better Razor CSS Class Intellisense V1.13

Strange isolated css context issue

When typing the entire <class=""> attribute, the suggestion shows only the isolated classes. When setting the cursor in between of an "" of an existing <class=""> attribute, all suggestion (including the isolated ones) are shown.

Does this extension override the default extension in VS2022?

I have recently started working with Tailwind and thought it would be useful to have an extension that could display the various class names and a short description of their functionality. Does your extension override the default one used in VS2022, or could you have multiple extensions which display CSS classes from various sources?

Yours is the only example I've found that shows how to build an extension of this sort; kudos on the work you've done.

Better tooltips

The current tooltip for the css class display all the files, in which the class was found. If it's from a external file, the entire url is shown. At least remove the https:// part.

Visual Studio crashes when changing CSS class

Hi,
I'm currently having a strange behavior if the extension is active, and I want to debug an application.

When debugging a Blazor Server application in Visual Studio 2022, Visual Studio crashes and restarts every time I update a CSS class.
After disabling the extension, changing a CSS class updates the application, which is the expected behavior.

I'm currently using Visual Studio 17.2.6. Hot reload is also activated

Solution Folder Support for RCLs

Great work, just one problem I had a structure for my project with a LIB solution folder and I place all my RCL there, it wasn't until I moved the RCL to the solution itself and deleted the solution folder that the extension worked and I could see the RCL classes.

Visual Studio 2022 - no css intellisense

First, thank you so much for trying to tackle this problem of CSS intellisense in Blazor. I installed the extension, rebooted the computer. The css intellisense isn't showing. I tried copying a bootstrap.css file directly into wwwroot and it doesn't load. Once I saw a background task message that said something like 9,700 classes were found. Subsequent executions of the "Scan all Projects for CSS Classes" causes the background task to flicker but not actually run and no results are shown in the background task status message. I even tried deleting the .vs folder with no luck.

This is a NET6 Blazor Server project using the extensions installed from the Visual Studio Marketplace (1.14.1). Other text processor extensions (like rainbow braces and file icons) are working just fine as is intellisense for everything but css.

Is there any way to force the scan to actually run or verify that it ran?

This screenshot shows a css file that should be picked up:

2022-09-07_15-50-12

Cache CSS Variables for CSS Isolation Files

When writing CSS for Blazor CSS Isolation there is no Intellisense for CSS Variables declared in outside CSS Files. For example, I have my global style colors defined in variables under :root stored under a wwwroot folder within a Razor Class Library. I have the stylesheet linked in my index.html file as usual. However, when declaring colors with var(). There is no Intellisense. I would love to see a feature that searches the entire project for CSS variables and cache them for use in CSS isolation files.

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.