-
Notifications
You must be signed in to change notification settings - Fork 85
Please add support for Embedded Ruby (.html.erb) #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This doesn't seem to work for me on a Rails project. A vanilla HTML project works just fine, but I don't get any suggestions when I'm on a Rails one. OS: Ubuntu 16.04 (elementaryOS Loki) Should I file a separate issue? |
@Vuneu do you have this extension installed? https://marketplace.visualstudio.com/items?itemName=rebornix.Ruby It's a requirement as stated in the README.md, because it adds Embedded Ruby language support to Visual Studio Code. Once you do so my extension will properly provide the suggestions for you. Let me know if it's something else. |
Yeah, I have that installed that's what I meant by "Ruby Extension Version: 0.14.0", sorry for not being more explicit. |
That's weird, I just tried it with a clone of the Discourse repository and it worked. I opened this file |
I cloned the repository and you're right, some suggestions do show up, but I noticed classes defined in .scss files are omitted. I guess that means sass is not supported? Anyways, even if sass is not supported I'm not defining my classes on .scss files, I'm using plain CSS. I created a brand new Rails project and copied over my CSS file, and no relevant suggestions are showing up. You can check the project here. |
Just figured out the problem, the CSS abstract syntax tree parser I'm using in the extension is not very flexible and failed to understand your .nested-fields {
display: block;
width: 100%;
/*justify-content: space-between;*/;
} As you can see there's a semicolon You can debug those issues by opening the VS Code Developer Tools and checking the log messages outputted by the extension. Here's an example of the one pointing that there was something wrong with the file mentioned above:
Sorry for any inconvenience. And about the Sass support, it's currently not supported, and unfortunately, I don't really have time to work on it right now, but there's an issue opened requesting it and contributions are welcomed. |
Thanks for your quick responses, and for pointing out the Developer Tools. I noticed the Console messages don't mention an specific line to check for the point where the parser breaks. Would I have to check manually through my code, or is there a better way? I tried running my CSS file through some CSS validators/linters but none of them mentioned the misplaced semicolon. |
No problem. :) Yup, at the time I decided to add them I did not think about it as something the users should rely on because VS Code already lints CSS files. And because if I were to show that kind of information, it would be better somewhere else with better visibility, like the "Problems" or "Output" views. I tried to do the same, and none caught the error, just like you did. It might be a bug, I just checked the package repo on GitHub, it's abandoned, and there's an issue in which a user is recommending an alternative with considerably more stars. I opened an issue #74 here so I can keep track and remember to replace the package once I have some free time. |
No description provided.
The text was updated successfully, but these errors were encountered: