Skip to content

Commit 19ccf02

Browse files
committed
feat(server): add custom node runtime support
1 parent 3cfb535 commit 19ccf02

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

package.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@
6464
"description": "A path used for resolving the @playlyfe/gql module. (default: workspaceFolder)",
6565
"default": "."
6666
},
67+
"graphqlForVSCode.runtime": {
68+
"scope": "resource",
69+
"type": [
70+
"string",
71+
"null"
72+
],
73+
"default": null,
74+
"description": "The location of the node binary to run gql-language-server under. (default: uses vscode bundled node)"
75+
},
6776
"graphqlForVSCode.loglevel": {
6877
"scope": "resource",
6978
"type": "string",
@@ -241,7 +250,7 @@
241250
"vscode": "1.1.35"
242251
},
243252
"dependencies": {
244-
"@playlyfe/gql-language-server": "0.2.0",
253+
"@playlyfe/gql-language-server": "0.3.0",
245254
"vscode-languageclient": "5.2.1"
246255
},
247256
"galleryBanner": {

src/extension.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ function createClientForWorkspace(folder: WorkspaceFolder): null | IClient {
7979
const outputChannel = window.createOutputChannel(`GraphQL - ${folder.name}`);
8080
// TODO: make it configurable
8181
const gqlconfigDir = resolvePath('.', folder);
82+
const runtime = config.get<string | undefined>('runtime', undefined);
8283

8384
// check can activate gql plugin
8485
// if config found in folder then activate
@@ -104,11 +105,13 @@ function createClientForWorkspace(folder: WorkspaceFolder): null | IClient {
104105
// Otherwise the run options are used
105106
const serverOptions: ServerOptions = {
106107
run: {
108+
runtime,
107109
module: GQL_LANGUAGE_SERVER_CLI_PATH,
108110
transport: TransportKind.ipc,
109111
args: gqlLanguageServerCliOptions,
110112
},
111113
debug: {
114+
runtime,
112115
module: GQL_LANGUAGE_SERVER_CLI_PATH,
113116
transport: TransportKind.ipc,
114117
args: gqlLanguageServerCliOptions,

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,10 @@
243243
universal-user-agent "^2.0.0"
244244
url-template "^2.0.8"
245245

246-
"@playlyfe/gql-language-server@0.2.0":
247-
version "0.2.0"
248-
resolved "https://registry.yarnpkg.com/@playlyfe/gql-language-server/-/gql-language-server-0.2.0.tgz#27516cd253a66fa63ea0e0fe679efd5284a3ad34"
249-
integrity sha512-Jk2U2bVzVkdv7aOYUn++39LUw/cQRAJEUht4lQLAV3gwxuDb0nkllrxhbGXmLFeyz54v6GcLLIPZAk4AOymntw==
246+
"@playlyfe/gql-language-server@0.3.0":
247+
version "0.3.0"
248+
resolved "https://registry.yarnpkg.com/@playlyfe/gql-language-server/-/gql-language-server-0.3.0.tgz#55fcdd179e002ee88cff3ae362e273f70fa27e73"
249+
integrity sha512-SCvo3ino5s1MRyIbqrXWhAgDpatyfZGwySWoWh73HH58+gB20OxrJCgQq34eXFR05eRE5uXV9HdcEsTAOJFEVA==
250250
dependencies:
251251
"@babel/polyfill" "7.4.4"
252252
"@babel/runtime" "7.4.5"

0 commit comments

Comments
 (0)