diff --git a/client/server/src/server.js b/client/server/src/server.js index 8a2abc3..af2be85 100644 --- a/client/server/src/server.js +++ b/client/server/src/server.js @@ -111,7 +111,7 @@ function getRange(error) { } /** * Converts an error (exception) to a VSCode Diagnostic and - * pushes it onto the global diagnosticMap + * pushes it onto the diagnosticMap * @param textDocument the text document associated (the doc that has been modified) * @param error the exception * @param type the type of the exception @@ -163,6 +163,14 @@ function pushError(textDocument, error, type, diagnosticMap) { } diagnosticMap[fileName].add(diagnostic); } +/** + * Declares that a file has no errors in the diagnostic map. + * We need to call this on all files that DO NOT have errors + * to ensure that error markers are removed. + * + * @param fileName the uri of the file + * @param diagnosticMap the diagnostic map + */ function validFile(fileName, diagnosticMap) { diagnosticMap[fileName] = new Set(); } @@ -209,22 +217,16 @@ function validateTextDocument(textDocument) { try { connection.console.log(`*** Document modified: ${textDocument.uri}`); /** - * A cache of TemplateLogic instances. The keys are - * the root folder names. The values are the TemplateLogic instances. - * Note that we will leak instances if people rename the root folders... + * A cache of TemplateLogic instances. The keys are the root folder names. */ const templateCache = {}; /** * Map of diagnostics, with the key being the document URI - * and the value being the array of Diagnostic instances + * and the value being a Set of Diagnostic instances */ const diagnosticMap = {}; const pathStr = path.resolve(fileUriToPath_1.default(textDocument.uri)); const fileExtension = path.extname(pathStr); - // clear the diagnosticMap - Object.keys(diagnosticMap).forEach(function (key) { - diagnosticMap[key] = []; - }); // this will assemble all the models into a ModelManager // and validate - so it needs to always run before we do anything else const modelValid = yield validateModels(textDocument, diagnosticMap, templateCache); @@ -236,7 +238,7 @@ function validateTextDocument(textDocument) { const ergoValid = yield compileErgoFiles(textDocument, diagnosticMap, templateCache); // if ergo is valid we proceed to check the template if (ergoValid) { - // await validateTemplateFile(textDocument, diagnosticMap); + yield validateTemplateFile(textDocument, diagnosticMap); } break; case '.ergo': @@ -245,7 +247,7 @@ function validateTextDocument(textDocument) { break; case '.tem': // if a template file has changed, we check we can build the template - // await validateTemplateFile(textDocument); + yield validateTemplateFile(textDocument, diagnosticMap); break; } } @@ -393,7 +395,7 @@ function validateTemplateFile(textDocument, diagnosticMap) { template.validate(); try { connection.console.log(`Built template: ${template.getIdentifier()}`); - validFile(parentDir + '/grammar/sample.txt', diagnosticMap); + validFile(parentDir + '/sample.txt', diagnosticMap); const sample = fs.readFileSync(parentDir + '/sample.txt', 'utf8'); const clause = new cicero_core_1.Clause(template); clause.parse(sample); diff --git a/client/server/src/server.js.map b/client/server/src/server.js.map index 9fe9857..3652875 100644 --- a/client/server/src/server.js.map +++ b/client/server/src/server.js.map @@ -1 +1 @@ -{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../server/src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,YAAY,CAAC;;;;;;;;;;AAEb,iEAG+B;AAE/B,+BAA4B;AAC5B,yBAAyB;AACzB,6BAA6B;AAC7B,mDAA4C;AAE5C,4DAA8D;AAC9D,gEAA6D;AAC7D,yDAA8C;AAE9C,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAE7B,6BAA6B;AAC7B,IAAI,UAAU,GAAG,wCAAgB,CAAC,wCAAgB,CAAC,GAAG,CAAC,CAAC;AAExD,2CAA2C;AAC3C,IAAI,SAAS,GAAG,IAAI,qCAAa,EAAE,CAAC;AAEpC,mDAAmD;AACnD,IAAI,eAAuB,CAAC;AAE5B,sEAAsE;AACtE,MAAM,UAAU,GAAG;IACf,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE;IAChC,GAAG,EAAG,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE;CAClC,CAAC;AAEF;;;;;;;;GAQG;AACH,SAAS,eAAe,CAAC,OAAO,EAAE,YAAY,EAAE,aAAa;IAEzD,IAAI,WAAW,GAAG,OAAO,CAAC;IAE1B,OAAM,WAAW,KAAK,GAAG,EAAE;QACvB,UAAU,CAAC,OAAO,CAAC,GAAG,CAAE,KAAK,WAAW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AAY,EAAE,KAAK,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC;iBAC3D;aACJ;YACD,OAAM,KAAK,EAAE;gBACT,KAAK,CAAC,QAAQ,GAAG,SAAS,GAAG,uBAAuB,CAAC;gBACrD,SAAS,CAAC,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;aAC7D;SACJ;QACD,OAAM,KAAK,EAAE;YACT,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACxC,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SACzC;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;CAAA;AAED,UAAU,CAAC,MAAM,EAAE,CAAC"} \ No newline at end of file diff --git a/server/src/server.ts b/server/src/server.ts index e42200e..3dea773 100755 --- a/server/src/server.ts +++ b/server/src/server.ts @@ -122,7 +122,7 @@ function getRange(error: any) { /** * Converts an error (exception) to a VSCode Diagnostic and - * pushes it onto the global diagnosticMap + * pushes it onto the diagnosticMap * @param textDocument the text document associated (the doc that has been modified) * @param error the exception * @param type the type of the exception @@ -184,6 +184,14 @@ function pushError(textDocument: TextDocument, error : any, type : string, diagn diagnosticMap[fileName].add(diagnostic); } +/** + * Declares that a file has no errors in the diagnostic map. + * We need to call this on all files that DO NOT have errors + * to ensure that error markers are removed. + * + * @param fileName the uri of the file + * @param diagnosticMap the diagnostic map + */ function validFile(fileName, diagnosticMap) { diagnosticMap[fileName] = new Set(); } @@ -236,27 +244,20 @@ async function validateTextDocument(textDocument: TextDocument): Promise { connection.console.log(`*** Document modified: ${textDocument.uri}`); /** - * A cache of TemplateLogic instances. The keys are - * the root folder names. The values are the TemplateLogic instances. - * Note that we will leak instances if people rename the root folders... + * A cache of TemplateLogic instances. The keys are the root folder names. */ const templateCache = {}; /** * Map of diagnostics, with the key being the document URI - * and the value being the array of Diagnostic instances + * and the value being a Set of Diagnostic instances */ const diagnosticMap = { } const pathStr = path.resolve(fileUriToPath(textDocument.uri)); const fileExtension = path.extname(pathStr); - - // clear the diagnosticMap - Object.keys(diagnosticMap).forEach(function(key) { - diagnosticMap[key] = []; - }); - + // this will assemble all the models into a ModelManager // and validate - so it needs to always run before we do anything else const modelValid = await validateModels(textDocument, diagnosticMap, templateCache); @@ -270,7 +271,7 @@ async function validateTextDocument(textDocument: TextDocument): Promise { // if ergo is valid we proceed to check the template if(ergoValid) { - // await validateTemplateFile(textDocument, diagnosticMap); + await validateTemplateFile(textDocument, diagnosticMap); } break; case '.ergo': @@ -279,7 +280,7 @@ async function validateTextDocument(textDocument: TextDocument): Promise { break; case '.tem': // if a template file has changed, we check we can build the template - // await validateTemplateFile(textDocument); + await validateTemplateFile(textDocument, diagnosticMap); break; } } @@ -438,7 +439,7 @@ async function validateTemplateFile(textDocument: TextDocument, diagnosticMap): try { connection.console.log(`Built template: ${template.getIdentifier()}`); - validFile(parentDir + '/grammar/sample.txt', diagnosticMap); + validFile(parentDir + '/sample.txt', diagnosticMap); const sample = fs.readFileSync(parentDir + '/sample.txt', 'utf8'); const clause = new Clause(template); clause.parse(sample);