Skip to content
This repository was archived by the owner on Apr 16, 2026. It is now read-only.
This repository was archived by the owner on Apr 16, 2026. It is now read-only.

Ruby append operator gets interpreted as the start of a string literal #5871

Closed

Description

@sorashi

Description

When using the << operator (i.e. method in Ruby) it gets highlighted as the start of a string literal when there's no space immediately after <<.
Examples:

  • array<<5 shows correctly
  • array<< variable shows correctly
  • array<<variable shows incorrect highlighting

Screenshot

image

Testing code

variable=9
array=[]
array<<5
array<<[1,2]
array<< variable
array<<variable
if variable==7
	# comment
	puts "hello"
else
	variable+=7
end
variable+=5 # end of string literal?!
array<<8

Environment

Mode: Ruby mode
Browser: Chrome 74.0.3729.131 (Official Build) (64-bit)
OS: Windows 10

Activity

  1. added a commit that references this issue on Jan 6, 2020
    4edca5f
  2. added a commit that references this issue on Jan 21, 2020
    2e3f6d4
  3. added a commit that references this issue on Sep 5, 2024
    ff40991
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