@astrojs/language-server 2.8.1 → 2.8.3

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.
@@ -88,12 +88,23 @@ function createServerOptions(connection, ts) {
88
88
  }
89
89
  }, {
90
90
  documentSelector: ['astro'],
91
- getFormattingOptions: async (prettier, document, formatOptions, context) => {
91
+ getFormattingOptions: async (prettierInstance, document, formatOptions, context) => {
92
92
  const filePath = vscode_uri_1.URI.parse(document.uri).fsPath;
93
- const configOptions = await prettier.resolveConfig(filePath, {
94
- // This seems to be broken since Prettier 3, and it'll always use its cumbersome cache. Hopefully it works one day.
95
- useCache: false,
96
- });
93
+ let configOptions = null;
94
+ try {
95
+ configOptions = await prettierInstance.resolveConfig(filePath, {
96
+ // This seems to be broken since Prettier 3, and it'll always use its cumbersome cache. Hopefully it works one day.
97
+ useCache: false,
98
+ editorconfig: true,
99
+ });
100
+ }
101
+ catch (e) {
102
+ connection.sendNotification(node_1.ShowMessageNotification.type, {
103
+ message: `Failed to load Prettier config.\n\nError:\n${e}`,
104
+ type: node_1.MessageType.Warning,
105
+ });
106
+ console.error('Failed to load Prettier config.', e);
107
+ }
97
108
  const editorOptions = await context.env.getConfiguration?.('prettier', document.uri);
98
109
  // Return a config with the following cascade:
99
110
  // - Prettier config file should always win if it exists, if it doesn't:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrojs/language-server",
3
- "version": "2.8.1",
3
+ "version": "2.8.3",
4
4
  "author": "withastro",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -28,12 +28,12 @@
28
28
  "@volar/language-service": "~2.1.2",
29
29
  "@volar/typescript": "~2.1.2",
30
30
  "fast-glob": "^3.2.12",
31
- "volar-service-css": "0.0.32",
32
- "volar-service-emmet": "0.0.32",
33
- "volar-service-html": "0.0.32",
34
- "volar-service-prettier": "0.0.32",
35
- "volar-service-typescript": "0.0.32",
36
- "volar-service-typescript-twoslash-queries": "0.0.32",
31
+ "volar-service-css": "0.0.34",
32
+ "volar-service-emmet": "0.0.34",
33
+ "volar-service-html": "0.0.34",
34
+ "volar-service-prettier": "0.0.34",
35
+ "volar-service-typescript": "0.0.34",
36
+ "volar-service-typescript-twoslash-queries": "0.0.34",
37
37
  "vscode-html-languageservice": "^5.1.2",
38
38
  "vscode-uri": "^3.0.8"
39
39
  },