You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
无法出现a变量的补全。
查看源码后我发现问题在于ext-language_tools.js
function wordDistance(doc, pos) {
var prefixPos = getWordIndex(doc, pos);
var words = doc.getValue().split(splitRegex);
var wordScores = Object.create(null);
var currentWord = words[prefixPos];
words.forEach(function(word, idx) {
if (!word || idx === words.length-1) return;
var distance = Math.abs(prefixPos - idx);
var score = words.length - distance;
if (wordScores[word]) {
wordScores[word] = Math.max(score, wordScores[word]);
} else {
wordScores[word] = score;
}
});
return wordScores;
}
我将 if (!word || word === currentWord) return;代码更改为if (!word || idx === words.length-1) return;
现在变量只有1个字符的补全就没问题了
The text was updated successfully, but these errors were encountered:
无法出现a变量的补全。
查看源码后我发现问题在于ext-language_tools.js
function wordDistance(doc, pos) {
var prefixPos = getWordIndex(doc, pos);
var words = doc.getValue().split(splitRegex);
var wordScores = Object.create(null);
}
我将 if (!word || word === currentWord) return;代码更改为if (!word || idx === words.length-1) return;
现在变量只有1个字符的补全就没问题了
The text was updated successfully, but these errors were encountered: