hyperupcall updated this revision to Diff 485351.
hyperupcall added a comment.

Improve schema correctness


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140462/new/

https://reviews.llvm.org/D140462

Files:
  clang-tools-extra/clangd/schema/config.json

Index: clang-tools-extra/clangd/schema/config.json
===================================================================
--- /dev/null
+++ clang-tools-extra/clangd/schema/config.json
@@ -0,0 +1,180 @@
+{
+	"$schema": "http://json-schema.org/draft-07/schema";,
+	"$defs": {
+		"stringOrArrayOf": {
+			"oneOf": [
+				{
+					"type": "string"
+				},
+				{
+					"type": "array",
+					"items": {
+						"type": "string"
+					}
+				}
+			]
+		}
+	},
+	"type": "object",
+	"properties": {
+		"If": {
+			"description": "Conditions in the If block restrict when a fragment applies.",
+			"type": "object",
+			"properties": {
+				"PathMatch": {
+					"description": "The file being processed must fully match a regular expression.",
+					"$ref": "#/$defs/stringOrArrayOf"
+				},
+				"PathExclude": {
+					"description": "The file being processed must not fully match a regular expression.",
+					"$ref": "#/$defs/stringOrArrayOf"
+				}
+			}
+		},
+		"CompileFlags": {
+			"description": "Affects how a source file is parsed.",
+			"type": "object",
+			"properties": {
+				"Add": {
+					"description": "List of flags to append to the compile command.",
+					"$ref": "#/$defs/stringOrArrayOf"
+				},
+				"Remove": {
+					"description": "List of flags to remove from the compile command",
+					"$ref": "#/$defs/stringOrArrayOf"
+				},
+				"CompilationDatabase": {
+					"description": "Directory to search for compilation database (compile_commands.json etc).",
+					"oneOf": [
+						{
+							"type": "string"
+						},
+						{
+							"enum": ["Ancestors", "None"]
+						}
+					]
+				},
+				"Compiler": {
+					"description": "String to replace the executable name in the compile flags. The name controls flag parsing (clang vs clang-cl), target inference (gcc-arm-noneabi) etc.",
+					"type": "string"
+				}
+			}
+		},
+		"Index": {
+			"description": "Controls how clangd understands code outside the current file.",
+			"type": "object",
+			"properties": {
+				"Background": {
+					"description": "Whether files are built in the background to produce a project index. This is checked for translation units only, not headers they include.",
+					"type": "string",
+					"enum": ["Build", "Skip"],
+					"default": "Build"
+				},
+				"External": {
+					"description": "Used to define an external index source",
+					"type": "object",
+					"oneOf": [
+						{
+							"properties": {
+								"File": {
+									"type": "string"
+								}
+							},
+							"required": ["File"]
+						},
+						{
+							"properties": {
+								"Server": {
+									"type": "string"
+								},
+								"MountPoint": {
+									"type": "string"
+								}
+							},
+							"required": ["Server"]
+						}
+					]
+				}
+			}
+		},
+		"Style": {
+			"description": "Describes the style of the codebase, beyond formatting",
+			"type": "object",
+			"properties": {
+				"FullyQualifiedNamespaces": {
+					"type": "boolean"
+				}
+			}
+		},
+		"Diagnostics": {
+			"type": "object",
+			"properties": {
+				"Suppress": {
+					"description": "Diagnostic codes that should be suppressed.",
+					"$ref": "#/$defs/stringOrArrayOf"
+				},
+				"ClangTidy": {
+					"description": "Configure how clang-tidy runs over your files. The settings are merged with any settings found in .clang-tidy configuration files with the ones from clangd configs taking precedence.",
+					"type": "object",
+					"properties": {
+						"Add": {
+							"description": "List of checks to enable, can be globs.",
+							"$ref": "#/$defs/stringOrArrayOf"
+						},
+						"Remove": {
+							"description": "List of checks to disable, can be globs.",
+							"$ref": "#/$defs/stringOrArrayOf"
+						},
+						"CheckOptions": {
+							"description": "Key-value pairs of options for clang-tidy checks",
+							"type": "object"
+						},
+						"UnusedIncludes": {
+							"description": "Enables Include Cleaner's unused includes diagnostics.",
+							"type": "string",
+							"enum": ["None", "Strict"],
+							"default": "None"
+						}
+					}
+				}
+			}
+		},
+		"Completion": {
+			"type": "object",
+			"properties": {
+				"AllScopes": {
+					"description": "Whether code completion should include suggestions from scopes that are not visible. The required scope prefix will be inserted.",
+					"type": "boolean"
+				}
+			}
+		},
+		"InlayHints": {
+			"description": "Configures the behaviour of the inlay-hints feature.",
+			"type": "object",
+			"properties": {
+				"Enabled": {
+					"description": "A boolean that enables/disables the inlay-hints feature for all kinds, when disabled, configuration for specific kinds are ignored.",
+					"type": "boolean"
+				},
+				"ParameterNames": {
+					"description": "A boolean that enables/disables inlay-hints for parameter names in function calls.",
+					"type": "boolean"
+				},
+				"DeducedTypes": {
+					"description": "A boolean that enables/disables inlay-hints for deduced types.",
+					"type": "boolean"
+				}
+			}
+		},
+		"Hover": {
+			"description": "Configures contents of the hover cards.",
+			"type": "object",
+			"properties": {
+				"ShowAKA": {
+					"description": "A boolean that controls printing of desugared types e.g: `vector<int>::value_type (aka int)`",
+					"type": "boolean"
+				}
+			}
+		}
+	}
+}
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to