Closed cfsmp3 closed 5 years ago
Are you using the most up-to-date version of the plugin, and if not, can you post a minimal reproduction of the code that has this error?
@DanielRosenwasser Yes, just checked, 3.1.1, and this simple thing triggers it:
Again commenting out that first console.log() line is enough to to get it to work as expected.
Can you post code as text? Screenshots aren't copy/paste-able for tests 😉
Sure @DanielRosenwasser . This should do:
Version with wrong colors:
function dummy()
{
return Promise.all([])
.then((result) => // Array of arrays (one array per user,each listing the token
{
const send_all_messages_promises = [];
console.log('Result of device list', result);
const usedTokens = {};
for (const userdevicelist of result) {
for (const registrationTokenObj of userdevicelist) {
const registrationToken = registrationTokenObj.registrationToken;
const deviceRef = registrationTokenObj.reference;
console.log("Token", registrationToken);
}
}
});
}
Version with correct colors:
function dummy ()
{
return Promise.all ([])
.then((result) =>
{
const send_all_messages_promises = [];
console.log('Result of device list', result);
const usedTokens = {};
for (const userdevicelist of result) {
for (const registrationTokenObj of userdevicelist) {
const registrationToken = registrationTokenObj.registrationToken;
const deviceRef = registrationTokenObj.reference;
console.log("Token", registrationToken);
}
}
});
}
It's the // Array of arrays (one array per user,each listing the token comment that causes the problem.
This issue was moved to Microsoft/TypeScript-TmLanguage#678
Released 3.1.5 with updated syntax highlighting.
(originally posted here, but they sent me your way)
Doesn't happen to all the code, but it happens to this specific bit, see screenshot.
What is most interesting and I can't explain is that if I comment out that console.log line, everything works as expected.