MCPcopy Index your code
hub / github.com/microsoft/vscode-cpptools / getRawSetting

Function getRawSetting

Extension/src/common.ts:68–83  ·  view source on GitHub ↗
(key: string, breakIfMissing: boolean = false)

Source from the content-addressed store, hash-verified

66// This prevents having to iterate every time we search.
67let flattenedPackageJson: Map<string, any>;
68export function getRawSetting(key: string, breakIfMissing: boolean = false): any {
69 if (flattenedPackageJson === undefined) {
70 flattenedPackageJson = new Map();
71 for (const subheading of packageJson.contributes.configuration) {
72 for (const setting in subheading.properties) {
73 flattenedPackageJson.set(setting, subheading.properties[setting]);
74 }
75 }
76 }
77 const result = flattenedPackageJson.get(key);
78 if (result === undefined && breakIfMissing) {
79 // eslint-disable-next-line no-debugger
80 debugger; // The setting does not exist in package.json. Check the `key`.
81 }
82 return result;
83}
84
85export async function getRawJson(path: string | undefined): Promise<any> {
86 if (!path) {

Callers 9

getAsBooleanMethod · 0.90
getAsStringMethod · 0.90
getAsNumberMethod · 0.90
getAsArrayOfStringsMethod · 0.90
getAsExcludesMethod · 0.90
getAsAssociationsMethod · 0.90

Calls 2

setMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected