-
Notifications
You must be signed in to change notification settings - Fork 764
Add option for overriding GOMEMLIMIT
#1808
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
7f45727
e336e76
72e6452
5d58a90
697ec86
e0f1bb7
d62cbcd
fcac93b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -103,16 +103,29 @@ export class Client { | |
| const pprofDir = config.get<string>("pprofDir"); | ||
| const pprofArgs = pprofDir ? ["--pprofDir", pprofDir] : []; | ||
|
|
||
| const goMemLimit = config.get<string>("goMemLimit"); | ||
jakebailey marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| if (goMemLimit) { | ||
| // Keep this regex aligned with the pattern in package.json. | ||
| if (!/^[0-9]+(([KMGT]i)?B)?$/.test(goMemLimit)) { | ||
| this.outputChannel.error(`Invalid goMemLimit: ${goMemLimit}. Must be a valid memory limit (e.g., '2048MiB', '4GiB'). Not overriding GOMEMLIMIT.`); | ||
|
||
| } else { | ||
| this.outputChannel.appendLine(`Setting GOMEMLIMIT=${goMemLimit}`); | ||
| } | ||
| } | ||
| const env = goMemLimit ? { ...process.env, GOMEMLIMIT: goMemLimit } : process.env; | ||
|
|
||
| const serverOptions: ServerOptions = { | ||
| run: { | ||
| command: this.exe.path, | ||
| args: ["--lsp", ...pprofArgs], | ||
| transport: TransportKind.stdio, | ||
| options: { env }, | ||
| }, | ||
| debug: { | ||
| command: this.exe.path, | ||
| args: ["--lsp", ...pprofArgs], | ||
| transport: TransportKind.stdio, | ||
| options: { env }, | ||
| }, | ||
| }; | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.