Skip to content

Syntax highlighting issue when using plugin.lua #1949

Open
@eigenbom

Description

@eigenbom

How are you using the lua-language-server?

Visual Studio Code Extension (sumneko.lua)

Which OS are you using?

Windows

What is the issue affecting?

Formatting, Plugins

Expected Behaviour

Syntax colouring should be preserved when using plugin.lua transformations

Actual Behaviour

I'm having an issue with syntax colouring when using plugin.lua, note the colour of the inline any annotation.

image

Reproduction steps

plugin.lua:

function OnSetText(uri, text)
    if uri == "file:///c%3A/dev/test/annotation_test/any.lua" then
        return {{
            start = 15,
            finish = 18,
            text = " --[[@type any]]"
        }}
 end

Source file (note the new line)

local anything:any
-- new line --

Additional Notes

No response

Log File

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Info NeededMore information is requiredbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions