提交 08b89952 编写于 作者: M Matt Bierner

Fix case sensitivy for completionItemProvider

上级 5d7ba476
......@@ -30,9 +30,10 @@ class MyCompletionItem extends CompletionItem {
// We convert to 0-based indexing.
this.textEdit = TextEdit.replace(new Range(span.start.line - 1, span.start.offset - 1, span.end.line - 1, span.end.offset - 1), entry.name);
} else {
const text = document.getText(new Range(position.line, Math.max(0, position.character - entry.name.length), position.line, position.character));
for (let i = entry.name.length; i >= 0; --i) {
if ((text as any).endsWith(entry.name.substr(0, i))) {
const text = document.getText(new Range(position.line, Math.max(0, position.character - entry.name.length), position.line, position.character)).toLowerCase();
const entryName = entry.name.toLowerCase();
for (let i = entryName.length; i >= 0; --i) {
if (text.endsWith(entryName.substr(0, i))) {
this.range = new Range(position.line, Math.max(0, position.character - i), position.line, position.character);
break;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册