vscode-css-languageservice 5.1.13 → 5.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/lib/esm/beautify/beautify-css.js +1605 -0
- package/lib/esm/cssLanguageService.d.ts +2 -1
- package/lib/esm/cssLanguageService.js +2 -0
- package/lib/esm/cssLanguageTypes.d.ts +26 -0
- package/lib/esm/data/webCustomData.js +145 -139
- package/lib/esm/parser/cssNodes.js +28 -0
- package/lib/esm/parser/cssParser.js +24 -1
- package/lib/esm/parser/cssScanner.js +36 -0
- package/lib/esm/services/cssFormatter.js +136 -0
- package/lib/esm/utils/strings.js +11 -0
- package/lib/umd/beautify/beautify-css.js +1628 -0
- package/lib/umd/cssLanguageService.d.ts +2 -1
- package/lib/umd/cssLanguageService.js +3 -1
- package/lib/umd/cssLanguageTypes.d.ts +26 -0
- package/lib/umd/data/webCustomData.js +145 -139
- package/lib/umd/parser/cssNodes.js +29 -1
- package/lib/umd/parser/cssParser.js +24 -1
- package/lib/umd/parser/cssScanner.js +36 -0
- package/lib/umd/services/cssFormatter.js +150 -0
- package/lib/umd/utils/strings.js +13 -1
- package/package.json +14 -10
- package/thirdpartynotices.txt +29 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LanguageSettings, ICompletionParticipant, DocumentContext, LanguageServiceOptions, Diagnostic, Position, CompletionList, Hover, Location, DocumentHighlight, DocumentLink, SymbolInformation, Range, CodeActionContext, Command, CodeAction, ColorInformation, Color, ColorPresentation, WorkspaceEdit, FoldingRange, SelectionRange, TextDocument, ICSSDataProvider, CSSDataV1, HoverSettings, CompletionSettings } from './cssLanguageTypes';
|
|
1
|
+
import { LanguageSettings, ICompletionParticipant, DocumentContext, LanguageServiceOptions, Diagnostic, Position, CompletionList, Hover, Location, DocumentHighlight, DocumentLink, SymbolInformation, Range, CodeActionContext, Command, CodeAction, ColorInformation, Color, ColorPresentation, WorkspaceEdit, FoldingRange, SelectionRange, TextDocument, ICSSDataProvider, CSSDataV1, HoverSettings, CompletionSettings, TextEdit, CSSFormatConfiguration } from './cssLanguageTypes';
|
|
2
2
|
export declare type Stylesheet = {};
|
|
3
3
|
export * from './cssLanguageTypes';
|
|
4
4
|
export interface LanguageService {
|
|
@@ -28,6 +28,7 @@ export interface LanguageService {
|
|
|
28
28
|
rangeLimit?: number;
|
|
29
29
|
}): FoldingRange[];
|
|
30
30
|
getSelectionRanges(document: TextDocument, positions: Position[], stylesheet: Stylesheet): SelectionRange[];
|
|
31
|
+
format(document: TextDocument, range: Range | undefined, options: CSSFormatConfiguration): TextEdit[];
|
|
31
32
|
}
|
|
32
33
|
export declare function getDefaultCSSDataProvider(): ICSSDataProvider;
|
|
33
34
|
export declare function newCSSDataProvider(data: CSSDataV1): ICSSDataProvider;
|
|
@@ -14,6 +14,7 @@ import { SCSSCompletion } from './services/scssCompletion';
|
|
|
14
14
|
import { LESSParser } from './parser/lessParser';
|
|
15
15
|
import { LESSCompletion } from './services/lessCompletion';
|
|
16
16
|
import { getFoldingRanges } from './services/cssFolding';
|
|
17
|
+
import { format } from './services/cssFormatter';
|
|
17
18
|
import { CSSDataManager } from './languageFacts/dataManager';
|
|
18
19
|
import { CSSDataProvider } from './languageFacts/dataProvider';
|
|
19
20
|
import { getSelectionRanges } from './services/cssSelectionRange';
|
|
@@ -40,6 +41,7 @@ function createFacade(parser, completion, hover, navigation, codeActions, valida
|
|
|
40
41
|
doComplete2: completion.doComplete2.bind(completion),
|
|
41
42
|
setCompletionParticipants: completion.setCompletionParticipants.bind(completion),
|
|
42
43
|
doHover: hover.doHover.bind(hover),
|
|
44
|
+
format: format,
|
|
43
45
|
findDefinition: navigation.findDefinition.bind(navigation),
|
|
44
46
|
findReferences: navigation.findReferences.bind(navigation),
|
|
45
47
|
findDocumentHighlights: navigation.findDocumentHighlights.bind(navigation),
|
|
@@ -210,3 +210,29 @@ export interface FileSystemProvider {
|
|
|
210
210
|
stat(uri: DocumentUri): Promise<FileStat>;
|
|
211
211
|
readDirectory?(uri: DocumentUri): Promise<[string, FileType][]>;
|
|
212
212
|
}
|
|
213
|
+
export interface CSSFormatConfiguration {
|
|
214
|
+
/** indentation size. Default: 4 */
|
|
215
|
+
tabSize?: number;
|
|
216
|
+
/** Whether to use spaces or tabs */
|
|
217
|
+
insertSpaces?: boolean;
|
|
218
|
+
/** end with a newline: Default: false */
|
|
219
|
+
insertFinalNewline?: boolean;
|
|
220
|
+
/** separate selectors with newline (e.g. "a,\nbr" or "a, br"): Default: true */
|
|
221
|
+
newlineBetweenSelectors?: boolean;
|
|
222
|
+
/** add a new line after every css rule: Default: true */
|
|
223
|
+
newlineBetweenRules?: boolean;
|
|
224
|
+
/** ensure space around selector separators: '>', '+', '~' (e.g. "a>b" -> "a > b"): Default: false */
|
|
225
|
+
spaceAroundSelectorSeparator?: boolean;
|
|
226
|
+
/** put braces on the same line as rules (`collapse`), or put braces on own line, Allman / ANSI style (`expand`). Default `collapse` */
|
|
227
|
+
braceStyle?: 'collapse' | 'expand';
|
|
228
|
+
/** whether existing line breaks before elements should be preserved. Default: true */
|
|
229
|
+
preserveNewLines?: boolean;
|
|
230
|
+
/** maximum number of line breaks to be preserved in one chunk. Default: unlimited */
|
|
231
|
+
maxPreserveNewLines?: number;
|
|
232
|
+
/** maximum amount of characters per line (0/undefined = disabled). Default: disabled. */
|
|
233
|
+
wrapLineLength?: number;
|
|
234
|
+
/** add indenting whitespace to empty lines. Default: false */
|
|
235
|
+
indentEmptyLines?: boolean;
|
|
236
|
+
/** @deprecated Use newlineBetweenSelectors instead*/
|
|
237
|
+
selectorSeparatorNewline?: boolean;
|
|
238
|
+
}
|