Skip to content
Snippets Groups Projects
Commit 9d0d7309 authored by Dara Leslie Silvera Martinez's avatar Dara Leslie Silvera Martinez
Browse files

Se soluciono problema del parser del code mirror

parent a102211b
Branches Feature/Actaulizar-Angular
No related tags found
1 merge request!1Se actualiza Angular a la versión 13 y se resuelven vulnerabilidades
......@@ -162,6 +162,7 @@ export class GHCIService {
hayError(text: string) {
// Si se está esperando por la descripción del error
if (this.waitingForError) {
// WA para manejar el tema de las traducciones asincronicas. Dado que no,
// hay una buena forma de manejar las traducciones asincronicas con los
......@@ -172,12 +173,15 @@ export class GHCIService {
const language = this.authService.getLanguage();
const traduccionColumna = language == "es" ? "columna" : "column";
const traduccionEnColumna = language == "es" ? "En columna" : "In column";
var columna = this.errorText
.split(`${traduccionColumna}:`)[1]
.split("}")[0];
const parsedText = JSON.parse(text).resultado;
var errorTextToShow = JSON.parse(text).resultado.split("OUT")[1].trim();
if (!parsedText) {
return;
}
var errorTextToShow = parsedText.split("OUT")[1].trim();
var errorFinalText =
traduccionEnColumna + columna + ": " + errorTextToShow;
......@@ -213,9 +217,9 @@ export class GHCIService {
"breakpoints",
makeMarker()
);
this.waitingForError = false;
this.lastErrorLineNumber = -1;
}
this.waitingForError = false;
} else {
try {
const message: { tipo: string; resultado: string } = JSON.parse(text);
......@@ -246,12 +250,17 @@ export class GHCIService {
this.translateService
.get("i18n.codemirror.command.line")
.subscribe((line) => {
const lineNumber =
Number(fileNameAndMore.split(` ${line}: `)[1].split(" ")[0]) -
1;
const lineNumberNotParsed = fileNameAndMore.split(
` ${line}: `
)[1];
if (lineNumberNotParsed) {
const lineNumber =
Number(lineNumberNotParsed.split(" ")[0]) - 1;
this.lastErrorLineNumber = lineNumber;
this.lastErrorFile = fileName;
this.lastErrorLineNumber = lineNumber;
this.lastErrorFile = fileName;
}
this.errorText = fileNameAndMore.trim();
});
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment