0

Visual Studioの構文ハイライトの新しい言語を作成しようとしていますが、CPU12アセンブリ言語のコードです。新しい.asmファイルで新しい言語を使用すると、エディタはコメント文字が(ctrl-k ctrl-cと入力すると行にセミコロンを追加する)ことを認識しますが、デフォルトのコメントではなくテキストが白です緑の色。デフォルトのvscodeテーマを使用するように指定する必要はありますか?もしそうなら、どこ?vscode新しい言語構成で構文の色が変更されない

package.json

{ 
    "name": "cpu12", 
    "displayName": "cpu12", 
    "description": "cpu12", 
    "version": "0.0.1", 
    "publisher": "https://github.com/me", 
    "engines": { 
     "vscode": "^1.15.0" 
    }, 
    "categories": [ 
     "Languages" 
    ], 
    "contributes": { 
     "languages": [{ 
      "id": "cpu12", 
      "aliases": ["CPU12", "cpu12"], 
      "extensions": [".asm",".inc"], 
      "configuration": "./language-configuration.json" 
     }], 
     "grammars": [{ 
      "language": "cpu12", 
      "scopeName": "source.cpu12", 
      "path": "./syntaxes/cpu12.tmLanguage.json" 
     }] 
    } 
} 

言語configuration.json

{ 
    "comments": { 
     // symbol used for single line comment. Remove this entry if your language does not support line comments 
     "lineComment": ";" 
    }, 
    // symbols used as brackets 
    "brackets": [ 
     ["{", "}"], 
     ["[", "]"], 
     ["(", ")"] 
    ], 
    // symbols that are auto closed when typing 
    "autoClosingPairs": [ 
     ["{", "}"], 
     ["[", "]"], 
     ["(", ")"], 
     ["\"", "\""], 
     ["'", "'"] 
    ], 
    // symbols that that can be used to surround a selection 
    "surroundingPairs": [ 
     ["{", "}"], 
     ["[", "]"], 
     ["(", ")"], 
     ["\"", "\""], 
     ["'", "'"] 
    ] 
} 

(マイ./syntaxes/cpu12.tmLanguage.jsonは空です。)

+0

/blob/master/syntaxes/cpu12.tmlanguage.jsonは空ではありません。問題の解決策を見つけたと思いますか? [あなた自身の質問に答えることができます](https://stackoverflow.com/help/self-answer)に注意してください。 – Gama11

+0

ありがとう、私は私自身の質問に答えることができるか分からなかった。私はそれを下に掲示した – heztet

答えて

0

./syntaxes/cpu12.tmLanguage.jsonが空であるため、問題は実際にでした。あなたは色のラインがコメントどのように.jsonファイルで指定する必要があります。

./syntaxes/cpu12.tmLanguage.json

https://github.com/heztet/cpu12-vscodeを考慮
{ 
    "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", 
    "name": "cpu12", 
    "scopeName": "source.cpu12", 
    "patterns": [ 
     { 
      "comment": "Line Comments -- Asterisk only works at beginning of line", 
      "match": "((;|^\\*).*$)", 
      "captures": { 
       "1" :{ 
        "name": "comment.line.cpu12" 
       } 
      } 
     } 
    ] 
} 
関連する問題