Xcode 8.3.3在C++中使用错误语法高亮显示
问题描述:
我注意到一些突出显示不一致的特殊语法。 class
,if
,else
,while
和break
关键字由于某种原因未着色。即使更改颜色主题并重新启动Xcode,此问题仍然存在。我使用的是Civic主题,这是Xcode中的默认主题之一。这个问题似乎是特定于语言的,因为这只发生在C++上,而它不适用于Objective-C或Python。Xcode 8.3.3在C++中使用错误语法高亮显示
答
我已经找到了解决方案,它是远远不够理想,并从外观上来看,这似乎是一个Xcode错误。
- 打开
Preferences
窗口 - 转到
Locations
标签 - 点击旁边的箭头
/Users/Library/Developer/Xcode/DerivedData
- 转到
User Data
- 转到
FontAndColorThemes
-
打开任何
.xccolortheme
文件和Xcode<key>xcode.syntax.identifier.class</key> <string>0.115602 0.660894 0.635056 1</string> <key>xcode.syntax.identifier.class.system</key> <string>0.221291 0.537118 0.556094 1</string> # change this line <key>xcode.syntax.identifier.function</key> <string>0.115602 0.660894 0.635056 1</string> <key>xcode.syntax.identifier.function.system</key> <string>0.221291 0.537118 0.556094 1</string>
用于xcode.syntax.identifier.class.system
颜色代码并不等同于的xcode.syntax.identifier.function.system
这引起了class
关键字不被着色。所以解决方案是让他们一样。对所有其他关键字执行相同操作。
由于我无法理解的原因,为单色主题更改该行会自动修复所有颜色主题的此错误。另外,我还没有弄清楚为什么这个bug是C++语言特定的。尽管如此,解决方案仍然有效
什么是您使用的主题名称? –
@AlexG我已将它更新到 – Senyokbalgul
你有权访问主题文件吗? –