/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
import { endTruncateStr } from "./utils"; import { getSourceClassnames, getRelativeUrl } from "./source";
if (startsWithModifier) { const modifier = query[0]; return MODIFIERS[modifier];
}
const isGotoSource = query.includes(":", 1);
if (isGotoSource) { return"gotoSource";
}
return"sources";
}
export function parseLineColumn(query) { const [, line, column] = query.split(":"); const lineNumber = parseInt(line, 10); const columnNumber = parseInt(column, 10); if (isNaN(lineNumber)) { returnnull;
} if (isNaN(columnNumber)) { return { line: lineNumber };
} // columnNumber here is the user input value which is 1-based. // Whereas in location objects, line is 1-based, and column is 0-based. return {
line: lineNumber,
column: columnNumber - 1,
};
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.