* Combine arguments with defaults.
(args: string[])
| 224 | * Combine arguments with defaults. |
| 225 | */ |
| 226 | private async argsWithDefaults(args: string[]): Promise<string[]> { |
| 227 | // This will be used both as the workspace and data directory to ensure |
| 228 | // instances don't bleed into each other. |
| 229 | const dir = await this.workspaceDir |
| 230 | return [ |
| 231 | this.entry, |
| 232 | "--extensions-dir", |
| 233 | path.join(dir, "extensions"), |
| 234 | ...args, |
| 235 | // Setting the XDG variables would be easier and more thorough but the |
| 236 | // modules we import ignores those variables for non-Linux operating |
| 237 | // systems so use these flags instead. |
| 238 | "--config", |
| 239 | path.join(dir, "config.yaml"), |
| 240 | "--user-data-dir", |
| 241 | dir, |
| 242 | ] |
| 243 | } |
| 244 | |
| 245 | /** |
| 246 | * Close the code-server process. |