Skip to content

Commit

Permalink
Update index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed May 15, 2024
1 parent c2cbcc8 commit 530b642
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/emmet/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ export function create({
name: 'emmet',
// https://docs.emmet.io/abbreviations/syntax/
triggerCharacters: '>+^*()#.[]$@-{}'.split(''),
create(context): vscode.LanguageServicePluginInstance {
// @ts-expect-error Need to update @volar/language-service
create(context, languageService): vscode.LanguageServicePluginInstance {

let lastCompletionType: string | undefined;

Expand Down Expand Up @@ -181,10 +182,10 @@ export function create({
if (abbreviation.startsWith('this.') || /\[[^\]=]*\]/.test(abbreviation)) {
isNoisePromise = Promise.resolve(true);
} else {
// TODO
// isNoisePromise = vscode.commands.executeCommand<vscode.SymbolInformation[] | undefined>('vscode.executeDocumentSymbolProvider', document.uri).then(symbols => {
// return !!symbols && symbols.some(x => abbreviation === x.name || (abbreviation.startsWith(x.name + '.') && !/>|\*|\+/.test(abbreviation)));
// });
const documentUri = context.decodeEmbeddedDocumentUri(document.uri)?.[0] ?? document.uri;
isNoisePromise = languageService.findDocumentSymbols(documentUri).then(symbols => {
return !!symbols && symbols.some(x => abbreviation === x.name || (abbreviation.startsWith(x.name + '.') && !/>|\*|\+/.test(abbreviation)));
});
}
}

Expand Down

0 comments on commit 530b642

Please sign in to comment.