Fix missing parameter

master
Brad Cornes 2023-01-27 16:58:51 +00:00
parent 0b2db09a22
commit 086dfb4c28
1 changed files with 25 additions and 14 deletions

View File

@ -43,8 +43,8 @@ export function completionsFromClassList(
state: State, state: State,
classList: string, classList: string,
classListRange: Range, classListRange: Range,
document: TextDocument,
filter?: (item: CompletionItem) => boolean, filter?: (item: CompletionItem) => boolean,
document?: TextDocument,
context?: CompletionContext context?: CompletionContext
): CompletionList { ): CompletionList {
let classNamesAndWhitespace = classList.split(/(\s+)/) let classNamesAndWhitespace = classList.split(/(\s+)/)
@ -489,8 +489,8 @@ async function provideClassAttributeCompletions(
), ),
end: position, end: position,
}, },
undefined,
document, document,
undefined,
context context
) )
} }
@ -553,13 +553,18 @@ async function provideCustomClassNameCompletions(
classList = containerMatch[1].substr(0, cursor - matchStart) classList = containerMatch[1].substr(0, cursor - matchStart)
} }
return completionsFromClassList(state, classList, { return completionsFromClassList(
start: { state,
line: position.line, classList,
character: position.character - classList.length, {
start: {
line: position.line,
character: position.character - classList.length,
},
end: position,
}, },
end: position, document
}) )
} }
} }
} catch (_) {} } catch (_) {}
@ -599,6 +604,7 @@ function provideAtApplyCompletions(
}, },
end: position, end: position,
}, },
document,
(item) => { (item) => {
if (item.kind === 9) { if (item.kind === 9) {
return ( return (
@ -1332,13 +1338,18 @@ async function provideEmmetCompletions(
const parts = emmetItems.items[0].label.split('.') const parts = emmetItems.items[0].label.split('.')
if (parts.length < 2) return null if (parts.length < 2) return null
return completionsFromClassList(state, parts[parts.length - 1], { return completionsFromClassList(
start: { state,
line: position.line, parts[parts.length - 1],
character: position.character - parts[parts.length - 1].length, {
start: {
line: position.line,
character: position.character - parts[parts.length - 1].length,
},
end: position,
}, },
end: position, document
}) )
} }
export async function doComplete( export async function doComplete(