LoginSignup
6
2

More than 3 years have passed since last update.

vscode-proto3でmessageをimportするときの設定

Posted at

VSCodeでvscode-proto3を使用している場合、別のディレクトリで定義したmessageをimportして使用するとエラー(<message> is not Defined)が表示される。

以下の設定でエラーを回避できる。

  1. vscode-proto3の設定で Edit in settings.jsonを開く
  2. protocの設定でproto_pathオプションを指定する以下のようにする
    ...
    "protoc": {
        "options": [
            "--proto_path=<proto定義があるディレクトリへのパス>",
        ]
    }
    ...

パスが複数ある場合は--proto_pathを増やせばOK

    ...
    "protoc": {
        "options": [
            "--proto_path=<proto定義があるディレクトリへのパス1>",
            "--proto_path=<proto定義があるディレクトリへのパス2>",
        ]
    }
    ...
6
2
0

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
6
2