Skip to content

Commit

Permalink
fix: bypass parsing bugs to continue plucking tags (#3322)
Browse files Browse the repository at this point in the history
  • Loading branch information
acao committed Jul 5, 2023
1 parent 4708968 commit 6939bac
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .changeset/hip-snails-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'graphql-language-service-server': patch
'graphql-language-service-cli': patch
'vscode-graphql': patch
---

Bypass babel typescript parsing errors to continue extracting graphql strings
4 changes: 2 additions & 2 deletions packages/graphql-language-service-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"graphql": "^15.5.0 || ^16.0.0"
},
"dependencies": {
"@babel/parser": "^7.21.2",
"@babel/types": "^7.21.2",
"@babel/parser": "^7.22.6",
"@babel/types": "^7.22.5",
"@graphql-tools/code-file-loader": "8.0.1",
"@vue/compiler-sfc": "^3.2.41",
"dotenv": "8.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ const PARSER_OPTIONS: ParserOptions = {
allowImportExportEverywhere: true,
allowReturnOutsideFunction: true,
allowSuperOutsideMethod: true,
allowAwaitOutsideFunction: true,
// important! this allows babel to keep parsing when there are issues
errorRecovery: true,
sourceType: 'module',
strictMode: false,
};
Expand Down Expand Up @@ -65,7 +68,7 @@ const BABEL_PLUGINS: ParserPlugin[] = [
'objectRestSpread',
'optionalCatchBinding',
'optionalChaining',
['pipelineOperator', { proposal: 'minimal' }],
// ['pipelineOperator', { proposal: 'hack' }],
'privateIn',
'regexpUnicodeSets',
'throwExpressions',
Expand Down
7 changes: 6 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,11 @@
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.21.2.tgz#dacafadfc6d7654c3051a66d6fe55b6cb2f2a0b3"
integrity sha512-URpaIJQwEkEC2T9Kn+Ai6Xe/02iNaVCuT/PtoRz3GPVJVDpPd7mLo+VddTbhCRU9TXqW5mSrQfXZyi8kDKOVpQ==

"@babel/parser@^7.22.6":
version "7.22.6"
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.22.6.tgz#201f8b47be20c76c7c5743b9c16129760bf9a975"
integrity sha512-EIQu22vNkceq3LbjAq7knDf/UmtI2qbcNI8GRBlijez6TpQLvSodJPYfydQmNA5buwkxxxa/PVI44jjYZ+/cLw==

"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.18.6":
version "7.18.6"
resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.18.6.tgz#da5b8f9a580acdfbe53494dba45ea389fb09a4d2"
Expand Down Expand Up @@ -1654,7 +1659,7 @@
"@babel/helper-validator-identifier" "^7.16.7"
to-fast-properties "^2.0.0"

"@babel/types@^7.16.8", "@babel/types@^7.21.3", "@babel/types@^7.22.5":
"@babel/types@^7.16.8", "@babel/types@^7.21.3", "@babel/types@^7.22.5", "@babel/types@^7.22.6":
version "7.22.5"
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.22.5.tgz#cd93eeaab025880a3a47ec881f4b096a5b786fbe"
integrity sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==
Expand Down

0 comments on commit 6939bac

Please sign in to comment.