diff --git a/src/language-server/config/loadConfig.ts b/src/language-server/config/loadConfig.ts index 852f51bb..4a479177 100644 --- a/src/language-server/config/loadConfig.ts +++ b/src/language-server/config/loadConfig.ts @@ -22,7 +22,7 @@ const defaultFileNames = [ "package.json", `${MODULE_NAME}.config.js`, `${MODULE_NAME}.config.ts`, - `${MODULE_NAME}.config.cjs` + `${MODULE_NAME}.config.cjs`, ]; const envFileNames = [".env", ".env.local"]; diff --git a/src/language-server/server.ts b/src/language-server/server.ts index f912b718..3e4e64c4 100644 --- a/src/language-server/server.ts +++ b/src/language-server/server.ts @@ -132,7 +132,11 @@ documents.onDidChangeContent( connection.onDidChangeWatchedFiles((params) => { for (const { uri, type } of params.changes) { - if (uri.endsWith("apollo.config.js") || uri.endsWith("apollo.config.cjs") || uri.endsWith(".env")) { + if ( + uri.endsWith("apollo.config.js") || + uri.endsWith("apollo.config.cjs") || + uri.endsWith(".env") + ) { workspace.reloadProjectForConfig(uri); } diff --git a/src/language-server/workspace.ts b/src/language-server/workspace.ts index e6e25ff9..e61715ce 100644 --- a/src/language-server/workspace.ts +++ b/src/language-server/workspace.ts @@ -114,11 +114,14 @@ export class GraphQLWorkspace { -- ~/:user/server (GraphQLProject) as WorkspaceFolder */ - const apolloConfigFiles: string[] = fg.sync("**/apollo.config.@(js|ts|cjs)", { - cwd: URI.parse(folder.uri).fsPath, - absolute: true, - ignore: "**/node_modules/**", - }); + const apolloConfigFiles: string[] = fg.sync( + "**/apollo.config.@(js|ts|cjs)", + { + cwd: URI.parse(folder.uri).fsPath, + absolute: true, + ignore: "**/node_modules/**", + } + ); // only have unique possible folders const apolloConfigFolders = new Set(apolloConfigFiles.map(dirname));