I use PhpStorm, I've noticed that when writing JavaScript, the IDE won't autocomplete native methods or properties of variables whose type PhpStorm should know.
var checkButton = document.forms.addSeller.check;
checkButton.onclick = function(e) {
e.preventDefault();
var request = new XMLHttpRequest;
request.open("POST", "/seller");
request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
request.onload = function() {
if (request.readyState == 4) {
if (request.status == 200) {
var response = JSON.parse(request.responseText);
console.log(response);
var target = document.getElementById("seller_info");
var image = document.createElement("img");
image.src = response.logo;
image.id = "seller_logo";
target.appendChild(image);
}
else {
alert("Problem!");
}
}
};
request.send("seller=" + document.forms.addSeller.seller.value);
}
None of the methods (.preventDefault(), .open(), .setRequestHeader()) or the properties (.onload, .onclick) were auto completed.
Settings looks fine as far as I can tell, but I hadn't found a specific JavaScript autocompletion setting.
Anyone knows how can I re-enable it? PhpStorm 100% knows which objects they are, because it does syntax highlighting and error reporting well, and when I CTRL+Click a method/property, it will open PhpStorm's internal syntax files on the correct symbol.
File|Invalidate Caches|Invalidate and Restart. If it doesn't help, attach a complete sample project to reproduce.