proto应用的越来越多了,但是vs对proto的语法貌似不支持。下面介绍一下简单的设置在vs中使proto语法高亮

本文转载于:https://jingyan.baidu.com/article/ac6a9a5e23e88e2b643eac71.html

  1. 打开VS,在工具菜单中找到选项

    VS中设置proto语法高亮
  2.  在选项页面中,找到“文本编辑器”
    VS中设置proto语法高亮
  3.  在文本编辑器下面找到“文件扩展名”
    VS中设置proto语法高亮
  4.  添加proto扩展名,编辑器选择Microsoft Visual C++
    VS中设置proto语法高亮
  5.  找到vs的安装路径下的IDE目录,默认为C:Program FilesMicrosoft Visual Studio 11.0Common7IDE
    VS中设置proto语法高亮
  6.  看目录下面是否有usertype.dat文件,哪果没有,创建一个。
    VS中设置proto语法高亮
  7.  用文本编辑器打开,输入以下内容,一个关键字一行

    __int64

    auto

    bool

    break

    case

    catch

    char

    cerr

    cin

    class

    const

    continue

    cout

    default

    delete

    do

    double

    else

    enum

    package

    message

    required

    optional

    repeated

    explicit

    extern

    false

    float

    for

    friend

    goto

    if

    inline

    int

    long

    mutable

    namespace

    new

    operator

    private

    protected

    public

    register

    return

    string

    int32

    byte

    bytes

    short

    signed

    sizeof

    static

    struct

    switch

    template

    this

    throw

    true

    try

    typedef

    union

    unsigned

    using

    virtual

    void

    volatile

    wchar_t

    while

    __asm

    __fastcall

    __based

    __cdecl

    __pascal

    __inline

    __multiple_inheritance

    __single_inheritance

    __virtual_inheritance

    define

    error

    include

    elif

    if

    line

    else

    ifdef

    pragma

    endif

    ifndef

    undef

    if

    else

    endif

    #

    VS中设置proto语法高亮
  8.  重起VS看看,就可以显示高亮了
    VS中设置proto语法高亮
原文地址:https://www.cnblogs.com/ZQ1437487263/p/13815565.html