Part of my code make copilot crash #20273
-
I was using copilot, it was working great and then 2 minutes later there is no suggestions anymore. I had the same issue yesterday but it somehow worked again this morning... Now it's not working again. I found out that after i wrote certain part of my code copilot doesn't suggest anything anymore. I tried :
Here is the log when I press enter (when there should have a suggestions)
For a bit of contexte, here is the code //descriptions is a global object
export function description(name,age,gender,stats)
{
var descriptionGenerated="";
//wealth category
var familyType="";
if (stats.wealth>=8) familyType="rich";
else if(stats.wealth>=6) familyType="aisée";
else if(stats.wealth>=4) familyType="modeste";
else familyType="pauvre";
//baby description
if(age<=3)
{
//get random baby description
var descriptionId = Math.floor(Math.random()*descriptions.template.baby[gender].length);
descriptionGenerated = formated(descriptions.template.baby[gender][descriptionId],{name:name,age:2,face:"test",eyes:"",familyWealth:familyType,future:"nul"});
}
//standard description
return descriptionGenerated;
} and here is the part of code that make copilot crash //baby description
if(age<=3)
{
//get random baby description
var descriptionId = Math.floor(Math.random()*descriptions.template.baby[gender].length);
descriptionGenerated = formated(descriptions.template.baby[gender][descriptionId],{name:name,age:2,face:"test",eyes:"",familyWealth:familyType,future:"nul"});
} |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 16 replies
-
Try this. I could be solution for you. |
Beta Was this translation helpful? Give feedback.
-
The problem you were facing is probably because the code you wrote uses the word "gender". It's really frustrating that Copilot has a content filter that it makes it not make any suggestions to code that uses "gender". I hope they will resolve this at some point. |
Beta Was this translation helpful? Give feedback.
-
Your code can't contain words like gender, sex, woman, man, male, female, guy, boy, girl, etc. Yes, it's fucking stupid, but that's how it is.. |
Beta Was this translation helpful? Give feedback.
The problem you were facing is probably because the code you wrote uses the word "gender".
It's really frustrating that Copilot has a content filter that it makes it not make any suggestions to code that uses "gender".
I hope they will resolve this at some point.