karuna / haml-vscode Goto Github PK
View Code? Open in Web Editor NEWThis project forked from groksrc/ruby_haml_for_vscode
Adds support for Ruby Haml colorization to Visual Studio Code
License: MIT License
This project forked from groksrc/ruby_haml_for_vscode
Adds support for Ruby Haml colorization to Visual Studio Code
License: MIT License
Thanks for the extension. Our team is benefiting tremendously from your hard work!
Should we implement completion? Something simple like "complete based on all words in the current file" would be easy to do, I think. Want a hand?
The following is valid HAML:
:ruby
my_var = "blah"
# No spaces on the below line
another_var = "blarg"
%div
Of course in this limited example, that extra line between my_var
and another_var
seems superfluous. But for larger blocks of Ruby (or other code), it makes sense to break up bits of the code. Ideally, I'm not putting large blocks of Ruby in the middle of my HAML, but โฆ sometimes it must be done.
Anyway: the current configuration treats that empty line as the end of the :ruby
block, and the following lines are just rendered in white text:
If I were to add indentation (in this case, two spaces, to match the other lines), it would behave as expected:
But my code editor and my Rubocop config both don't like that โ the former automatically removes trailing whitespace; the latter complains if I manage to include it.
tl;dr: If I have an empty line without indentation between lines in a :filter
block, I expect code coloring to continue to the next line (second screenshot above); I experience white text instead (first screenshot)
Well it looks like Haml now has proper multiline attributes support. https://github.com/haml/haml/releases/tag/5.2.1
Just giving you a heads up as it would be great to get support for these into the extension. Thanks!
What we will now be able to write:
.messages-overflow-container{"data-simplebar": true}
.messages{
data: { controller: "chat-messages" }
}
.like-notification{
data: { controller: "reaction-notification" } }
- unless video.finished?
.message-write{
data: {
"controller": "chat",
"show-when-logged-in": true
}
}
.chat-controls
.write-area{
placeholder: 'Send a message',
contenteditable: true,
role: "textbox",
data: {
action: "keydown->chat#chatBoxKeyDown",
target: "chat.messageInput"
}
}
= render "shared/reaction_button"
.message-login-prompt{data: { "show-when-logged-out": true }}
%button{
data: {
action: "authentication#showModal"
}
} Login To Chat
Same as #3 but for :javascript
E.g.
Ok
var myVar = #{@var_a.fetch(:var_b)};
Not ok
var myVar = #{@var_a.fetch('var_b')};
Not ok
var myVar = #{@var_a.fetch("var_b")};
Right now if there's a :ruby
code block in the haml partial, it doesn't have the proper code highlighting. I imagine this is a broader issue with any other code inserts, but it works with :javascript
blocks.
This might be a shot in the dark, but after a recent (Feb 1st 2018) VS Code update (I'm now running Version 1.19.3 (1.19.3)
), enabling the Better HAML extension causes a terrible slowdown during editing. I'm seeing crazy latency when typing (> 1 second per character). It's made this extension impossible to use.
Strangely, I experience the slowdown only when editing non-haml files (e.g. .rb
). I don't experience the slowdown when editing HAML files.
Enabling/disabling the extension also fixes/causes the slowdown I'm experiences. So maybe it's a dependency of Better HAML that's to blame? I figured I'd start here though.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.