LoginSignup
1
0

いつの間にかVSCodeのC++のsyntax highlightがraw string literalの中のSQLのsyntax highlightに対応してた話

Last updated at Posted at 2024-05-21

現象

image.png

図のように、明らかにC++のコードの中にraw string literal(生文字列リテラル)でSQLを書いたら、SQLとしてsyntax highlightされた。

なにを手がかりにsyntax highlighしているか

生文字列リテラルは、以下の構文を持つ:

encoding-prefix R"d-char-sequence opt (r-char-sequence opt) d-char-sequence opt"

ためしにd-char-sequenceをSQL以外にしたらこう。

image.png

どうもd-char-sequenceを手がかりにしているらしい。

じゃあ他の言語は?

image.png

markdown, json, luaなどわんちゃんC++のraw string literalに書きそうな言語を試したが対応指定なさそうだった。SQLだけ特別扱いなのかな。

環境

バージョン: 1.89.1 (user setup)
コミット: dc96b837cf6bb4af9cd736aa3af08cf8279f7685
日付: 2024-05-07T05:13:33.891Z
Electron: 28.2.8
ElectronBuildId: 27744544
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
OS: Windows_NT x64 10.0.22631

ms-vscode.cpptools: v1.20.5

1
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0