Skip to content

Commit 531da52

Browse files
committed
chore: run prettier before config change
1 parent 0159523 commit 531da52

25 files changed

+147
-172
lines changed

packages/language-server/src/plugins/css/features/svelte-selectors.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import { IPseudoClassData } from 'vscode-css-languageservice';
33
export const pesudoClass: IPseudoClassData[] = [
44
{
55
name: ':global()',
6-
description:
7-
`[svelte] :global modifier
6+
description: `[svelte] :global modifier
87
98
Applying styles to a selector globally`,
109
references: [

packages/language-server/src/plugins/css/service.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,15 @@ const customDataProvider: ICSSDataProvider = {
2222
}
2323
};
2424

25-
const [css, scss, less] = [getCSSLanguageService, getSCSSLanguageService, getLESSLanguageService]
26-
.map(getService => getService({
25+
const [css, scss, less] = [
26+
getCSSLanguageService,
27+
getSCSSLanguageService,
28+
getLESSLanguageService
29+
].map((getService) =>
30+
getService({
2731
customDataProviders: [customDataProvider]
28-
}));
32+
})
33+
);
2934

3035
const langs = {
3136
css,

packages/language-server/src/plugins/html/dataProvider.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ const mediaAttributes: IAttributeData[] = [
221221
},
222222
{
223223
name: 'bind:playbackRate',
224-
description: 'how fast or slow to play the video, where 1 is \'normal\''
224+
description: "how fast or slow to play the video, where 1 is 'normal'"
225225
},
226226
{
227227
name: 'bind:paused'
@@ -256,14 +256,14 @@ const addAttributes: Record<string, IAttributeData[]> = {
256256
{ name: 'bind:value' },
257257
{ name: 'bind:group', description: 'Available for type="radio" and type="checkbox"' },
258258
indeterminateAttribute,
259-
{...indeterminateAttribute, name: 'bind:indeterminate'}
259+
{ ...indeterminateAttribute, name: 'bind:indeterminate' }
260260
],
261261
textarea: [{ name: 'bind:value' }],
262262
video: [...mediaAttributes, ...videoAttributes],
263263
audio: [...mediaAttributes]
264264
};
265265

266-
const html5Tags = htmlData.tags!.map(tag => {
266+
const html5Tags = htmlData.tags!.map((tag) => {
267267
let attributes = tag.attributes.map(mapToSvelteEvent);
268268
if (addAttributes[tag.name]) {
269269
attributes = [...attributes, ...addAttributes[tag.name]];

packages/language-server/src/plugins/interfaces.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export interface SignatureHelpProvider {
134134
document: Document,
135135
position: Position,
136136
context: SignatureHelpContext | undefined
137-
): Resolvable<SignatureHelp | null>
137+
): Resolvable<SignatureHelp | null>;
138138
}
139139

140140
export interface SelectionRangeProvider {

packages/language-server/src/plugins/typescript/LSAndTSDocResolver.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,10 @@ export class LSAndTSDocResolver {
103103
}
104104

105105
private getUserPreferences(scriptKind: ts.ScriptKind): ts.UserPreferences {
106-
const configLang = scriptKind === ts.ScriptKind.TS || scriptKind === ts.ScriptKind.TSX
107-
? 'typescript' : 'javascript';
106+
const configLang =
107+
scriptKind === ts.ScriptKind.TS || scriptKind === ts.ScriptKind.TSX
108+
? 'typescript'
109+
: 'javascript';
108110

109111
return this.configManager.getTsUserPreferences(configLang);
110112
}

packages/language-server/src/plugins/typescript/TypeScriptPlugin.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,7 @@ export class TypeScriptPlugin
9595
workspaceUris: string[]
9696
) {
9797
this.configManager = configManager;
98-
this.lsAndTsDocResolver = new LSAndTSDocResolver(
99-
docManager,
100-
workspaceUris,
101-
configManager
102-
);
98+
this.lsAndTsDocResolver = new LSAndTSDocResolver(docManager, workspaceUris, configManager);
10399
this.completionProvider = new CompletionsProviderImpl(this.lsAndTsDocResolver);
104100
this.codeActionsProvider = new CodeActionsProviderImpl(
105101
this.lsAndTsDocResolver,
@@ -392,7 +388,9 @@ export class TypeScriptPlugin
392388
}
393389

394390
async getSignatureHelp(
395-
document: Document, position: Position, context: SignatureHelpContext | undefined
391+
document: Document,
392+
position: Position,
393+
context: SignatureHelpContext | undefined
396394
): Promise<SignatureHelp | null> {
397395
if (!this.featureEnabled('signatureHelp')) {
398396
return null;

packages/language-server/src/plugins/typescript/features/DiagnosticsProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ function enhanceIfNecessary(diagnostic: Diagnostic): Diagnostic {
130130
message:
131131
'Type definitions are missing for this Svelte Component. ' +
132132
// eslint-disable-next-line max-len
133-
'It needs a class definition with at least the property \'$$prop_def\' which should contain a map of input property definitions.\n' +
133+
"It needs a class definition with at least the property '$$prop_def' which should contain a map of input property definitions.\n" +
134134
'Example:\n' +
135135
'class ComponentName { $$prop_def: { propertyName: string; } }\n\n' +
136136
diagnostic.message

packages/language-server/src/plugins/typescript/features/RenameProvider.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@ export class RenameProviderImpl implements RenameProvider {
5656
}
5757

5858
const docs = new Map<string, SnapshotFragment>([[tsDoc.filePath, fragment]]);
59-
let convertedRenameLocations: Array<ts.RenameLocation & {
60-
range: Range;
61-
}> = await this.mapAndFilterRenameLocations(renameLocations, docs);
59+
let convertedRenameLocations: Array<
60+
ts.RenameLocation & {
61+
range: Range;
62+
}
63+
> = await this.mapAndFilterRenameLocations(renameLocations, docs);
6264
// eslint-disable-next-line max-len
6365
const additionalRenameForPropRenameInsideComponentWithProp = await this.getAdditionLocationsForRenameOfPropInsideComponentWithProp(
6466
document,

packages/language-server/src/plugins/typescript/features/SelectionRangeProvider.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ export class SelectionRangeProviderImpl implements SelectionRangeProvider {
3636
};
3737
}
3838

39-
private filterOutUnmappedRange(
40-
selectionRange: SelectionRange
41-
): SelectionRange | null {
39+
private filterOutUnmappedRange(selectionRange: SelectionRange): SelectionRange | null {
4240
const flattened = this.flattenAndReverseSelectionRange(selectionRange);
4341
const filtered = flattened.filter((range) => range.start.line > 0 && range.end.line > 0);
4442
if (!filtered.length) {
@@ -54,7 +52,6 @@ export class SelectionRangeProviderImpl implements SelectionRangeProvider {
5452
return result ?? null;
5553
}
5654

57-
5855
/**
5956
* flatten the selection range and its parent to an array in reverse order
6057
* so it's easier to filter out unmapped selection and create a new tree of

packages/language-server/src/plugins/typescript/features/SignatureHelpProvider.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { LSAndTSDocResolver } from '../LSAndTSDocResolver';
1414
import { getMarkdownDocumentation } from '../previewer';
1515

1616
export class SignatureHelpProviderImpl implements SignatureHelpProvider {
17-
constructor(private readonly lsAndTsDocResolver: LSAndTSDocResolver) { }
17+
constructor(private readonly lsAndTsDocResolver: LSAndTSDocResolver) {}
1818

1919
private static readonly triggerCharacters = ['(', ',', '<'];
2020
private static readonly retriggerCharacters = [')'];
@@ -41,8 +41,7 @@ export class SignatureHelpProviderImpl implements SignatureHelpProvider {
4141
return null;
4242
}
4343

44-
const signatures = info.items
45-
.map(this.toSignatureHelpInformation);
44+
const signatures = info.items.map(this.toSignatureHelpInformation);
4645

4746
return {
4847
signatures,
@@ -134,18 +133,19 @@ export class SignatureHelpProviderImpl implements SignatureHelpProvider {
134133

135134
return {
136135
label: prefixLabel + signatureLabel + suffixLabel,
137-
documentation: signatureDocumentation ? {
138-
value: signatureDocumentation,
139-
kind: MarkupKind.Markdown
140-
} : undefined,
136+
documentation: signatureDocumentation
137+
? {
138+
value: signatureDocumentation,
139+
kind: MarkupKind.Markdown
140+
}
141+
: undefined,
141142
parameters
142143
};
143144
}
144145

145-
private isInSvelte2tsxGeneratedFunction(
146-
signatureHelpItem: ts.SignatureHelpItem
147-
) {
148-
return signatureHelpItem.prefixDisplayParts
149-
.some((part) => part.text.includes('__sveltets'));
146+
private isInSvelte2tsxGeneratedFunction(signatureHelpItem: ts.SignatureHelpItem) {
147+
return signatureHelpItem.prefixDisplayParts.some((part) =>
148+
part.text.includes('__sveltets')
149+
);
150150
}
151151
}

0 commit comments

Comments
 (0)