GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Heredoc after comment not highlighted · Issue #422 · vim-ruby/vim-ruby

Heredoc after comment not highlighted #422

New issue
Copy link
New issue
Copy link
Open
Open
Heredoc after comment not highlighted#422
Copy link

Description

@biinari
biinari
opened on Aug 1, 2020
Issue body actions

A heredoc following a comment that ends with a full-stop . is not highlighted properly.

    let(:source) do
      # Empty lines should make no difference.
      <<~RUBY
        if #{condition}
          #{body}

        end
      RUBY
    end

vim-ruby_heredoc_after_comment_2020-08-02_00-37-28

Removing the full-stop . at the end of the comment allows the heredoc to be highlighted as expected:

vim-ruby_heredoc_after_comment-no_fullstop_2020-08-02_00-38-26

Unfortunately, I can't think of a way to fix this in a well-performing manner as I think it would require look-behind assertions to check if the preceding dot is part of a comment.

Activity

  1. AndrewRadev commented on Aug 3, 2020

    @AndrewRadev
    AndrewRadev
    on Aug 3, 2020
    Member
    More actions

    Damn, that's a good catch. Unfortunately, I have no idea how to fix it.

    To provide an explanation for the next reader, the problem is that we already do negative lookbehind to figure out if this is really a heredoc. Here's one example of something that is not a heredoc:

    FOO = "bar"
    result = [].<<FOO

    And so we have a regex that checks that we don't have . (among other things) before the heredoc. Unfortunately, I don't know of any way to avoid this for comments. Maybe Doug Kearns will think of something, but I think this will likely have to be left as an open isssue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.