Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
Princesseuh authored and astrobot-houston committed Mar 15, 2024
1 parent c1fa115 commit 8d45381
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/language-server/src/languageServerPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export function createServerOptions(
message: `Failed to load Prettier config.\n\nError:\n${e}`,
type: MessageType.Warning,
});
console.error('Failed to load Prettier config.', e)
console.error('Failed to load Prettier config.', e);
}

const editorOptions = await context.env.getConfiguration<object>?.(
Expand Down
14 changes: 10 additions & 4 deletions packages/language-server/test/misc/prettier-format.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ describe('Formatting - Prettier', () => {
});

it('Can ignore documents correctly', async () => {
const document = await languageServer.handle.openTextDocument(path.resolve(__dirname, '..', 'fixture', 'dontFormat.astro'), 'astro');
const document = await languageServer.handle.openTextDocument(
path.resolve(__dirname, '..', 'fixture', 'dontFormat.astro'),
'astro'
);
const formatEdits = await languageServer.handle.sendDocumentFormattingRequest(document.uri, {
tabSize: 2,
insertSpaces: true,
Expand All @@ -35,7 +38,10 @@ describe('Formatting - Prettier', () => {
});

it('Respect .editorconfig', async () => {
const document = await languageServer.handle.openTextDocument(path.resolve(__dirname, '..', 'fixture', 'editorConfig.astro'), 'astro');
const document = await languageServer.handle.openTextDocument(
path.resolve(__dirname, '..', 'fixture', 'editorConfig.astro'),
'astro'
);
const formatEdits = await languageServer.handle.sendDocumentFormattingRequest(document.uri, {
tabSize: 2,
insertSpaces: true,
Expand All @@ -44,8 +50,8 @@ describe('Formatting - Prettier', () => {
expect(formatEdits).to.deep.equal([
{
range: Range.create(0, 0, 3, 0),
newText: '<div>\r\n\t<div></div>\r\n</div>\r\n'
}
newText: '<div>\r\n\t<div></div>\r\n</div>\r\n',
},
]);
});
});

0 comments on commit 8d45381

Please sign in to comment.