zxh0 / vscode-proto3

vscode extension for proto3
MIT License
327 stars 75 forks source link

[BUG] ${workspaceFolder}: directory does not exist. #165

Open zs-dima opened 1 year ago

zs-dima commented 1 year ago

Usage of ${workspaceFolder} leads to ${workspaceFolder}/proto: warning: directory does not exist. Windows 11, VSCode 1.83

Without ${workspaceFolder} compile_on_save works well

"protoc": {
        "path": "protoc",
        "compile_on_save": true,
        "options": [
            "-Iproto=c:/service/proto",
            "--proto_path=c:/service/proto",
            "--go_out=paths=source_relative:c:/service/internal/gen/proto",
            "--go-grpc_out=paths=source_relative:c:/service/internal/gen/proto",
            "--grpc-gateway_out=c:/service/internal/gen/proto",
            "--grpc-gateway_opt=paths=source_relative"
        ]
    }

With ${workspaceFolder} compile_on_save generated error 'directory does not exist'

"protoc": {
        "path": "protoc",
        "compile_on_save": true,
        "options": [
            "-Iproto=${workspaceFolder}/proto",
            "--proto_path=c:/service/proto",
            "--go_out=paths=source_relative:c:/service/internal/gen/proto",
            "--go-grpc_out=paths=source_relative:c:/service/internal/gen/proto",
            "--grpc-gateway_out=c:/service/internal/gen/proto",
            "--grpc-gateway_opt=paths=source_relative"
        ]
    }

"compile_all_path": "${workspaceFolder}/proto" A system error occurred (ENOENT: no such file or directory, scandir '${workspaceFolder}/proto')

zs-dima commented 1 year ago

@zxh0 interesting that pointint to a parent folder '/../' compile_on_save works well However it does not work for the 'proto_path'

"options": [
            "-Iproto=${workspaceFolder}/../proto",
            "--proto_path=c:/service/proto",
            "--go_out=paths=source_relative:${workspaceFolder}/../internal/gen/proto",
            "--go-grpc_out=paths=source_relative:${workspaceFolder}/../internal/gen/proto",
            "--grpc-gateway_out=${workspaceFolder}/../internal/gen/proto",
            "--grpc-gateway_opt=paths=source_relative"
        ]