-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect syntax highlighting - Javascript #26221
Labels
javascript
JavaScript support issues
languages-basic
Basic language support issues
upstream
Issue identified as 'upstream' component related (exists outside of VS Code)
Comments
Can you please post up code snippets along with the screenshots |
mjbvz
added
javascript
JavaScript support issues
languages-basic
Basic language support issues
labels
May 8, 2017
const ObjectId = require('mongodb').ObjectID;
module.exports = function ()
{
const opers =
{
insertOne: function (data)
{
data.save(function (error, data, addedCount)
{
})
},
selectAll: function (Model)
{
return new Promise((resolve,reject)=>
{
Model.find({},function (error, data)
{
if(error)
{
reject(error)
}
else
{
resolve(data);
}
})
})
},
selectById: function(Model,id)
{
return new Promise((resolve,reject)=>
{
Model.find({_id:ObjectId(id)},function(err,data)
{
if (err)
reject(err);
else
resolve(data);
})
})
},
deleteById:function(model,id) // {Model model, string id}
{
return new Promise((resolve,reject)=>
{
model.remove({_id:ObjectId(id)}, function(err,removed) // removed: {int n, int ok}
{
if(err)
reject(err);
else if(!removed.result.ok || removed.result.n == 0)
reject(new Error(`User with id:'${id}' doesn't exist.`));
else
resolve(removed);
});
})
},
deleteAll: function (Model)
{
Model.remove(function (err, data)
{
if (err) return console.error(err);
console.log(data);
})
},
}
return opers;
} Look for line 47 and try to remove curly brackets. Sorry for unformatted code, but I couldn't format it (probably due to template strings). |
Thanks. I've opened microsoft/TypeScript-TmLanguage#455 to track this upstream in the TS/JS grammar |
mjbvz
added
upstream
Issue identified as 'upstream' component related (exists outside of VS Code)
and removed
info-needed
Issue requires more information from poster
labels
May 16, 2017
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
javascript
JavaScript support issues
languages-basic
Basic language support issues
upstream
Issue identified as 'upstream' component related (exists outside of VS Code)
Everything ok:
Not good now:
Everything works fine if I use K&R indent style.
The text was updated successfully, but these errors were encountered: