vscode 怎么高亮 C++的类型声明? - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
ch2
V2EX    问与答

vscode 怎么高亮 C++的类型声明?

  •  
  •   ch2 2022-04-28 10:41:19 +08:00 1683 次点击
    这是一个创建于 1312 天前的主题,其中的信息可能已经有所发展或是发生改变。

    主题是 Light+/Dark+,C/C++ Extension Pack 也装了
    20220428103723

    8 条回复    2022-05-01 10:46:38 +08:00
    v2mm
        1
    v2mm  
       2022-04-28 10:44:47 +08:00
    试试 one dark pro
    ch2
        2
    ch2  
    OP
       2022-04-28 10:54:24 +08:00
    @v2mm #1 这个也不行,应该不是主题的原因,typedef struct 的别名在任何主题都不能高亮
    kkocdko
        3
    kkocdko  
       2022-04-28 11:24:37 +08:00   1
    给出你的具体写法。我这边一切正常。Clangd 。
    tengyufei
        4
    tengyufei  
       2022-04-28 11:58:17 +08:00 via Android   1
    好像还是得 clangd ?
    ch2
        5
    ch2  
    OP
       2022-04-28 15:05:29 +08:00
    @tengyufei #4 clangd 确实是可以的
    binaryify
        6
    binaryify  
       2022-04-28 15:14:58 +08:00
    可以提供下最小示例代码吗
    ch2
        7
    ch2  
    OP
       2022-04-28 16:44:03 +08:00
    @binaryify #6

    #include <mysql/mysql.h>
    #include <iostream>
    #include <fstream>
    #include <map>

    using namespace std;

    int main(int argc, char *argv[])
    {
    MYSQL mysql;

    mysql_init(&mysql);

    if (mysql_real_connect(&mysql, "0.0.0.0", "root", "88888888", "sys", 3306, NULL, 0) == NULL)
    {
    cout << "mysql_real_connect failed(" << mysql_error(&mysql) << ")" << endl;
    return -1;
    }

    mysql_set_character_set(&mysql, "utf-8");

    MYSQL_RES *res;
    MYSQL_ROW row;
    int ret = mysql_query(&mysql, "select * from sys_config;");
    res = mysql_store_result(&mysql);

    cout << "variable "
    << "value "
    << "set_time " << endl;
    while (row = mysql_fetch_row(res))
    {
    cout << row[0] << " ";
    cout << row[1] << " ";
    cout << row[2] << " ";
    cout << endl;
    }

    mysql_free_result(res);
    mysql_close(&mysql);

    return 0;
    }
    binaryify
        8
    binaryify  
       2022-05-01 10:46:38 +08:00
    @ch2 它的 scope 没单独区分出来,高亮了会影响别的代码,只能装别的插件,给它解析出来
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     844 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 25ms UTC 19:27 PVG 03:27 LAX 11:27 JFK 14:27
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86