为什么在VSCode中将ushort识别为内置类型?

问题描述

您可以看到在Visual Studio Code中C ++模式下的ushort被识别为storage.type.built-in.cpp

ushort has got storage.type.built-in.cpp

我知道,什么ushort仅作为C#中的类型出现。在C ++中,没有ushortUSHORT宏除外)
为什么会这样?

注意::我进行了更多的实验,发现uint也被归类为内置。

解决方法

对于关键字和某些类型,vscode使用模式匹配来识别它们,而不是验证它们是否是任何标头的一部分。

用于此的模式在文件vscode/extensions/cpp/syntaxes/cpp.tmLanguage.json中定义。并且其中定义的模式之一与const mongoose = require('mongoose'); const chillersSchema = new mongoose.Schema( { dateTime: { type: Date },enteringWaterTemp: { type: Number },leavingWaterTemp: { type: Number },enteringGasTemp: { type: Number },leavingGasTemp: { type: Number },firstCircuitPressure: { type: Number },secondCiruitPressure: { type: Number },controlPoint: { type: Number },unitPrecentActiveCapacity: { type: Number },demandLimit: { type: Number },chillerState: { type: Number,required: true },},{ versionKey: false} ); chillersSchema.methods.convertData = function(originalData) { return 0; } const Chiller1 = mongoose.model('Chiller1',chillersSchema,'chiller1'); const Chiller2 = mongoose.model('Chiller2','chiller2'); const Chiller3 = mongoose.model('Chiller3','chiller3'); module.exports = { Chiller1,Chiller2,Chiller3 }; 作为内置类型匹配。

您可以考虑在github上打开一个与此行为有关的问题。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...