Darkyenus / glsl4idea

A GLSL language plugin for IntelliJ IDEA
GNU Lesser General Public License v3.0
101 stars 30 forks source link

Support for including glsl file as C++ R string literal #156

Closed jaw closed 4 years ago

jaw commented 4 years ago

Since C++ 11 it's possible to include a text file directly into a C++ multi line string literal like so:

C++:

constexpr const char shader_source[] =
  #include "shaders/shader.glsl"
;

shader.glsl:

R"str_end(
#version 430
... many lines of code without \n or " around them ...
)str_end"

Notes

What happens now?

The GLSL plugin marks the first and last lines as an error. Otherwise it syntax highlights the file correctly.

What do I want?

Not to have the error validator consider these as part of the code if present.

Should be easy to implement and help me a LOT! Thanks.

Darkyenus commented 4 years ago

This is technically a CLion issue - str_end is not a real part of the string, it is just a string syntax.

Please see CPP-12647 instead.