Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
// The settings have changed. Is send on server activation as well.
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
// The settings have changed. Is send on server activation as well.
? {resolveProvider: false, triggerCharacters: [':', '.']}
: undefined,
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
}
hoverProvider: true,
documentSymbolProvider: true,
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
}
get languageService() {
if (!this._languageService) {
this._languageService = vscode_css_languageservice_1.getCSSLanguageService();
this._languageService.configure(this.configuration);
}
return this._languageService;
}
getCompletionsAtPosition(contents, position, context) {
export function getCSSMode(
documentRegions: LanguageModelCache
): LanguageMode {
const cssLanguageService = getCSSLanguageService();
const embeddedCSSDocuments = getLanguageModelCache(
10,
60,
document => documentRegions.get(document).getEmbeddedDocument('css')
);
const cssStylesheets = getLanguageModelCache(10, 60, document =>
cssLanguageService.parseStylesheet(document)
);
return {
getId() {
return 'css';
},
configure(options: any) {
cssLanguageService.configure(options && options.css);
},
private get languageService(): LanguageService {
if (!this._languageService) {
this._languageService = getCSSLanguageService();
}
return this._languageService;
}
get: function () {
if (!this._cssLanguageService) {
this._cssLanguageService = vscode_css_languageservice_1.getCSSLanguageService();
this._cssLanguageService.configure(this.configuration);
}
return this._cssLanguageService;
},
enumerable: true,
function cssParser(embeddedDoc:TextDocument, options: IAutocompleteArguments) {
const languageService = getCSSLanguageService();
return languageService.doComplete(embeddedDoc, options.position, languageService.parseStylesheet(embeddedDoc));
}
export function getCSSMode(documentRegions: LanguageModelCache): LanguageMode {
const languageService = getCSSLanguageService();
return getStyleMode('css', languageService, documentRegions);
}