Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Change Log

## [Unreleased]
## 0.0.11
- new setting "dyalogEnvVars" to set up environment variables that get passed to the interpreter

## 0.0.10
- update dependencies
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ This extension has the configuration options listed below:
"apl.server.executablePath": "dyalog.exe",
"apl.server.maxWS": "4G",
"apl.server.prefixCompleteCharacters": "`",
"apl.server.wsPath": "/my/own/apl-language-server.dws"
"apl.server.wsPath": "/my/own/apl-language-server.dws",
"apl.server.dyalogEnvVars": {}
}
```

Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@
"default": null,
"description": "The full path to a Dyalog executable (including the name of the binary)."
},
"apl.server.dyalogEnvVars": {
"type": "object",
"default": null,
"description": "Optional environment variables for the interpreter's environment (might be used for configuration)"
},
"apl.server.wsPath": {
"type": [
"string",
Expand Down
8 changes: 5 additions & 3 deletions src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
'use strict';

import {
Expand Down Expand Up @@ -44,6 +44,7 @@ export async function activate(context: ExtensionContext) {

const serverPath = conf.get<string>('wsPath') ||
context.asAbsolutePath(path.join('server', 'apl-language-server.dws'));
const dyalogEnvVars = conf.get('dyalogEnvVars');

const serverOptions = () => new Promise<ChildProcess | StreamInfo>((resolve) => {
// Use a TCP socket because of problems with blocking STDIO
Expand Down Expand Up @@ -87,6 +88,7 @@ export async function activate(context: ExtensionContext) {
AUTOCOMPLETE_PREFIXSIZE: 0,
LSP_TCP: hp,
},
dyalogEnvVars, // these will override the previous defaults
),
},
);
Expand Down