Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
meta,
fullLineText,
parentSelector,
lineChunkAtCursor,
position,
fs,
tsLangService,
stylable
}: ProviderOptions): Completion[] {
if (
meta.imports.some(
imp => imp.fromRelative.endsWith('.ts') || imp.fromRelative.endsWith('.js')
) &&
!fullLineText.trim().startsWith(valueMapping.from) &&
!fullLineText.trim().startsWith(valueMapping.extends) &&
!fullLineText.trim().startsWith(valueMapping.named) &&
parentSelector &&
~fullLineText.indexOf(':') &&
fullLineText.indexOf(':') < position.character &&
!lineChunkAtCursor.startsWith(valueMapping.mixin + ':')
) {
const { lastName } = getExistingNames(fullLineText, position);
return (
Object.keys(meta.mappedSymbols)
.filter(ms => meta.mappedSymbols[ms]._kind === 'import')
.filter(ms => ms.startsWith(lastName))
.filter(ms => {
const res = stylable.resolver.resolve(meta.mappedSymbols[ms]);
return res && res._kind === 'js';
})
// .filter(ms => names.length === 0 || !~names.indexOf(ms))
.filter(ms => !isMixin(ms, meta, fs, tsLangService))
function isNamedDirective(line: string) {
return line.indexOf(valueMapping.named) !== -1;
}