Skip to content
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

Closed
mterczynski opened this issue May 8, 2017 · 3 comments
Closed

Incorrect syntax highlighting - Javascript #26221

mterczynski opened this issue May 8, 2017 · 3 comments
Assignees
Labels
javascript JavaScript support issues languages-basic Basic language support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@mterczynski
Copy link

mterczynski commented May 8, 2017

Everything ok:
image
Not good now:
image
Everything works fine if I use K&R indent style.

@mjbvz mjbvz self-assigned this May 8, 2017
@mjbvz mjbvz added the info-needed Issue requires more information from poster label May 8, 2017
@mjbvz
Copy link
Collaborator

mjbvz commented May 8, 2017

Can you please post up code snippets along with the screenshots

@mjbvz mjbvz added javascript JavaScript support issues languages-basic Basic language support issues labels May 8, 2017
@mterczynski
Copy link
Author

mterczynski commented May 15, 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).

@mjbvz
Copy link
Collaborator

mjbvz commented May 16, 2017

Thanks. I've opened microsoft/TypeScript-TmLanguage#455 to track this upstream in the TS/JS grammar

@mjbvz mjbvz closed this as completed May 16, 2017
@mjbvz 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
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 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)
Projects
None yet
Development

No branches or pull requests

2 participants