Skip to content

Commit 75c3d00

Browse files
JakeDawkinsessaji
authored andcommitted
Fix config path parsing with ts files (apollographql#1463)
1 parent c14d24b commit 75c3d00

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
- `apollo-graphql`
2020
- <First `apollo-graphql` related entry goes here>
2121
- `apollo-language-server`
22-
- Fix issue where fragment definitions only included in `@client` fields would not be stripped ((AP-682)(https://golinks.io/AP-682), [#1454](https://github.com/apollographql/apollo-tooling/pull/1454))
22+
- Fix dirname parsing for ts config files [#1463](https://github.com/apollographql/apollo-tooling/pull/1463)
2323
- `apollo-tools`
2424
- <First `apollo-tools` related entry goes here>
2525
- `vscode-apollo`

packages/apollo-language-server/src/config/config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ export class ApolloConfig {
147147
}
148148

149149
get configDirURI() {
150-
return this.configURI && this.configURI.fsPath.includes(".js")
150+
// if the filepath has a _file_ in it, then we get its dir
151+
return this.configURI && this.configURI.fsPath.match(/\.(ts|js|json)$/i)
151152
? URI.parse(dirname(this.configURI.fsPath))
152153
: this.configURI;
153154
}

0 commit comments

Comments
 (0)