parent
251a512222
commit
60e4490808
|
@ -28,7 +28,7 @@ const hiddenHtmlElements = {
|
||||||
link: true,
|
link: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
const ANGULAR_PSEUDO_ELEMENTS = ['ng-container', 'ng-content', 'ng-template'] as const ;
|
const ANGULAR_ELEMENTS: ReadonlyArray<string> = ['ng-container', 'ng-content', 'ng-template'] as const ;
|
||||||
|
|
||||||
export function getTemplateCompletions(
|
export function getTemplateCompletions(
|
||||||
templateInfo: AstResult, position: number): ts.CompletionEntry[] {
|
templateInfo: AstResult, position: number): ts.CompletionEntry[] {
|
||||||
|
@ -244,18 +244,18 @@ function elementCompletions(info: AstResult, path: AstPath<HtmlAst>): ts.Complet
|
||||||
sortText: name,
|
sortText: name,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
const pseudoElements = ANGULAR_PSEUDO_ELEMENTS.map(name => {
|
const angularElements = ANGULAR_ELEMENTS.map(name => {
|
||||||
return {
|
return {
|
||||||
name,
|
name,
|
||||||
// Need to cast to unknown because Angular's CompletionKind includes HTML
|
// Need to cast to unknown because Angular's CompletionKind includes HTML
|
||||||
// entites.
|
// entites.
|
||||||
kind: CompletionKind.PSEUDO_ELEMENT as unknown as ts.ScriptElementKind,
|
kind: CompletionKind.ANGULAR_ELEMENT as unknown as ts.ScriptElementKind,
|
||||||
sortText: name,
|
sortText: name,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
// Return components and html elements
|
// Return components and html elements
|
||||||
return uniqueByName([...htmlElements, ...components, ...pseudoElements]);
|
return uniqueByName([...htmlElements, ...components, ...angularElements]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -274,7 +274,7 @@ export enum CompletionKind {
|
||||||
REFERENCE = 'reference',
|
REFERENCE = 'reference',
|
||||||
TYPE = 'type',
|
TYPE = 'type',
|
||||||
VARIABLE = 'variable',
|
VARIABLE = 'variable',
|
||||||
PSEUDO_ELEMENT = 'pseudo element'
|
ANGULAR_ELEMENT = 'angular element'
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue