Skip to content

Commit

Permalink
fix: duplicate configs
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarrus1 committed Mar 8, 2024
1 parent ea347ad commit 079839d
Show file tree
Hide file tree
Showing 3 changed files with 611 additions and 44 deletions.
3 changes: 2 additions & 1 deletion crates/sourcepawn_lsp/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,9 @@ mod tests {
}
}

let package_template_json_path = project_root().join("editors/code/package_template.json");
let package_json_path = project_root().join("editors/code/package.json");
let mut package_json = fs::read_to_string(&package_json_path).unwrap();
let mut package_json = fs::read_to_string(package_template_json_path).unwrap();

// Parse the package.json and insert the schema.
let mut old: Value = serde_json::from_str(&package_json).unwrap();
Expand Down
60 changes: 17 additions & 43 deletions editors/code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@
"type": "string",
"description": "The location of the SourceMod compiler",
"scope": "resource",
"deprecationMessage": "Use `SourcePawnLanguageServer.spcompPath` instead."
"deprecationMessage": "Use `SourcePawnLanguageServer.compiler.path` instead."
},
"sourcepawn.MainPathCompilation": {
"type": "boolean",
Expand Down Expand Up @@ -270,7 +270,7 @@
"default": [],
"description": "Optional additional include folders paths for the compiler and the linter. Use this if you know what you are doing. Leave blank to disable.",
"scope": "resource",
"deprecationMessage": "Use `SourcePawnLanguageServer.includesDirectories` instead."
"deprecationMessage": "Use `SourcePawnLanguageServer.includeDirectories` instead."
},
"sourcepawn.compilerArguments": {
"type": "array",
Expand All @@ -286,7 +286,7 @@
"default": [],
"description": "SourcePawn linter compiler options. Don't add paths here.",
"scope": "resource",
"deprecationMessage": "Use `SourcePawnLanguageServer.linterArguments` instead."
"deprecationMessage": "Use `SourcePawnLanguageServer.compiler.arguments` instead."
},
"sourcepawn.availableAPIs": {
"type": "array",
Expand Down Expand Up @@ -479,39 +479,17 @@
"minimum": 0,
"maximum": 255
},
"SourcePawnLanguageServer.numThreads": {
"markdownDescription": "How many worker threads in the main loop. The default `null` means to pick automatically.",
"default": null,
"type": [
"null",
"integer"
],
"minimum": 0
},
"SourcePawnLanguageServer.includeDirectories": {
"markdownDescription": "Include directories paths for the compiler and the linter.",
"default": [],
"type": "array",
"items": {
"type": "string"
}
},
"SourcePawnLanguageServer.spcompPath": {
"markdownDescription": "Path to the SourcePawn compiler (spcomp).",
"default": "",
"type": "string"
},
"SourcePawnLanguageServer.linterArguments": {
"SourcePawnLanguageServer.compiler.arguments": {
"markdownDescription": "Linter arguments that will be passed to spcomp.\nNote that the compilation target, include directories and output path are already handled by the server.",
"default": [],
"type": "array",
"items": {
"type": "string"
}
},
"SourcePawnLanguageServer.disableSyntaxLinter": {
"markdownDescription": "Disable the language server's syntax linter. This is independant from spcomp.",
"default": false,
"SourcePawnLanguageServer.compiler.onSave": {
"markdownDescription": "Compute spcomp diagnostics on save.",
"default": true,
"type": "boolean"
},
"SourcePawnLanguageServer.compiler.path": {
Expand All @@ -522,16 +500,8 @@
"string"
]
},
"SourcePawnLanguageServer.compiler.arguments": {
"markdownDescription": "Linter arguments that will be passed to spcomp.\nNote that the compilation target, include directories and output path are already handled by the server.",
"default": [],
"type": "array",
"items": {
"type": "string"
}
},
"SourcePawnLanguageServer.linter.arguments": {
"markdownDescription": "Linter arguments that will be passed to spcomp.\nNote that the compilation target, include directories and output path are already handled by the server.",
"SourcePawnLanguageServer.includeDirectories": {
"markdownDescription": "Include directories paths for the compiler and the linter.",
"default": [],
"type": "array",
"items": {
Expand All @@ -543,10 +513,14 @@
"default": false,
"type": "boolean"
},
"SourcePawnLanguageServer.compiler.onSave": {
"markdownDescription": "Compute spcomp diagnostics on save.",
"default": true,
"type": "boolean"
"SourcePawnLanguageServer.numThreads": {
"markdownDescription": "How many worker threads in the main loop. The default `null` means to pick automatically.",
"default": null,
"type": [
"null",
"integer"
],
"minimum": 0
}
}
},
Expand Down
Loading

0 comments on commit 079839d

Please sign in to comment.