Skip to content

Commit

Permalink
run prettier (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
cy authored Aug 12, 2021
1 parent 5036d49 commit 61a0d69
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/language-server/config/loadConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"];

Expand Down
6 changes: 5 additions & 1 deletion src/language-server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
13 changes: 8 additions & 5 deletions src/language-server/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>(apolloConfigFiles.map(dirname));
Expand Down

0 comments on commit 61a0d69

Please sign in to comment.