gpt4 book ai didi

c - VScode : Disable syntax highlighting for a range of lines

转载 作者:行者123 更新时间:2023-12-05 04:23:09 26 4
gpt4 key购买 nike

我正在为我的项目使用 SDCC 的内联汇编语法:


void delay_ms(uint16_t ms) {
_ms = ms;
__asm
ldw y, __ms ; Load ms counter into y register: 2 cycles
0000$:
ldw x, _CYCLES_PER_MS ; Load tick counter into x register: 2 cycles
0001$:
decw x ; Decrease tick counter: 1 cycle
jrne 0001$ ; Check if 1ms passed: 2 cycles (except for x == 0 where it's just 1 cycle)

decw y ; Decrease ms counter: 1 cycle
jrne 0000$ ; Check if provided time has passed: 2 cycles (except for y == 0 where it's just 1 cycle)
__endasm;
}

不幸的是,VScode 的语言语法高亮仍然将内联汇编代码解释为 C 代码,这很烦人:

enter image description here

是否可以完全禁用文件中一系列行的语法突出显示?

最佳答案

没有默认设置,据我所知,没有支持它的扩展。

可以把整个文件当作一个asm源文件。这仍然会支持一些非常基本的 C 突出显示。为此,请在选择语言模式 菜单中寻找asm-collection 模式。

enter image description here

enter image description here

或者,可以通过同一菜单完全禁用文件的突出显示,或者在需要将其应用于多个文件的情况下通过 settings.json

"files.associations": {
"*.c": "plaintext",
},

关于c - VScode : Disable syntax highlighting for a range of lines,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73788716/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com