Closed hoschi closed 6 years ago
Ah yes, I hit this too, it is annoying!
I believe the problem is here in oni/vim/core/oni-plugin-typescript/src/index.ts
:
const getCompletions = (textDocumentPosition: Oni.EventContext) => {
if (textDocumentPosition.column <= 1) {
return Promise.resolve({
completions: [],
})
}
const currentLine = lastBuffer[textDocumentPosition.line - 1]
let col = textDocumentPosition.column - 2
let currentPrefix = ""
while (col >= 0) {
const currentCharacter = currentLine[col]
if (!currentCharacter.match(/[_a-z]/i)) {
break
}
currentPrefix = currentCharacter + currentPrefix
col--
}
const basePos = col
if (currentPrefix.length === 0 && currentLine[basePos] !== ".") {
return Promise.resolve({
base: currentPrefix,
completions: [],
})
}
This logic decides where we 'ask' for completions from, and what the prefix is. Right now, because of the regex - /[_a-z]/i
), it's only matching letters + underscore, and ideally it would match some additional characters as above.
Expanding this to handle some of those cases, or be more generalized, would be very helpful!
Hopefully this will be fixed for you with #861, which was just merged in.
Thanks @CrossR !
When I want to import something from a module and type this (cursor is
|
):I see in devtools console:
which returns all global JS modules, which is ok. When I add a '/' and have now:
I want to see all modules in the current folder, but I get no completion candidates at all. The console doesn't even log a request for completions. I must add an additional letter to get the completions, which then work:
Which logs:
The problem is probably an escaping issue?