Skip to content

Commit

Permalink
Handle comments and other JSON5 features in c_cpp_properties.json
Browse files Browse the repository at this point in the history
  • Loading branch information
dzid26 authored and jbenden committed Sep 10, 2022
1 parent 8ae1aff commit 2292ee2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ export async function getCppProperties(cCppPropertiesPath: string, currentSettin
try {
if (fs.existsSync(cCppPropertiesPath)) {
const matchOn: string = await getActiveConfigurationName(currentSettings);
const cCppProperties: IConfigurations = JSON.parse(fs.readFileSync(cCppPropertiesPath, 'utf8'));
const JSON5 = require('json5');
const cCppProperties: IConfigurations = JSON5.parse((fs.readFileSync(cCppPropertiesPath, 'utf8')));
const platformConfig = cCppProperties.configurations.find(el => el.name === matchOn);

if (platformConfig !== undefined) {
Expand Down

0 comments on commit 2292ee2

Please sign in to comment.