Skip to content

Commit

Permalink
#27 lint
Browse files Browse the repository at this point in the history
  • Loading branch information
EduardoFernandes1410 committed Dec 3, 2022
1 parent 0842f6e commit 61996ab
Show file tree
Hide file tree
Showing 19 changed files with 150 additions and 146 deletions.
16 changes: 9 additions & 7 deletions client/src/end-to-end-test/parsingError.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,29 @@ import * as assert from "assert";
import { getDocUri, activate } from "./helper";

suite("Parsing error checks", () => {

test("No parsing errors detected", async () => {
const docUri = getDocUri("parsingErrorFree.eo");

await testDiagnostics(docUri, []);
});

test("Diagnoses two missing EOL errors in file", async () => {
const docUri = getDocUri("parsingErrorTwo.eo");

await testDiagnostics(docUri, [
{
message: "missing EOL at 'n'",
range: toRange(14, 30, 14, 30),
severity: vscode.DiagnosticSeverity.Warning,
source: "ex"
range: toRange(14, 30, 14, 30),
severity: vscode.DiagnosticSeverity.Warning,
source: "ex"
},
{
message: "mismatched input ' ' expecting EOL",
range: toRange(15, 0, 15, 0),
range: toRange(15, 0, 15, 0),
severity: vscode.DiagnosticSeverity.Warning,
source: "ex"
},
}
]);
});
});
Expand Down
14 changes: 8 additions & 6 deletions client/src/end-to-end-test/semanticHighlighting.test.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import * as vscode from "vscode";
import * as assert from "assert";
import * as fs from 'fs';
import * as fs from "fs";
import { getDocUri, getDocPath, activate } from "./helper";

suite("Semantic Highlighting", () => {
const docUri = getDocUri("semanticHighlighting.eo");
const docUri = getDocUri("semanticHighlighting.eo");

test("Performs semantic highlighting in document", async () => {
const targetTokens = fs.readFileSync(getDocPath("semanticHighlightingTarget.txt"),"utf8");
const targetTokensArray = targetTokens.split("\n");
const targetTokens = fs.readFileSync(getDocPath("semanticHighlightingTarget.txt"), "utf8");
const targetTokensArray = targetTokens.split("\n");

await testSemanticHighlight(docUri, targetTokensArray);
});
});
Expand All @@ -19,6 +19,7 @@ suite("Semantic Highlighting", () => {
* are exactly the same as expected
* @param docUri
* @param expectedCompletionList
* @param expectedSemanticTokens
*/
async function testSemanticHighlight(
docUri: vscode.Uri,
Expand All @@ -34,6 +35,7 @@ async function testSemanticHighlight(
assert.ok(actualSemanticTokens.data.length >= 2);
expectedSemanticTokens.forEach((expectedItem, i) => {
const actualItem = actualSemanticTokens.data[i].toString();

assert.equal(expectedItem, actualItem);
});
}
17 changes: 8 additions & 9 deletions coverage/clover.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage generated="1670063262537" clover="3.2.0">
<project timestamp="1670063262537" name="All files">
<metrics statements="1180" coveredstatements="584" conditionals="359" coveredconditionals="91" methods="236" coveredmethods="52" elements="1775" coveredelements="727" complexity="0" loc="1180" ncloc="1180" packages="2" files="7" classes="7"/>
<coverage generated="1670063579352" clover="3.2.0">
<project timestamp="1670063579352" name="All files">
<metrics statements="1179" coveredstatements="584" conditionals="359" coveredconditionals="91" methods="236" coveredmethods="52" elements="1774" coveredelements="727" complexity="0" loc="1179" ncloc="1179" packages="2" files="7" classes="7"/>
<package name="src">
<metrics statements="95" coveredstatements="79" conditionals="16" coveredconditionals="14" methods="20" coveredmethods="15"/>
<metrics statements="94" coveredstatements="79" conditionals="16" coveredconditionals="14" methods="20" coveredmethods="15"/>
<file name="errorListener.ts" path="/home/eduardo/Documents/INNOPOLIS/EQSP/Project/FINAL/eo-vscode/server/src/errorListener.ts">
<metrics statements="2" coveredstatements="2" conditionals="0" coveredconditionals="0" methods="1" coveredmethods="1"/>
<line num="19" count="3" type="stmt"/>
Expand Down Expand Up @@ -51,7 +51,7 @@
<line num="44" count="5" type="stmt"/>
</file>
<file name="semantics.ts" path="/home/eduardo/Documents/INNOPOLIS/EQSP/Project/FINAL/eo-vscode/server/src/semantics.ts">
<metrics statements="61" coveredstatements="46" conditionals="8" coveredconditionals="6" methods="11" coveredmethods="6"/>
<metrics statements="60" coveredstatements="46" conditionals="8" coveredconditionals="6" methods="11" coveredmethods="6"/>
<line num="40" count="2" type="stmt"/>
<line num="46" count="2" type="stmt"/>
<line num="54" count="2" type="stmt"/>
Expand Down Expand Up @@ -106,13 +106,12 @@
<line num="188" count="0" type="stmt"/>
<line num="189" count="0" type="stmt"/>
<line num="206" count="0" type="stmt"/>
<line num="207" count="0" type="stmt"/>
<line num="208" count="0" type="stmt"/>
<line num="209" count="0" type="stmt"/>
<line num="210" count="0" type="stmt"/>
<line num="222" count="0" type="stmt"/>
<line num="221" count="0" type="stmt"/>
<line num="223" count="0" type="stmt"/>
<line num="224" count="0" type="stmt"/>
<line num="225" count="0" type="stmt"/>
<line num="226" count="0" type="stmt"/>
</file>
</package>
<package name="src.parser">
Expand Down
2 changes: 1 addition & 1 deletion coverage/coverage-final.json

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions coverage/lcov-report/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ <h1>All files</h1>
<div class='clearfix'>

<div class='fl pad1y space-right2'>
<span class="strong">49.49% </span>
<span class="strong">49.53% </span>
<span class="quiet">Statements</span>
<span class='fraction'>584/1180</span>
<span class='fraction'>584/1179</span>
</div>


Expand All @@ -44,9 +44,9 @@ <h1>All files</h1>


<div class='fl pad1y space-right2'>
<span class="strong">49.49% </span>
<span class="strong">49.53% </span>
<span class="quiet">Lines</span>
<span class='fraction'>584/1180</span>
<span class='fraction'>584/1179</span>
</div>


Expand Down Expand Up @@ -80,17 +80,17 @@ <h1>All files</h1>
</thead>
<tbody><tr>
<td class="file high" data-value="src"><a href="src/index.html">src</a></td>
<td data-value="83.15" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 83%"></div><div class="cover-empty" style="width: 17%"></div></div>
<td data-value="84.04" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 84%"></div><div class="cover-empty" style="width: 16%"></div></div>
</td>
<td data-value="83.15" class="pct high">83.15%</td>
<td data-value="95" class="abs high">79/95</td>
<td data-value="84.04" class="pct high">84.04%</td>
<td data-value="94" class="abs high">79/94</td>
<td data-value="87.5" class="pct high">87.5%</td>
<td data-value="16" class="abs high">14/16</td>
<td data-value="75" class="pct medium">75%</td>
<td data-value="20" class="abs medium">15/20</td>
<td data-value="83.15" class="pct high">83.15%</td>
<td data-value="95" class="abs high">79/95</td>
<td data-value="84.04" class="pct high">84.04%</td>
<td data-value="94" class="abs high">79/94</td>
</tr>

<tr>
Expand All @@ -116,7 +116,7 @@ <h1>All files</h1>
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2022-12-03T10:27:42.510Z
at 2022-12-03T10:32:59.330Z
</div>
<script src="prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/src/errorListener.ts.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ <h1><a href="../index.html">All files</a> / <a href="index.html">src</a> errorLi
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2022-12-03T10:27:42.510Z
at 2022-12-03T10:32:59.330Z
</div>
<script src="../prettify.js"></script>
<script>
Expand Down
22 changes: 11 additions & 11 deletions coverage/lcov-report/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ <h1><a href="../index.html">All files</a> src</h1>
<div class='clearfix'>

<div class='fl pad1y space-right2'>
<span class="strong">83.15% </span>
<span class="strong">84.04% </span>
<span class="quiet">Statements</span>
<span class='fraction'>79/95</span>
<span class='fraction'>79/94</span>
</div>


Expand All @@ -44,9 +44,9 @@ <h1><a href="../index.html">All files</a> src</h1>


<div class='fl pad1y space-right2'>
<span class="strong">83.15% </span>
<span class="strong">84.04% </span>
<span class="quiet">Lines</span>
<span class='fraction'>79/95</span>
<span class='fraction'>79/94</span>
</div>


Expand Down Expand Up @@ -140,17 +140,17 @@ <h1><a href="../index.html">All files</a> src</h1>

<tr>
<td class="file medium" data-value="semantics.ts"><a href="semantics.ts.html">semantics.ts</a></td>
<td data-value="75.4" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 75%"></div><div class="cover-empty" style="width: 25%"></div></div>
<td data-value="76.66" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 76%"></div><div class="cover-empty" style="width: 24%"></div></div>
</td>
<td data-value="75.4" class="pct medium">75.4%</td>
<td data-value="61" class="abs medium">46/61</td>
<td data-value="76.66" class="pct medium">76.66%</td>
<td data-value="60" class="abs medium">46/60</td>
<td data-value="75" class="pct medium">75%</td>
<td data-value="8" class="abs medium">6/8</td>
<td data-value="54.54" class="pct medium">54.54%</td>
<td data-value="11" class="abs medium">6/11</td>
<td data-value="75.4" class="pct medium">75.4%</td>
<td data-value="61" class="abs medium">46/61</td>
<td data-value="76.66" class="pct medium">76.66%</td>
<td data-value="60" class="abs medium">46/60</td>
</tr>

</tbody>
Expand All @@ -161,7 +161,7 @@ <h1><a href="../index.html">All files</a> src</h1>
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2022-12-03T10:27:42.510Z
at 2022-12-03T10:32:59.330Z
</div>
<script src="../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/src/parser.ts.html
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ <h1><a href="../index.html">All files</a> / <a href="index.html">src</a> parser.
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2022-12-03T10:27:42.510Z
at 2022-12-03T10:32:59.330Z
</div>
<script src="../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/src/parser/ProgramLexer.ts.html
Original file line number Diff line number Diff line change
Expand Up @@ -1459,7 +1459,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">src/parser</
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2022-12-03T10:27:42.510Z
at 2022-12-03T10:32:59.330Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/src/parser/ProgramParser.ts.html
Original file line number Diff line number Diff line change
Expand Up @@ -6964,7 +6964,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">src/parser</
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2022-12-03T10:27:42.510Z
at 2022-12-03T10:32:59.330Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/src/parser/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ <h1><a href="../../index.html">All files</a> src/parser</h1>
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2022-12-03T10:27:42.510Z
at 2022-12-03T10:32:59.330Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/src/parserError.ts.html
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ <h1><a href="../index.html">All files</a> / <a href="index.html">src</a> parserE
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2022-12-03T10:27:42.510Z
at 2022-12-03T10:32:59.330Z
</div>
<script src="../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/src/processor.ts.html
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ <h1><a href="../index.html">All files</a> / <a href="index.html">src</a> process
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2022-12-03T10:27:42.510Z
at 2022-12-03T10:32:59.330Z
</div>
<script src="../prettify.js"></script>
<script>
Expand Down
15 changes: 6 additions & 9 deletions coverage/lcov-report/src/semantics.ts.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ <h1><a href="../index.html">All files</a> / <a href="index.html">src</a> semanti
<div class='clearfix'>

<div class='fl pad1y space-right2'>
<span class="strong">75.4% </span>
<span class="strong">76.66% </span>
<span class="quiet">Statements</span>
<span class='fraction'>46/61</span>
<span class='fraction'>46/60</span>
</div>


Expand All @@ -44,9 +44,9 @@ <h1><a href="../index.html">All files</a> / <a href="index.html">src</a> semanti


<div class='fl pad1y space-right2'>
<span class="strong">75.4% </span>
<span class="strong">76.66% </span>
<span class="quiet">Lines</span>
<span class='fraction'>46/61</span>
<span class='fraction'>46/60</span>
</div>


Expand Down Expand Up @@ -290,8 +290,7 @@ <h1><a href="../index.html">All files</a> / <a href="index.html">src</a> semanti
<a name='L225'></a><a href='#L225'>225</a>
<a name='L226'></a><a href='#L226'>226</a>
<a name='L227'></a><a href='#L227'>227</a>
<a name='L228'></a><a href='#L228'>228</a>
<a name='L229'></a><a href='#L229'>229</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<a name='L228'></a><a href='#L228'>228</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
Expand Down Expand Up @@ -497,7 +496,6 @@ <h1><a href="../index.html">All files</a> / <a href="index.html">src</a> semanti
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
Expand Down Expand Up @@ -724,7 +722,6 @@ <h1><a href="../index.html">All files</a> / <a href="index.html">src</a> semanti
* token of the given document
*/
<span class="fstat-no" title="function not covered" > pr</span>ovideSemanticTokens(document: TextDocument) {
<span class="cstat-no" title="statement not covered" > console.log("VOU PROVIDENCIAR")</span>
const builder = <span class="cstat-no" title="statement not covered" >this.getTokenBuilder(document);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > this.populateBuilder(builder, document);</span>
Expand Down Expand Up @@ -754,7 +751,7 @@ <h1><a href="../index.html">All files</a> / <a href="index.html">src</a> semanti
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2022-12-03T10:27:42.510Z
at 2022-12-03T10:32:59.330Z
</div>
<script src="../prettify.js"></script>
<script>
Expand Down
11 changes: 5 additions & 6 deletions coverage/lcov.info
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ FN:168,(anonymous_6)
FN:187,(anonymous_7)
FN:188,(anonymous_8)
FN:205,(anonymous_9)
FN:221,(anonymous_10)
FN:220,(anonymous_10)
FNF:11
FNH:6
FNDA:2,(anonymous_0)
Expand Down Expand Up @@ -174,14 +174,13 @@ DA:176,0
DA:188,0
DA:189,0
DA:206,0
DA:207,0
DA:208,0
DA:209,0
DA:210,0
DA:222,0
DA:221,0
DA:223,0
DA:224,0
DA:225,0
DA:226,0
LF:61
LF:60
LH:46
BRDA:124,0,0,105
BRDA:124,0,1,21
Expand Down
1 change: 1 addition & 0 deletions server/src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ function buildTokenSetAndMap() {
text.split("\n").forEach(elem => {
if (elem[0] !== "'") {
const pair = elem.split("=");

if (pair.length === 2) {
tokenTypes!.add(pair[0]);
tokenNumToString!.set(Number(pair[1]), pair[0]);
Expand Down
Loading

0 comments on commit 61996ab

Please sign in to comment.