mirror of
https://github.com/open-goal/opengoal-vscode.git
synced 2024-10-19 20:47:37 -04:00
lsp: add settings to customize the logging location (#123)
This commit is contained in:
parent
684d91b1f9
commit
accf8e4224
18
package.json
18
package.json
|
@ -211,18 +211,24 @@
|
||||||
"title": "LSP",
|
"title": "LSP",
|
||||||
"properties": {
|
"properties": {
|
||||||
"opengoal.launchLspOnStartup": {
|
"opengoal.launchLspOnStartup": {
|
||||||
"type": [
|
"type": "boolean",
|
||||||
"boolean"
|
|
||||||
],
|
|
||||||
"default": true,
|
"default": true,
|
||||||
"description": "Whether or not the LSP should be started automatically"
|
"description": "Whether or not the LSP should be started automatically"
|
||||||
},
|
},
|
||||||
"opengoal.opengoalLspPath": {
|
"opengoal.opengoalLspPath": {
|
||||||
"type": [
|
"type": "string",
|
||||||
"string"
|
|
||||||
],
|
|
||||||
"default": "",
|
"default": "",
|
||||||
"description": "Hardcode a path to the LSP executable"
|
"description": "Hardcode a path to the LSP executable"
|
||||||
|
},
|
||||||
|
"opengoal.opengoalLspLogPath": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "",
|
||||||
|
"description": "Provide a path that the LSP should log it's debugging info to"
|
||||||
|
},
|
||||||
|
"opengoal.opengoalLspLogVerbose": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": "",
|
||||||
|
"description": "Should the LSP logging be verbose?"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -7,6 +7,9 @@ export function getConfig() {
|
||||||
launchLspOnStartup: configOptions.get<boolean>("launchLspOnStartup"),
|
launchLspOnStartup: configOptions.get<boolean>("launchLspOnStartup"),
|
||||||
opengoalLspVersion: configOptions.get<string>("opengoalLspVersion"),
|
opengoalLspVersion: configOptions.get<string>("opengoalLspVersion"),
|
||||||
opengoalLspPath: configOptions.get<string>("opengoalLspPath"),
|
opengoalLspPath: configOptions.get<string>("opengoalLspPath"),
|
||||||
|
opengoalLspLogPath: configOptions.get<string>("opengoalLspLogPath"),
|
||||||
|
opengoalLspLogVerbose: configOptions.get<boolean>("opengoalLspLogVerbose"),
|
||||||
|
|
||||||
eeManPagePath: configOptions.get<string>("eeManPagePath"),
|
eeManPagePath: configOptions.get<string>("eeManPagePath"),
|
||||||
vuManPagePath: configOptions.get<string>("vuManPagePath"),
|
vuManPagePath: configOptions.get<string>("vuManPagePath"),
|
||||||
decompilerPath: configOptions.get<string>("decompilerPath"),
|
decompilerPath: configOptions.get<string>("decompilerPath"),
|
||||||
|
|
|
@ -120,20 +120,23 @@ async function maybeDownloadLspServer(): Promise<void> {
|
||||||
}
|
}
|
||||||
|
|
||||||
function createClient(lspPath: string): LanguageClient {
|
function createClient(lspPath: string): LanguageClient {
|
||||||
|
const logPath =
|
||||||
|
getConfig().opengoalLspLogPath ??
|
||||||
|
path.join(extensionContext.extensionPath, "lsp.log");
|
||||||
|
const normalArgs = ["--log", logPath];
|
||||||
|
if (getConfig().opengoalLspLogVerbose) {
|
||||||
|
normalArgs.push("--verbose");
|
||||||
|
}
|
||||||
const serverOptions: ServerOptions = {
|
const serverOptions: ServerOptions = {
|
||||||
run: {
|
run: {
|
||||||
command: lspPath,
|
command: lspPath,
|
||||||
transport: TransportKind.stdio,
|
transport: TransportKind.stdio,
|
||||||
args: ["--log", path.join(extensionContext.extensionPath, "lsp.log")],
|
args: normalArgs,
|
||||||
},
|
},
|
||||||
debug: {
|
debug: {
|
||||||
command: lspPath,
|
command: lspPath,
|
||||||
transport: TransportKind.stdio,
|
transport: TransportKind.stdio,
|
||||||
args: [
|
args: ["--verbose", "--log", logPath],
|
||||||
"--verbose",
|
|
||||||
"--log",
|
|
||||||
path.join(extensionContext.extensionPath, "lsp.log"),
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
const clientOptions: LanguageClientOptions = {
|
const clientOptions: LanguageClientOptions = {
|
||||||
|
|
Loading…
Reference in a new issue