Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle speech-mark at end of raw string #26

Open
peterfry opened this issue Jul 12, 2018 · 2 comments
Open

Handle speech-mark at end of raw string #26

peterfry opened this issue Jul 12, 2018 · 2 comments

Comments

@peterfry
Copy link

peterfry commented Jul 12, 2018

I noticed that syntax highlighting breaks if you have a speech-mark at the end of your raw string. e.g.

test = """"foo""""

Any subsequent lines will be highlighted as string content.

If there's a space between the speech-mark and the closing triple-speech-marks, it works fine. e.g.

test = """"foo" """

It also works if there are two speech marks. e.g.

test = """"foo"""""

I suspect as soon as it sees the first three speech-marks at the end, it ends the string literal. The fourth speech-mark then incorrectly begins a new string literal.

@htonheim
Copy link

htonheim commented Aug 23, 2018

Seeing the same issue in a build file from TeamCity. IntelliJ IDEA parses it ok, but in VS Code the lower half of the .kts file is considered a comment. Or rather, the code is considered comments and the comments are considered code.

Happens on this bit of code:

features {
    feature {
        type = "JetBrains.AssemblyInfo"
        param("file-format", "%system.build.number%")
    }
    swabra {
        filesCleanup = Swabra.FilesCleanup.DISABLED
        lockingProcesses = Swabra.LockingProcessPolicy.KILL
    }
    replaceContent {
        fileRules = "**/*.edmx"
        pattern = """ProviderManifestToken=\".{4,6}\""""
        replacement = """ProviderManifestToken="2008""""
    }
}

requirements {
    exists("DotNetFramework4.7_x64")
}

In the line pattern = """ProviderManifestToken=\".{4,6}\"""" the backslashes are treated as escape characters, which they are not since this is a raw string. This however stops the plugin form treating everything after this as a comment. On the next line however, there is no backslashes and the last four quotation marks makes the plugin treat everything afterwards as a comment.

kotlinpluginissue

@nishtahir
Copy link
Collaborator

Oh that shouldn't be happening 🤔. I'll look into this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants