Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String/settings fixes #8129

Merged
merged 6 commits into from
Sep 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 26 additions & 14 deletions Extension/c_cpp_properties.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@
],
"properties": {
"name": {
"description": "Configuration identifier. Mac, Linux, and Win32 are special identifiers for configurations that will be auto-selected on those platforms, but the identifier can be anything.",
"markdownDescription": "Configuration identifier. `Mac`, `Linux`, and `Win32` are special identifiers for configurations that will be auto-selected on those platforms, but the identifier can be anything.",
"descriptionHint": "Markdown text between `` should not be translated and the punctuation should not be altered.",
"type": "string"
},
"compilerPath": {
"description": "Full path of the compiler being used, e.g. /usr/bin/gcc, to enable more accurate IntelliSense.",
"markdownDescription": "Full path of the compiler being used, e.g. `/usr/bin/gcc`, to enable more accurate IntelliSense.",
"descriptionHint": "Markdown text between `` should not be translated and the punctuation should not be altered.",
"type": "string"
},
"compilerArgs": {
"description": "Compiler arguments to modify the includes or defines used, e.g. -nostdinc++, -m32, etc.",
"markdownDescription": "Compiler arguments to modify the includes or defines used, e.g. `-nostdinc++`, `-m32`, etc.",
"descriptionHint": "Markdown text between `` should not be translated and the punctuation should not be altered.",
"type": "array",
"items": {
"type": "string"
Expand Down Expand Up @@ -60,11 +63,13 @@
]
},
"compileCommands": {
"description": "Full path to compile_commands.json file for the workspace.",
"markdownDescription": "Full path to `compile_commands.json` file for the workspace.",
"descriptionHint": "Markdown text between `` should not be translated and the punctuation should not be altered.",
"type": "string"
},
"includePath": {
"description": "A list of paths for the IntelliSense engine to use while searching for included headers. Searching on these paths is not recursive. Specify '**' to indicate recursive search. For example, '${workspaceFolder}/**' will search through all subdirectories while '${workspaceFolder}' will not.",
"markdownDescription": "A list of paths for the IntelliSense engine to use while searching for included headers. Searching on these paths is not recursive. Specify `**` to indicate recursive search. For example, `${workspaceFolder}/**` will search through all subdirectories while `${workspaceFolder}` will not. Usually, this should not include system includes; instead, set `#C_Cpp.default.compilerPath#`.",
"descriptionHint": "Markdown text between `` should not be translated and the punctuation should not be altered.",
"type": "array",
"items": {
"type": "string"
Expand All @@ -78,19 +83,22 @@
}
},
"windowsSdkVersion": {
"description": "Version of the Windows SDK include path to use on Windows, e.g. '10.0.17134.0'.",
"markdownDescription": "Version of the Windows SDK include path to use on Windows, e.g. `10.0.17134.0`.",
"descriptionHint": "Markdown text between `` should not be translated and the punctuation should not be altered.",
"type": "string",
"pattern": "^\\d{2}\\.\\d{1}\\.\\d{5}\\.\\d{1}$|^8\\.1$"
},
"defines": {
"description": "A list of preprocessor definitions for the IntelliSense engine to use while parsing files. Optionally, use = to set a value, e.g. VERSION=1.",
"markdownDescription": "A list of preprocessor definitions for the IntelliSense engine to use while parsing files. Optionally, use `=` to set a value, e.g. `VERSION=1`.",
"descriptionHint": "Markdown text between `` should not be translated and the punctuation should not be altered.",
"type": "array",
"items": {
"type": "string"
}
},
"intelliSenseMode": {
"description": "The IntelliSense mode to use that maps to a platform and architecture variant of MSVC, gcc, or Clang. If not set or if set to ${default}, the extension will choose the default for that platform. Windows defaults to windows-msvc-x64, Linux defaults to linux-gcc-x64, and macOS defaults to macos-clang-x64. IntelliSense modes that only specify <compiler>-<architecture> variants (e.g. gcc-x64) are legacy modes and are converted automatically to the <platform>-<compiler>-<architecture> variants based on the host platform.",
"markdownDescription": "The IntelliSense mode to use that maps to a platform and architecture variant of MSVC, gcc, or Clang. If not set or if set to `${default}`, the extension will choose the default for that platform. Windows defaults to `windows-msvc-x64`, Linux defaults to `linux-gcc-x64`, and macOS defaults to `macos-clang-x64`. IntelliSense modes that only specify `<compiler>-<architecture>` variants (e.g. `gcc-x64`) are legacy modes and are converted automatically to the `<platform>-<compiler>-<architecture>` variants based on the host platform.",
"descriptionHint": "Uses of words 'platform', 'compiler', and 'architecture' are meant to be descriptive placeholders for literal values, so they should be translated, but without changing the surrounding `<>-<>` symbols. All other text inside `` should not translated.",
sean-mcmanus marked this conversation as resolved.
Show resolved Hide resolved
"type": "string",
"enum": [
"macos-clang-x86",
Expand Down Expand Up @@ -151,7 +159,8 @@
"type": "object",
"properties": {
"limitSymbolsToIncludedHeaders": {
"description": "true to process only those files directly or indirectly included as headers, false to process all files under the specified include paths.",
"markdownDescription": "`true` to process only those files directly or indirectly included as headers, `false` to process all files under the specified include paths.",
"descriptionHint": "Markdown text between `` should not be translated and the punctuation should not be altered.",
"type": [
"boolean",
"string"
Expand All @@ -162,7 +171,8 @@
"type": "string"
},
"path": {
"description": "A list of paths to use for indexing and parsing of workspace symbols (for use by Go to Definition, Find All References, etc.). Searching on these paths is recursive by default. Specify '*' to indicate non-recursive search. For example, '${workspaceFolder}' will search through all subdirectories while '${workspaceFolder}/*' will not.",
"markdownDescription": "A list of paths to use for indexing and parsing of workspace symbols (for use by 'Go to Definition', 'Find All References', etc.). Searching on these paths is recursive by default. Specify `*` to indicate non-recursive search. For example, `${workspaceFolder}` will search through all subdirectories while `${workspaceFolder}/*` will not.",
"descriptionHint": "Markdown text between `` should not be translated and the punctuation should not be altered.",
"type": "array",
"items": {
"type": "string"
Expand All @@ -173,7 +183,8 @@
},
"customConfigurationVariables": {
"type": "object",
"description": "Custom variables that can be queried through the command ${cpptools:activeConfigCustomVariable} to use for the input variables in launch.json or tasks.json.",
"markdownDescription": "Custom variables that can be queried through the command `${cpptools:activeConfigCustomVariable}` to use for the input variables in `launch.json` or `tasks.json`.",
"descriptionHint": "Markdown text between `` should not be translated and the punctuation should not be altered.",
"patternProperties": {
"(^.+$)": {
"type": "string"
Expand All @@ -187,8 +198,8 @@
},
"env": {
"type": "object",
"description": "Custom variables that can be reused anywhere in this file using the ${variable} or ${env:variable} syntax.",
"descriptionHint": "The word 'variable' within curly braces should also be translated. The \"env\" should not be translated, and the punctuation (\"${:}\") should be preserved.",
"markdownDescription": "Custom variables that can be reused anywhere in this file using the `${variable}` or `${env:variable}` syntax.",
"descriptionHint": "The word 'variable' within curly braces should be translated. The \"env\" should not be translated, and the punctuation (\"${:}\") should be preserved.",
"patternProperties": {
"(?!^workspaceFolder$)(?!^workspaceRoot$)(?!^workspaceFolderBasename$)(?!^execPath$)(?!^pathSeparator$)(?!^default$)(^.+$)": {
"oneOf": [
Expand All @@ -213,7 +224,8 @@
"enableConfigurationSquiggles": {
"type": "boolean",
"default": true,
"description": "Controls whether the extension will report errors detected in c_cpp_properties.json."
"markdownDescription": "Controls whether the extension will report errors detected in `c_cpp_properties.json`.",
"descriptionHint": "Markdown text between `` should not be translated and the punctuation should not be altered."
}
},
"properties": {
Expand Down
2 changes: 1 addition & 1 deletion Extension/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ const processHtmlFiles = () => {
const traverseJson = (jsonTree, descriptionCallback, prefixPath) => {
for (let fieldName in jsonTree) {
if (jsonTree[fieldName] !== null) {
if (typeof (jsonTree[fieldName]) == "string" && fieldName === "description") {
if (typeof (jsonTree[fieldName]) == "string" && (fieldName === "description" || fieldName === "markdownDescription")) {
sean-mcmanus marked this conversation as resolved.
Show resolved Hide resolved
descriptionCallback(prefixPath, jsonTree[fieldName], jsonTree);
} else if (typeof (jsonTree[fieldName]) == "object") {
let path = prefixPath;
Expand Down
Loading