gencer / SCSS-Everywhere

A Visual Studio Code extension that provides CSS class and ID atttribute completion with incremental build and usage explorer for the HTML class attribute based on the CSS/Template files in your workspace. Also supports React's className attribute.
https://marketplace.visualstudio.com/items?itemName=gencer.html-slim-scss-css-class-completion
MIT License
24 stars 9 forks source link

html.erb issue? #29

Closed sndrs closed 5 years ago

sndrs commented 5 years ago

I have a workspace setting for "html-css-class-completion.includeGlobPattern": "dist/framework.css". that file definitely exists, and the extension seems happy it's indexed everything

image

but no classes ever come up in html.erb files...

Kapture 2019-04-03 at 12 46 18

I'm sure I'm doing something stupid but I can't think what! any ideas? would you expect this to work?

gencer commented 5 years ago

Hey Alex, I couldn't reproduce this issue. Can you just use this:

"html-css-class-completion.includeGlobPattern": "**/*.{css,scss,sass,slim,latte,html,twig,php,erb}",

With above config, is it working?

image

Above sample used this config:

"html-css-class-completion.includeGlobPattern": "dist/bootstrap.min.css",

Could you send me the erb, css and settings.json file?

If you want send them to gencer@nienbo.co.uk so they stay hidden here.

gencer commented 5 years ago

BTW, which extension do you use for highlighting erb files?

sndrs commented 5 years ago

hi gencer, thanks for having a look!

I've just done as you did, put together a very simple project with one erb file and the exact same css file I'm hoping to load:

{
    "html-css-class-completion.includeGlobPattern": "dist/styles.css"
}
image

everything worked as you'd expect.

however, comparing the output in dev tools, the simple project reported:

[Extension Host]% 1 parseable documents found
console.ts:134 [Extension Host]% 1846 CSS class definitions found
console.ts:134 [Extension Host]% 857 unique CSS class definitions found
console.ts:134 [Extension Host]% 0 failed attempts to parse. List of the documents:

while the original one that's not working reports

[Extension Host]% 1 parseable documents found
console.ts:134 [Extension Host]% 35087 CSS class definitions found
console.ts:134 [Extension Host]% 6853 unique CSS class definitions found
console.ts:134 [Extension Host]% 0 failed attempts to parse. List of the documents:

they're both only trying to index one file, and the file is the same both times. will see if I can get to the bottom of why...

sndrs commented 5 years ago

BTW, which extension do you use for highlighting erb files?

just the rebornix.ruby one :) theme is monokai pro

gencer commented 5 years ago

This is weird. It should result the same numbers on both cases if the files are exact same. I will investigate this difference on my end.

BTW, When you use default settings on your existing project (not the test one), does it work? Or, Only works on empty project just like above?

just the rebornix.ruby one :) theme is monokai pro

Ok. I was suspected on something else. We can eliminate this.

sndrs commented 5 years ago

default settings made no difference unfortunately. i think I first focused the globbing on to that single file because it's a big project, a lot of sass partials around and a lot of css files in dist I don't need to know about. I wonder if that makes a difference? feels as though the glob is returning extra things maybe?

it wouldn't explain what the weird thing about the main project is though... is there a way to enable more thorough debugging by any chance?

gencer commented 5 years ago

Sorry for late reply. I had a surgery. Anyway, do you see the file (css one) after this console log-line:

image

I will try to add more verbose logging to the extension.

sndrs commented 5 years ago

hi @gencer – sorry for not getting back to you, but I've just noticed it's started working as expected! I've no idea what's changed, but it has :)

gencer commented 5 years ago

hi @sndrs, I am very happy to hear that! Let me know if you encounter any other issues.