问题描述
您可以看到在Visual Studio Code中C ++模式下的ushort
被识别为storage.type.built-in.cpp
:
我知道,什么ushort
仅作为C#中的类型出现。在C ++中,没有ushort
(USHORT
宏除外)
为什么会这样?
注意::我进行了更多的实验,发现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上打开一个与此行为有关的问题。