LoginSignup
9

More than 5 years have passed since last update.

VSCodeで変数や予約語が自動的にItalicで表示されているのを無効にする方法

Last updated at Posted at 2018-08-23

目的

勉強、仕事していく中で気になる事を忘れないように記録として残してます。

背景

VSCodeで変数や予約語が自動的にItalicで表示されているのが私的に見づらいのでItalicを無効にできないかを調べて見ました。VSCodeのUIで設定できるところには見つけられなかったが、ユーザの設定で書けば無効にできるらしい。だが、設定を無効にするには、無効にしたい箇所を指定する必要があった。

環境

  • macOS High Sierra ver 10.13.6
  • VSCode ver 1.26.1 (1.26.1)

TM Scopesの探し方

VSCodeで command+shift+P を押下し、表示されたCommand Pletteで developer inspectを入力する。入力後、下部の方で表示された候補の中から Developer: Inspect TM Scopes を選択した後に、気になる変数や予約語のとこにカーソルを置くと一覧情報を表示してくれる。その中で、真ん中セクションの情報がTM Scopesの情報です。下の画像ではstorage.type { "fontStyle": "italic", "foreground": "#9cd1bb" }

スクリーンショット 2018-08-23 10.13.01.png

Italicを無効にする設定

ユーザ設定表示

ユーザ設定に設定する必要があります。 ユーザ設定を表示するには2つの方法がある。

  • ショートカット

    • command+,
  • UIからユーザ設定を選択

    • Code>Preferences>Settings

設定ファイルに定義する


"editor.tokenColorCustomizations": {
  "textMateRules": [
    {
      "scope": [
        "comment",
        "comment.block",
        "comment.block.documentation",
        "comment.line",
        "constant",
        "constant.character",
        "constant.character.escape",
        "constant.numeric",
        "constant.numeric.integer",
        "constant.numeric.float",
        "constant.numeric.hex",
        "constant.numeric.octal",
        "constant.other",
        "constant.regexp",
        "constant.rgb-value",
        "emphasis",
        "entity",
        "entity.name",
        "entity.name.class",
        "entity.name.function",
        "entity.name.method",
        "entity.name.section",
        "entity.name.selector",
        "entity.name.tag",
        "entity.name.type",
        "entity.other",
        "entity.other.attribute-name",
        "entity.other.inherited-class",
        "invalid",
        "invalid.deprecated",
        "invalid.illegal",
        "keyword",
        "keyword.control",
        "keyword.operator",
        "keyword.operator.new",
        "keyword.operator.assignment",
        "keyword.operator.arithmetic",
        "keyword.operator.logical",
        "keyword.other",
        "markup",
        "markup.bold",
        "markup.changed",
        "markup.deleted",
        "markup.heading",
        "markup.inline.raw",
        "markup.inserted",
        "markup.italic",
        "markup.list",
        "markup.list.numbered",
        "markup.list.unnumbered",
        "markup.other",
        "markup.quote",
        "markup.raw",
        "markup.underline",
        "markup.underline.link",
        "meta",
        "meta.block",
        "meta.cast",
        "meta.class",
        "meta.function",
        "meta.function-call",
        "meta.preprocessor",
        "meta.return-type",
        "meta.selector",
        "meta.tag",
        "meta.type.annotation",
        "meta.type",
        "punctuation.definition.string.begin",
        "punctuation.definition.string.end",
        "punctuation.separator",
        "punctuation.separator.continuation",
        "punctuation.terminator",
        "storage",
        "storage.modifier",
        "storage.type",
        "string",
        "string.interpolated",
        "string.other",
        "string.quoted",
        "string.quoted.double",
        "string.quoted.other",
        "string.quoted.single",
        "string.quoted.triple",
        "string.regexp",
        "string.unquoted",
        "strong",
        "support",
        "support.class",
        "support.constant",
        "support.function",
        "support.other",
        "support.type",
        "support.type.property-name",
        "support.variable",
        "variable",
        "variable.language",
        "variable.name",
        "variable.other",
        "variable.other.readwrite",
        "variable.parameter"
      ],
      "settings": {
        "fontStyle": ""
      }
    }
  ]
}

リソース

最後

私と同じように困っている方の助けになればと思ってます。

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
9