Language Server
The language server reference for Master CSS.
Installation
npm i @master/css-language-server
Basic usage
Create a language server
The main body of this package is the class CSSLanguageServer
, which is built on top of VSCode Language Server.
import CSSLanguageServer from '@master/css-language-server'const languageServer = new CSSLanguageServer(connection, customSettings)
Check out the source code for arguments and properties.
API Reference
settings
The default language server settings. It inherits the language service settings.
import { settings } from '@master/css-language-server'
settings.workspaces
Specify the workspace where the independent CSSLanguageService
should be created, always including the root workspace. See the Monorepo documentation to understand the purpose of this option.
Type | FastGlobPattern[] | 'auto' |
---|---|
Default | auto |
By default auto
, a new workspace is automatically created based on the location of the master.css.*
configuration file.
Automatically create /
and /apps/a
workspaces.
A root workspace will still be automatically created without a root configuration.
In most cases, keeping the default 'auto'
is sufficient, but you can also manually specify the workspace.
Specify /apps/b
as a workspace:
{ workspaces: ['apps/b']}
It creates /
and /apps/b
workspaces.
settings.verbose
Print all console logs.
Type | boolean |
---|---|
Default | false |