Skip to content

Commit

Permalink
Merge pull request #123 from Nadyita/master
Browse files Browse the repository at this point in the history
  • Loading branch information
tm1000 authored Nov 15, 2021
2 parents b181217 + 95ac817 commit 428c658
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@
"default": null,
"description": "Optional (Advanced). If provided, this overrides the Psalm script to use, e.g. vendor/bin/psalm-language-server. (Modifying requires VSCode reload)"
},
"psalm.psalmScriptArgs": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"description": "Optional (Advanced). Additional arguments to the Psalm language server. (Modifying requires VSCode reload)"
},
"psalm.psalmClientScriptPath": {
"type": "string",
"default": null,
Expand Down
4 changes: 4 additions & 0 deletions src/ConfigurationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ export class ConfigurationService {
workspaceConfiguration.get<string>('psalmScriptPath') ||
join('vendor', 'vimeo', 'psalm', 'psalm-language-server');

this.config.psalmScriptArgs = workspaceConfiguration.get<string[]>(
'psalmScriptArgs'
) || [];

this.config.maxRestartCount =
workspaceConfiguration.get<number>('maxRestartCount') || 5;

Expand Down
10 changes: 10 additions & 0 deletions src/LanguageServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,16 @@ export class LanguageServer {
const languageServerVersion: string | null =
await this.getPsalmLanguageServerVersion();

const extraServerArgs = this.configurationService.get<string[]>(
'psalmScriptArgs'
);

if (extraServerArgs) {
if (Array.isArray(extraServerArgs)) {
args.unshift(...extraServerArgs);
}
}

const unusedVariableDetection = this.configurationService.get<boolean>(
'unusedVariableDetection'
);
Expand Down

0 comments on commit 428c658

Please sign in to comment.