Skip to content

Commit

Permalink
fix: fix the configuration file .cjs suffix does not support the bug (#…
Browse files Browse the repository at this point in the history
…97)

* fix: fix the configuration file .cjs suffix does not support the bug

* chore: add changeset

---------

Co-authored-by: chenlinfeng <chenlinfeng@apexsoft.com.cn>
Co-authored-by: Alessia Bellisario <github@bellisar.io>
  • Loading branch information
3 people committed Oct 16, 2023
1 parent 8b02374 commit 2b57a1a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/many-garlics-remain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vscode-apollo": patch
---

Support configuration files with .cjs file extension
2 changes: 1 addition & 1 deletion src/language-server/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export class ApolloConfig {

get configDirURI() {
// if the filepath has a _file_ in it, then we get its dir
return this.configURI && this.configURI.fsPath.match(/\.(ts|js|json)$/i)
return this.configURI && this.configURI.fsPath.match(/\.(ts|js|cjs|json)$/i)
? URI.parse(dirname(this.configURI.fsPath))
: this.configURI;
}
Expand Down

0 comments on commit 2b57a1a

Please sign in to comment.