How to use the vscode-css-languageservice.getSCSSLanguageService function in vscode-css-languageservice

To help you get started, we’ve selected a few vscode-css-languageservice examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github UnwrittenFun / svelte-language-server / src / plugins / CSSPlugin.ts View on Github external
if (!symbol.containerName) {
                    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';
github neoclide / coc.nvim / src / extensions / css / server.ts View on Github external
: 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
}

let documentSettings: Settings
github neoclide / coc-css / src / server / server.ts View on Github external
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
}

let documentSettings: Settings
github marko-js / language-server / server / src / util / stylesheet.ts View on Github external
function scssParser(embeddedDoc:TextDocument, options: IAutocompleteArguments) {
    const languageService = getSCSSLanguageService();
    return languageService.doComplete(embeddedDoc, options.position, languageService.parseStylesheet(embeddedDoc));
}
github vuejs / vetur / server / src / modes / style / index.ts View on Github external
export function getSCSSMode(documentRegions: LanguageModelCache): LanguageMode {
  const languageService = getSCSSLanguageService();
  return getStyleMode('scss', languageService, documentRegions);
}
export function getLESSMode(documentRegions: LanguageModelCache): LanguageMode {
github microsoft / typescript-styled-plugin / src / _language-service.ts View on Github external
private get scssLanguageService(): LanguageService {
        if (!this._scssLanguageService) {
            this._scssLanguageService = getSCSSLanguageService();
            this._scssLanguageService.configure(this.configurationManager.config);
        }
        return this._scssLanguageService;
    }
github codesandbox / codesandbox-client / standalone-packages / vscode-extensions / out / extensions / jpoissonnier.vscode-styled-components-0.0.26 / tmp / extension / node_modules / typescript-styled-plugin / lib / styled-template-language-service.js View on Github external
get: function () {
            if (!this._scssLanguageService) {
                this._scssLanguageService = vscode_css_languageservice_1.getSCSSLanguageService();
                this._scssLanguageService.configure(this.configuration);
            }
            return this._scssLanguageService;
        },
        enumerable: true,
github codesandbox / codesandbox-client / standalone-packages / vscode-extensions / out / extensions / jpoissonnier.vscode-styled-components-0.0.26 / node_modules / typescript-styled-plugin / lib / _language-service.js View on Github external
get scssLanguageService() {
        if (!this._scssLanguageService) {
            this._scssLanguageService = vscode_css_languageservice_1.getSCSSLanguageService();
            this._scssLanguageService.configure(this.configurationManager.config);
        }
        return this._scssLanguageService;
    }
    getCompletionsAtPosition(context, position) {
github runem / lit-analyzer / packages / lit-analyzer / src / analyze / document-analyzer / css / lit-css-vscode-service.ts View on Github external
private get scssService() {
		return vscode.getSCSSLanguageService({ customDataProviders: [this.dataProvider.provider] });
	}
github vuejs / vetur / server / src / modes / css / index.ts View on Github external
export function getSCSSMode(vueHTMLLs: VueHTMLLanguageService, documentRegions: LanguageModelCache): LanguageMode {
  const languageService = getSCSSLanguageService();
  return getStyleMode('scss', vueHTMLLs, languageService, documentRegions);
}
export function getLESSMode(vueHTMLLs: VueHTMLLanguageService, documentRegions: LanguageModelCache): LanguageMode {