Vscode-ruby: Am I missing something or is comments for .erb files not supported?

Created on 30 Jan 2018  路  5Comments  路  Source: rubyide/vscode-ruby

  • vscode-ruby version: 0.16.0
  • Ruby version: 2.4.2
  • VS Code version: 1.19.2
  • Operating System: Ubuntu
  • Hardware (optional):

Expected behavior

ctrl+shift+7 should outcomment lines in .erb files (<%# %>)

Actual behavior

ctrl+shift+7 outcomments lines in .erb files by prepending '#'

Steps to reproduce the problem

Open a html.erb file, select a line, use the 'commentLine' command by default bound to ctrl+shift+7

Most helpful comment

Well I was wrong. Apparently it was a pretty straightforward change to package.json. #260 addresses this.

All 5 comments

Reproduced on Windows 10 Pro version 1709 build 16299.192
VSCode version 1.19.3
rebornix.ruby version 0.16.0
Ruby version 2.4.2p198

My default binding is not Ctrl+Shift+7, rather it's Ctrl+/, but this does indeed insert a # rather than a <%# %>. Same behaviour when selecting text to comment it. I suspect this has to do with the (mostly) broken grammar detection in 0.16.0.

Nope, not the grammar. The grammars control the highlighting. The language configuration defines things like comments.

224 changed the ERB comment style.

Ah, of course. Can the language configuration be modified to distinguish between making a comment within an ERB escaped area and without?

I'm guessing not since the language config is loaded based on the detected language for the source file. We'd probably have to do something custom to support that use case. This is just off the top of my head, though.

Well I was wrong. Apparently it was a pretty straightforward change to package.json. #260 addresses this.

Was this page helpful?
0 / 5 - 0 ratings