volar-service-css
Advanced tools
Comparing version 0.0.31 to 0.0.32
@@ -1,2 +0,2 @@ | ||
import type { Disposable, DocumentSelector, Result, ServiceContext, ServicePlugin } from '@volar/language-service'; | ||
import type { Disposable, DocumentSelector, FormattingOptions, Result, ServiceContext, ServicePlugin } from '@volar/language-service'; | ||
import * as css from 'vscode-css-languageservice'; | ||
@@ -8,3 +8,3 @@ import { TextDocument } from 'vscode-languageserver-textdocument'; | ||
} | ||
export declare function create({ cssDocumentSelector, scssDocumentSelector, lessDocumentSelector, useDefaultDataProvider, getDocumentContext, isFormattingEnabled, getFormatConfiguration, getLanguageSettings, getCustomData, onDidChangeCustomData, }?: { | ||
export declare function create({ cssDocumentSelector, scssDocumentSelector, lessDocumentSelector, useDefaultDataProvider, getDocumentContext, isFormattingEnabled, getFormattingOptions, getLanguageSettings, getCustomData, onDidChangeCustomData, }?: { | ||
cssDocumentSelector?: DocumentSelector; | ||
@@ -16,3 +16,3 @@ scssDocumentSelector?: DocumentSelector; | ||
isFormattingEnabled?(document: TextDocument, context: ServiceContext): Result<boolean>; | ||
getFormatConfiguration?(document: TextDocument, context: ServiceContext): Result<css.CSSFormatConfiguration | undefined>; | ||
getFormattingOptions?(document: TextDocument, options: FormattingOptions, context: ServiceContext): Result<css.CSSFormatConfiguration>; | ||
getLanguageSettings?(document: TextDocument, context: ServiceContext): Result<css.LanguageSettings | undefined>; | ||
@@ -19,0 +19,0 @@ getCustomData?(context: ServiceContext): Result<css.ICSSDataProvider[]>; |
13
index.js
@@ -28,4 +28,7 @@ "use strict"; | ||
return await context.env.getConfiguration?.(document.languageId + '.format.enable') ?? true; | ||
}, getFormatConfiguration = async (document, context) => { | ||
return await context.env.getConfiguration?.(document.languageId + '.format'); | ||
}, getFormattingOptions = async (document, options, context) => { | ||
return { | ||
...options, | ||
...await context.env.getConfiguration?.(document.languageId + '.format'), | ||
}; | ||
}, getLanguageSettings = async (document, context) => { | ||
@@ -174,7 +177,3 @@ return await context.env.getConfiguration?.(document.languageId); | ||
} | ||
const formatSettings = await getFormatConfiguration(document, context); | ||
const formatOptions = { | ||
...options, | ||
...formatSettings, | ||
}; | ||
const formatOptions = await getFormattingOptions(document, options, context); | ||
let formatDocument = document; | ||
@@ -181,0 +180,0 @@ let prefixes = []; |
{ | ||
"name": "volar-service-css", | ||
"version": "0.0.31", | ||
"version": "0.0.32", | ||
"description": "Integrate vscode-css-languageservice into Volar", | ||
@@ -42,3 +42,3 @@ "homepage": "https://github.com/volarjs/services/tree/master/packages/css", | ||
}, | ||
"gitHead": "f7005aef724767786ee9fe943fa976231cc79bf1" | ||
"gitHead": "717049e7dcd5c30f451f6db8eb71eaba43f74c83" | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
20996
350