How to use the vscode-css-languageservice.getCSSLanguageService 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 neoclide / coc.nvim / src / extensions / css / server.ts View on Github external
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.
github neoclide / coc-css / src / server / server.ts View on Github external
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.
github neoclide / coc.nvim / src / extensions / css / server.ts View on Github external
? {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
}
github neoclide / coc-css / src / server / server.ts View on Github external
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
}
github microsoft / typescript-styled-plugin / lib / styled-string-language-service.js View on Github external
get languageService() {
        if (!this._languageService) {
            this._languageService = vscode_css_languageservice_1.getCSSLanguageService();
            this._languageService.configure(this.configuration);
        }
        return this._languageService;
    }
    getCompletionsAtPosition(contents, position, context) {
github forcedotcom / salesforcedx-vscode / packages / salesforcedx-visualforce-language-server / src / modes / cssMode.ts View on Github external
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);
    },
github microsoft / typescript-styled-plugin / src / vscode-language-service-adapter.ts View on Github external
private get languageService(): LanguageService {
        if (!this._languageService) {
            this._languageService = getCSSLanguageService();
        }
        return this._languageService;
    }
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._cssLanguageService) {
                this._cssLanguageService = vscode_css_languageservice_1.getCSSLanguageService();
                this._cssLanguageService.configure(this.configuration);
            }
            return this._cssLanguageService;
        },
        enumerable: true,
github marko-js / language-server / server / src / util / stylesheet.ts View on Github external
function cssParser(embeddedDoc:TextDocument, options: IAutocompleteArguments) {
    const languageService = getCSSLanguageService();
    return languageService.doComplete(embeddedDoc, options.position, languageService.parseStylesheet(embeddedDoc));
}
github vuejs / vetur / server / src / modes / style / index.ts View on Github external
export function getCSSMode(documentRegions: LanguageModelCache): LanguageMode {
  const languageService = getCSSLanguageService();
  return getStyleMode('css', languageService, documentRegions);
}