fix: autocompletion position messing up

This commit is contained in:
Andrew Bastin
2021-09-12 21:56:56 +05:30
parent 827a95515d
commit 631b2d869e
5 changed files with 5 additions and 37 deletions

View File

@@ -1,4 +1,3 @@
import { convertIndexToLineCh } from "../utils"
import { Completer, CompletionEntry } from "."
import { getTestScriptCompletions } from "~/helpers/tern"
@@ -9,9 +8,6 @@ export const completer: Completer = async (text, completePos) => {
completePos.ch
)
const start = convertIndexToLineCh(text, results.start)
const end = convertIndexToLineCh(text, results.end)
const completions = results.completions.map((completion: any, i: number) => {
return <CompletionEntry>{
text: completion.name,
@@ -21,8 +17,6 @@ export const completer: Completer = async (text, completePos) => {
})
return {
start,
end,
completions,
}
}