Skip to content

highlighting of multiline strings treats any """ as the end of the string instead of ending a multi-line string on a """ that only has whitespace proceeding it #509

@codyps

Description

@codyps

Example:

defmodule Foo do @moduledoc """ Whoops Something Bar""" @it true @doc """correct """ def baz, do: @it end 

Currently shows highlighting that indicates the moduledoc multi-line string stops at Bar""" in highlighting, but in fact it ends the line before def baz at the """ on that line.

This is probably because the syntax file is missing the ^ anchor for the end attribute:

{
"begin": "@(module|type)?doc\\s*(~s)?\"\"\"",
"comment": "@doc with interpolated heredocs",
"end": "\\s*\"\"\"",
"name": "comment.documentation.heredoc.elixir",
"patterns": [
{
"include": "#interpolated_elixir"
},
{
"include": "#escaped_char"
}
]
},

This is potentially an issue for some other cases of """, in that all the end attributes should likely have the ^ anchor to ensure the entire proceeding line is empty. It appears that only the 2 moduledoc entries are missing the ^.

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