它不會一直髮生,但有時Visual Studio代碼無法找到其他文件中的變量,我不知道爲什麼。爲什麼VScode有時候找不到引用?
例如,我有一個index.html的
<script src="monitor.js"></script>
<script src="notificationManager.js"></script>
notificationManager.js
var NotificationManager = function() {
this.attentionRequest = function() {
console.log("Attention");
};
}
var notificationManager = new NotificationManager();
在我monitor.js:
notificationManager.attentionRequest();//VSCode don't find this
您是絕對正確的。很傷心,我很享受VSCode。 WebStorm解決了這個問題,但它不是免費的。 –
但就像我說的,即使改變index.html中的順序有時它還是會發生的 –
@JonathanNascimento - 必須有一些異步操作發生。你能重現這個問題嗎? – nikhil