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",
|
||||
"properties": {
|
||||
"opengoal.launchLspOnStartup": {
|
||||
"type": [
|
||||
"boolean"
|
||||
],
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Whether or not the LSP should be started automatically"
|
||||
},
|
||||
"opengoal.opengoalLspPath": {
|
||||
"type": [
|
||||
"string"
|
||||
],
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"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"),
|
||||
opengoalLspVersion: configOptions.get<string>("opengoalLspVersion"),
|
||||
opengoalLspPath: configOptions.get<string>("opengoalLspPath"),
|
||||
opengoalLspLogPath: configOptions.get<string>("opengoalLspLogPath"),
|
||||
opengoalLspLogVerbose: configOptions.get<boolean>("opengoalLspLogVerbose"),
|
||||
|
||||
eeManPagePath: configOptions.get<string>("eeManPagePath"),
|
||||
vuManPagePath: configOptions.get<string>("vuManPagePath"),
|
||||
decompilerPath: configOptions.get<string>("decompilerPath"),
|
||||
|
|
|
@ -120,20 +120,23 @@ async function maybeDownloadLspServer(): Promise<void> {
|
|||
}
|
||||
|
||||
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 = {
|
||||
run: {
|
||||
command: lspPath,
|
||||
transport: TransportKind.stdio,
|
||||
args: ["--log", path.join(extensionContext.extensionPath, "lsp.log")],
|
||||
args: normalArgs,
|
||||
},
|
||||
debug: {
|
||||
command: lspPath,
|
||||
transport: TransportKind.stdio,
|
||||
args: [
|
||||
"--verbose",
|
||||
"--log",
|
||||
path.join(extensionContext.extensionPath, "lsp.log"),
|
||||
],
|
||||
args: ["--verbose", "--log", logPath],
|
||||
},
|
||||
};
|
||||
const clientOptions: LanguageClientOptions = {
|
||||
|
|
Loading…
Reference in a new issue