Skip to content

Syntax highlighting breaks down after declaring raw multiline text #699

Description

@Drovosek01

Checklist

  • This problem exists even with the setting "C_Cpp.enhancedColorization": "Disabled"

The code with a problem is:

#include <iostream>
#include <vector>
#include <string>
#include <mach-o/dyld.h>
#include <mach-o/nlist.h>
#include <mach-o/loader.h>
#include <sys/mman.h>
#include <mach/mach.h>
#include <cxxabi.h>
#include <libkern/OSCacheControl.h>
#include <sstream>



#define RAW_DATA_STRING X(R"(
B801000000C3
B801000000C3
B801000000C3
)")

static std::string trim(const std::string& s)
{
    size_t start = 0;
    while (start < s.size() && std::isspace((unsigned char)s[start]))
        start++;

    size_t end = s.size();
    while (end > start && std::isspace((unsigned char)s[end - 1]))
        end--;

    return s.substr(start, end - start);
}
    

It looks like:

Image

It should look like:

After a multiline text with define R"()", the syntax should be recognized correctly, but the grammar parser recognizes and highlights everything below as just text, not code.

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions