From b6c5dee8fe4db316a9bab78a6769276befe8ae70 Mon Sep 17 00:00:00 2001 From: Matthew Blanski Date: Sun, 23 Aug 2020 03:39:14 -0500 Subject: [PATCH] Fixed bug with relative path parsing --- src/apexDoc.js | 2 +- src/apexParsing/apexParser.js | 5 +++-- src/config/apexDocJsonParser.js | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/apexDoc.js b/src/apexDoc.js index 82457be..50701fd 100644 --- a/src/apexDoc.js +++ b/src/apexDoc.js @@ -21,7 +21,6 @@ class ApexDoc { const sfdxProjectJsonParser = new SFDXProjectJsonParser(this.sourceDirectory); this.packageDirectories = sfdxProjectJsonParser.getPackageDirectories(); - this.apexParser = new ApexParser(apexDocJsonParser); this.fm = new FileManager(apexDocJsonParser); } @@ -42,6 +41,7 @@ class ApexDoc { //TODO: Name this better mainLogic() { + this.apexParser = new ApexParser(this.accessModifiers,this.sourceDirectory); const filesArray = this.getClassFilesFromPackageDirectories(); //Create a new array of ClassModels diff --git a/src/apexParsing/apexParser.js b/src/apexParsing/apexParser.js index f25f72f..3327cf7 100644 --- a/src/apexParsing/apexParser.js +++ b/src/apexParsing/apexParser.js @@ -5,8 +5,9 @@ const MethodModel = require('../apexmodels/methodModel.js'); const PropertyModel = require('../apexmodels/propertyModel.js'); class ApexParser { - constructor(apexDocJsonParser) { - this.accessModifiers = apexDocJsonParser.getAccessModifiers(); + constructor(accessModifiers,sourceDirectory) { + this.accessModifiers = accessModifiers; + this.sourceDirectory = sourceDirectory; } parseFileContents(filePath) { diff --git a/src/config/apexDocJsonParser.js b/src/config/apexDocJsonParser.js index 4523468..073140f 100644 --- a/src/config/apexDocJsonParser.js +++ b/src/config/apexDocJsonParser.js @@ -21,7 +21,7 @@ class ApexDocJSONParser { if(!this.apexDocJSON) { const rawJSON = this.readApexDocJSON(); if(rawJSON) { - this.apexDocJSON = JSON.parse(); + this.apexDocJSON = JSON.parse(rawJSON); } else { this.apexDocJSON = {}; }