Skip to content
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

add separate option for disableProvideHover #286

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@
"default": false,
"description": "Enable to disable autocomplete on methods and properties (Modifying requires VSCode reload)"
},
"psalm.disableProvideHover": {
"type": "boolean",
"default": false,
"description": "Enable to disable the providing hover definition on methods and properties (Modifying requires VSCode reload)"
},
"psalm.configPaths": {
"type": "array",
"items": {
Expand Down
7 changes: 7 additions & 0 deletions src/ConfigurationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ interface Config {
psalmScriptPath?: string;
psalmScriptArgs?: string[];
disableAutoComplete: boolean;
disableProvideHover: boolean;
maxRestartCount: integer;
unusedVariableDetection: boolean;
enableVerbose: boolean;
Expand All @@ -28,6 +29,7 @@ export class ConfigurationService {
private config: Config = {
maxRestartCount: 5,
disableAutoComplete: false,
disableProvideHover: false,
unusedVariableDetection: false,
enableVerbose: false,
connectToServerWithTcp: false,
Expand Down Expand Up @@ -82,6 +84,11 @@ export class ConfigurationService {
false
);

this.config.disableProvideHover = workspaceConfiguration.get(
'disableProvideHover',
false
);

this.config.maxRestartCount = workspaceConfiguration.get(
'maxRestartCount',
5
Expand Down
8 changes: 8 additions & 0 deletions src/LanguageServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,14 @@ export class LanguageServer {
args.unshift('--enable-autocomplete=false');
}

const disableProvideHover = this.configurationService.get(
'disableProvideHover'
);

if (disableProvideHover) {
args.unshift('--enable-provide-hover=false');
}

// Are we running psalm or psalm-language-server
// if we are runing psalm them we need to forward to psalm-language-server
const psalmHasLanguageServerOption: boolean =
Expand Down