Skip to content

Commit dbbbd1f

Browse files
committed
Add reveal output option
1 parent c3148b4 commit dbbbd1f

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,17 @@
2929
"default": "phpactor",
3030
"description": "phpactor bin path"
3131
},
32+
"phpactor.revealOutputChannelOn": {
33+
"type": "string",
34+
"enum": [
35+
"info",
36+
"warn",
37+
"error",
38+
"never"
39+
],
40+
"default": "never",
41+
"description": "Specifies message severity on which the output channel will be revealed."
42+
},
3243
"phpactor.enable": {
3344
"type": "boolean",
3445
"default": true,

src/extension.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import {
44
ServerOptions,
55
workspace,
66
LanguageClientOptions,
7-
commands
7+
commands,
8+
RevealOutputChannelOn
89
} from "coc.nvim";
910

1011
const LanguageID = 'php';
@@ -51,6 +52,7 @@ function createClient(config: any): LanguageClient {
5152
{ language: LanguageID, scheme: 'file' },
5253
{ language: LanguageID, scheme: 'untitled' }
5354
],
55+
revealOutputChannelOn: fromStringToRevealOutputChannelOn(config.revealOutputChannelOn),
5456
initializationOptions: config.config
5557
};
5658

@@ -100,3 +102,17 @@ function status(): void {
100102

101103
languageClient.sendRequest('system/status');
102104
}
105+
106+
function fromStringToRevealOutputChannelOn(value: string): RevealOutputChannelOn {
107+
switch (value && value.toLowerCase()) {
108+
case 'info':
109+
return RevealOutputChannelOn.Info
110+
case 'warn':
111+
return RevealOutputChannelOn.Warn
112+
case 'error':
113+
return RevealOutputChannelOn.Error
114+
case 'never':
115+
default:
116+
return RevealOutputChannelOn.Never
117+
}
118+
}

0 commit comments

Comments
 (0)