Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return {
...symbol,
// TODO: this could contain other things, e.g. style.myclass
containerName: 'style',
};
}
return symbol;
});
}
}
const langs = {
css: getCSSLanguageService(),
scss: getSCSSLanguageService(),
less: getLESSLanguageService(),
};
function extractLanguage(document: Document): string {
const attrs = document.getAttributes();
return attrs.lang || attrs.type;
}
function getLanguage(kind?: string) {
switch (kind) {
case 'scss':
case 'text/scss':
return 'scss';
case 'less':
case 'text/less':
return 'less';
case 'css':
hoverProvider: true,
documentSymbolProvider: true,
referencesProvider: true,
definitionProvider: true,
documentHighlightProvider: true,
codeActionProvider: true,
renameProvider: true,
colorProvider: {},
}
return {capabilities}
})
const languageServices: {[id: string]: LanguageService} = {
css: getCSSLanguageService(),
scss: getSCSSLanguageService(),
less: getLESSLanguageService(),
wxss: getCSSLanguageService(),
}
function getLanguageService(document: TextDocument) {
let service = languageServices[document.languageId]
if (!service) {
connection.console.log(
'Document type is ' + document.languageId + ', using css instead.'
)
service = languageServices['css']
}
return service
}
let documentSettings: Settings
referencesProvider: true,
definitionProvider: true,
documentHighlightProvider: true,
codeActionProvider: true,
renameProvider: true,
colorProvider: {},
foldingRangeProvider: true
}
return { capabilities }
}
)
const languageServices: { [id: string]: LanguageService } = {
css: getCSSLanguageService(),
scss: getSCSSLanguageService(),
less: getLESSLanguageService(),
wxss: getCSSLanguageService()
}
function getLanguageService(document: TextDocument) {
let service = languageServices[document.languageId]
if (!service) {
connection.console.log(
'Document type is ' + document.languageId + ', using css instead.'
)
service = languageServices['css']
}
return service
}
let documentSettings: Settings
function lessParser(embeddedDoc:TextDocument, options: IAutocompleteArguments) {
const languageService = getLESSLanguageService();
return languageService.doComplete(embeddedDoc, options.position, languageService.parseStylesheet(embeddedDoc));
}
function scssParser(embeddedDoc:TextDocument, options: IAutocompleteArguments) {
export function getLESSMode(vueHTMLLs: VueHTMLLanguageService, documentRegions: LanguageModelCache): LanguageMode {
const languageService = getLESSLanguageService();
return getStyleMode('less', vueHTMLLs, languageService, documentRegions);
}
export function getLESSMode(documentRegions: LanguageModelCache): LanguageMode {
const languageService = getLESSLanguageService();
return getStyleMode('less', languageService, documentRegions);
}