Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dot-language-support

Package Overview
Dependencies
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dot-language-support - npm Package Compare versions

Comparing version 1.5.3 to 1.5.4

18

lib/binder.js

@@ -120,3 +120,3 @@ "use strict";

bind(node.rightId);
if (node.rightId && !checker_1.nodeContainsErrors(node.rightId)) {
if (node.rightId && !(0, checker_1.nodeContainsErrors)(node.rightId)) {
if (isAttributeName("color", node.leftId)) {

@@ -172,3 +172,3 @@ ensureGlobalColor(node.rightId);

bind(node.rightId);
if (node.rightId && !checker_1.nodeContainsErrors(node.rightId)) {
if (node.rightId && !(0, checker_1.nodeContainsErrors)(node.rightId)) {
if (isAttributeName("color", node.leftId)) {

@@ -210,4 +210,4 @@ ensureGlobalColor(node.rightId);

function ensureMemberSymbol(node, carrier) {
if (node && carrier && parser_1.isIdentifierNode(node)) {
const name = checker_1.getIdentifierText(node);
if (node && carrier && (0, parser_1.isIdentifierNode)(node)) {
const name = (0, checker_1.getIdentifierText)(node);
if (name === undefined)

@@ -228,5 +228,5 @@ return;

function ensureGlobalSymbol(node) {
if (node && parser_1.isIdentifierNode(node)) {
if (node && (0, parser_1.isIdentifierNode)(node)) {
const symbols = symbolTable;
const name = checker_1.getIdentifierText(node);
const name = (0, checker_1.getIdentifierText)(node);
if (name === undefined)

@@ -259,5 +259,5 @@ return;

function ensureGlobalColor(node) {
if (node && parser_1.isIdentifierNode(node)) {
if (node && (0, parser_1.isIdentifierNode)(node)) {
const colors = colorTable;
const name = checker_1.getIdentifierText(node);
const name = (0, checker_1.getIdentifierText)(node);
if (name === undefined)

@@ -291,3 +291,3 @@ return;

function isAttributeName(name, id) {
return id ? checker_1.getIdentifierText(id).trim().toLowerCase() === name : false;
return id ? (0, checker_1.getIdentifierText)(id).trim().toLowerCase() === name : false;
}

@@ -294,0 +294,0 @@ return {

@@ -36,3 +36,3 @@ "use strict";

if (rangeContainsOffset(root, offset, inclusiveEnd)) {
const narrowerChild = visitor_1.forEachChild(root, child => findNodeAtOffset(child, offset, inclusiveEnd));
const narrowerChild = (0, visitor_1.forEachChild)(root, child => findNodeAtOffset(child, offset, inclusiveEnd));
return narrowerChild ? narrowerChild : root;

@@ -58,3 +58,3 @@ }

const allEdges = [];
visitor_1.forEachChild(node, child => {
(0, visitor_1.forEachChild)(node, child => {
if (isEdgeStatement(child)) {

@@ -88,3 +88,3 @@ if (child.rhs && child.rhs.length > 0) {

const allStatements = [];
visitor_1.forEachChild(node, child => {
(0, visitor_1.forEachChild)(node, child => {
if ((kind === undefined && isStatement(child)) || (child.kind === kind)) {

@@ -119,3 +119,3 @@ allStatements.push(child);

return violators.map(edge => {
const start = util_1.getStart(file, edge.operation);
const start = (0, util_1.getStart)(file, edge.operation);
const end = edge.operation.end;

@@ -175,3 +175,3 @@ return {

default:
return util_1.assertNever(n);
return (0, util_1.assertNever)(n);
}

@@ -178,0 +178,0 @@ }

@@ -560,3 +560,3 @@ "use strict";

? "end of file"
: `"${scanner_1.getTokenAsText(this.token())}"`;
: `"${(0, scanner_1.getTokenAsText)(this.token())}"`;
const expected = expectedKinds.map(k => {

@@ -567,3 +567,3 @@ if (isIdentifier(k))

return "end of file";
return `"${scanner_1.getTokenAsText(k)}"`;
return `"${(0, scanner_1.getTokenAsText)(k)}"`;
});

@@ -570,0 +570,0 @@ const lastExpected = expected.pop();

@@ -7,3 +7,3 @@ "use strict";

const util_1 = require("./service/util");
const textToToken = core_1.createMapFromTemplate({
const textToToken = (0, core_1.createMapFromTemplate)({
"digraph": types_1.SyntaxKind.DigraphKeyword,

@@ -485,3 +485,3 @@ "graph": types_1.SyntaxKind.GraphKeyword,

|| 48 <= ch && ch <= 57;
default: return util_1.assertNever(idType);
default: return (0, util_1.assertNever)(idType);
}

@@ -488,0 +488,0 @@ }

@@ -47,7 +47,7 @@ "use strict";

const rangeEndOffset = doc.offsetAt(range.end);
const keywordStart = util_1.getStart(file, kw);
const keywordStart = (0, util_1.getStart)(file, kw);
const res = [];
if (isInRange(rangeStartOffset, rangeEndOffset, keywordStart, kw.end)) {
if (!subtreeContainsErrors(g)) {
const oppositeGraphType = common_1.getOppositeKind(kw.kind);
const oppositeGraphType = (0, common_1.getOppositeKind)(kw.kind);
const convertGraph = convertGraphTypeCommand(file, g, oppositeGraphType);

@@ -59,3 +59,3 @@ res.push(convertGraph);

const candidates = [];
let clickedNode = checker_1.findNodeAtOffset(g, rangeStartOffset);
let clickedNode = (0, checker_1.findNodeAtOffset)(g, rangeStartOffset);
if (clickedNode && !!clickedNode.parent) {

@@ -65,3 +65,3 @@ if (clickedNode.kind === __1.SyntaxKind.SemicolonToken) {

}
if (__1.isIdentifierNode(clickedNode)) {
if ((0, __1.isIdentifierNode)(clickedNode)) {
clickedNode = clickedNode.parent;

@@ -71,9 +71,9 @@ }

if (clickedEdgeStatement && !subtreeContainsErrors(clickedEdgeStatement)) {
if (checker_1.isEdgeStatement(clickedEdgeStatement)
if ((0, checker_1.isEdgeStatement)(clickedEdgeStatement)
&& clickedEdgeStatement.rhs.length === 1
&& checker_1.isNodeId(clickedEdgeStatement.source)
&& !checker_1.edgeStatementHasAttributes(clickedEdgeStatement)) {
&& (0, checker_1.isNodeId)(clickedEdgeStatement.source)
&& !(0, checker_1.edgeStatementHasAttributes)(clickedEdgeStatement)) {
candidates.push(clickedEdgeStatement);
const source = clickedEdgeStatement.source;
const sourceText = checker_1.getIdentifierText(source.id);
const sourceText = (0, checker_1.getIdentifierText)(source.id);
const graphParent = clickedEdgeStatement.parent;

@@ -83,3 +83,3 @@ if (graphParent) {

let hasVisitedNodeModifier = false;
__1.forEachChild(graphParent, statement => {
(0, __1.forEachChild)(graphParent, statement => {
if (statement === clickedEdgeStatement) {

@@ -93,3 +93,3 @@ hasVisitedStatement = true;

else if (hasVisitedStatement) {
if (checker_1.isAttrStatement(statement)
if ((0, checker_1.isAttrStatement)(statement)
|| subtreeContainsErrors(statement)) {

@@ -101,8 +101,8 @@ hasVisitedNodeModifier = true;

if (hasVisitedStatement) {
if (checker_1.isEdgeStatement(statement)
if ((0, checker_1.isEdgeStatement)(statement)
&& statement.rhs.length === 1
&& !checker_1.edgeStatementHasAttributes(statement)) {
&& !(0, checker_1.edgeStatementHasAttributes)(statement)) {
const statementSource = statement.source;
if (checker_1.isNodeId(statementSource)) {
const lowerSourceText = checker_1.getIdentifierText(statementSource.id);
if ((0, checker_1.isNodeId)(statementSource)) {
const lowerSourceText = (0, checker_1.getIdentifierText)(statementSource.id);
if (sourceText === lowerSourceText) {

@@ -133,3 +133,3 @@ candidates.push(statement);

case 4: return getCheckerErrorCommand(doc, file, d, d.code);
default: return util_1.assertNever(d.code);
default: return (0, util_1.assertNever)(d.code);
}

@@ -155,8 +155,8 @@ }

return undefined;
const allowedOp = checker_1.getAllowedEdgeOperation(graph);
const wrongOp = common_1.getOppositeEdgeOp(allowedOp);
const allowedOp = (0, checker_1.getAllowedEdgeOperation)(graph);
const wrongOp = (0, common_1.getOppositeEdgeOp)(allowedOp);
const kwk = graph.keyword.kind;
const fixSingleEdge = ChangeEdgeOpCommand.create(d.start, d.end, allowedOp, wrongOp);
const fixAll = convertGraphTypeCommand(file, graph, kwk);
const convertToThisWrongType = convertGraphTypeCommand(file, graph, common_1.getOppositeKind(kwk));
const convertToThisWrongType = convertGraphTypeCommand(file, graph, (0, common_1.getOppositeKind)(kwk));
return [

@@ -171,12 +171,12 @@ fixSingleEdge,

function convertGraphTypeCommand(file, graph, changeToGraphType) {
const changeToEdgeOp = common_1.getAllowedOp(changeToGraphType);
const allEdges = checker_1.findAllEdges(graph);
const changeToEdgeOp = (0, common_1.getAllowedOp)(changeToGraphType);
const allEdges = (0, checker_1.findAllEdges)(graph);
const edgeOffsets = allEdges
.filter(e => e.operation.kind !== changeToEdgeOp)
.map(e => ({
start: util_1.getStart(file, e.operation),
start: (0, util_1.getStart)(file, e.operation),
end: e.operation.end
}));
const graphTypeOffset = {
start: util_1.getStart(file, graph.keyword),
start: (0, util_1.getStart)(file, graph.keyword),
end: graph.keyword.end

@@ -211,7 +211,7 @@ };

function subtreeContainsErrors(node) {
if (checker_1.nodeContainsErrors(node))
if ((0, checker_1.nodeContainsErrors)(node))
return true;
let hasError = false;
__1.forEachChild(node, child => {
if (checker_1.nodeContainsErrors(child)) {
(0, __1.forEachChild)(node, child => {
if ((0, checker_1.nodeContainsErrors)(child)) {
hasError = true;

@@ -218,0 +218,0 @@ }

@@ -35,3 +35,3 @@ "use strict";

res.push({
range: util_1.syntaxNodeToRange(doc, sf, value.node),
range: (0, util_1.syntaxNodeToRange)(doc, sf, value.node),
color,

@@ -38,0 +38,0 @@ });

@@ -6,7 +6,7 @@ "use strict";

function create(edgeOffsets, changeEdgesTo, graphOffset, changeFromGraph, changeGraphTo) {
const toGraph = common_1.getGraphKeywordStr(changeGraphTo);
const toGraph = (0, common_1.getGraphKeywordStr)(changeGraphTo);
const title = changeGraphTo === changeFromGraph
? `Fix all edges to match ${toGraph}`
: `Convert ${common_1.getGraphKeywordStr(changeFromGraph)} to ${toGraph}`;
const edgeStr = common_1.getEdgeStr(changeEdgesTo);
: `Convert ${(0, common_1.getGraphKeywordStr)(changeFromGraph)} to ${toGraph}`;
const edgeStr = (0, common_1.getEdgeStr)(changeEdgesTo);
return {

@@ -26,7 +26,7 @@ title,

const endPos = doc.positionAt(o.end);
return common_1.createChangeToEdit(startPos, endPos, changeEdgeTo);
return (0, common_1.createChangeToEdit)(startPos, endPos, changeEdgeTo);
});
const graphStart = doc.positionAt(graphOffset.start);
const graphEnd = doc.positionAt(graphOffset.end);
edits.push(common_1.createChangeToEdit(graphStart, graphEnd, changeGraphTo));
edits.push((0, common_1.createChangeToEdit)(graphStart, graphEnd, changeGraphTo));
return {

@@ -33,0 +33,0 @@ label: `Convert graph to "${changeGraphTo}"`,

@@ -7,4 +7,4 @@ "use strict";

function create(startOffset, endOffset, changeTo, changeFrom) {
const from = common_1.getEdgeStr(changeFrom);
const to = common_1.getEdgeStr(changeTo);
const from = (0, common_1.getEdgeStr)(changeFrom);
const to = (0, common_1.getEdgeStr)(changeTo);
return {

@@ -11,0 +11,0 @@ title: `Change "${from}" to "${to}".`,

@@ -19,3 +19,3 @@ "use strict";

const first = statements[0];
const from = checker_1.getIdentifierText(first.source.id);
const from = (0, checker_1.getIdentifierText)(first.source.id);
const title = below

@@ -45,8 +45,8 @@ ? `Convert edges below from "${from}" to subgraph`

const candidateIndexes = cmd.arguments;
const candidates = candidateIndexes.map(i => checker_1.findNodeAtOffset(g, i).parent.parent);
const candidates = candidateIndexes.map(i => (0, checker_1.findNodeAtOffset)(g, i).parent.parent);
const first = candidates.shift();
const from = checker_1.getIdentifierText(first.source.id);
const from = (0, checker_1.getIdentifierText)(first.source.id);
const edits = [];
const firstRight = first.rhs[0];
const firstRightTargetStart = util_1.getStart(sourceFile, firstRight.target);
const firstRightTargetStart = (0, util_1.getStart)(sourceFile, firstRight.target);
const firstRightTargetEnd = firstRight.target.end;

@@ -80,3 +80,3 @@ const contents = [

range: {
start: doc.positionAt(util_1.getStart(sourceFile, descendant.terminator)),
start: doc.positionAt((0, util_1.getStart)(sourceFile, descendant.terminator)),
end: doc.positionAt(descendant.terminator.end),

@@ -83,0 +83,0 @@ }

@@ -20,7 +20,7 @@ "use strict";

return undefined;
const semicolons = checker_1.findOptionalSemicolons(g);
const semicolons = (0, checker_1.findOptionalSemicolons)(g);
const edits = semicolons.map(s => {
const end = s.end;
const start = end - 1;
return common_1.createChangeToEdit(doc.positionAt(start), doc.positionAt(end), "");
return (0, common_1.createChangeToEdit)(doc.positionAt(start), doc.positionAt(end), "");
});

@@ -27,0 +27,0 @@ return {

@@ -18,10 +18,10 @@ "use strict";

const offset = doc.offsetAt(position);
const node = checker_1.findNodeAtOffset(g, offset, true);
const node = (0, checker_1.findNodeAtOffset)(g, offset, true);
if (!node)
return [];
const prevOffsetNode = checker_1.findNodeAtOffset(g, offset - 1, true);
const prevOffsetNode = (0, checker_1.findNodeAtOffset)(g, offset - 1, true);
const parent = node.parent;
const prevOffsetNodeParent = prevOffsetNode === null || prevOffsetNode === void 0 ? void 0 : prevOffsetNode.parent;
if (((parent === null || parent === void 0 ? void 0 : parent.parent) && checker_1.isEdgeStatement(parent.parent))
|| ((prevOffsetNodeParent === null || prevOffsetNodeParent === void 0 ? void 0 : prevOffsetNodeParent.parent) && checker_1.isEdgeStatement(prevOffsetNodeParent.parent))) {
if (((parent === null || parent === void 0 ? void 0 : parent.parent) && (0, checker_1.isEdgeStatement)(parent.parent))
|| ((prevOffsetNodeParent === null || prevOffsetNodeParent === void 0 ? void 0 : prevOffsetNodeParent.parent) && (0, checker_1.isEdgeStatement)(prevOffsetNodeParent.parent))) {
return getNodeCompletions(symbols);

@@ -48,6 +48,6 @@ }

}
const prevNode = checker_1.findNodeAtOffset(g, node.pos - 1, true);
const prevNode = (0, checker_1.findNodeAtOffset)(g, node.pos - 1, true);
if (!prevNode)
return [];
if (__1.isIdentifierNode(prevNode)) {
if ((0, __1.isIdentifierNode)(prevNode)) {
const p = prevNode.parent;

@@ -80,3 +80,3 @@ if (p) {

function getAssignmentCompletion(assignment) {
const property = checker_1.getIdentifierText(assignment.leftId);
const property = (0, checker_1.getIdentifierText)(assignment.leftId);
if (!property)

@@ -94,3 +94,3 @@ return [];

kind,
label: util_1.escapeIdentifierText(s),
label: (0, util_1.escapeIdentifierText)(s),
}));

@@ -119,3 +119,3 @@ }

range,
newText: util_1.escapeIdentifierText(label) + "=",
newText: (0, util_1.escapeIdentifierText)(label) + "=",
},

@@ -140,3 +140,3 @@ }));

res.push({
label: util_1.escapeIdentifierText(key),
label: (0, util_1.escapeIdentifierText)(key),
kind: kind,

@@ -143,0 +143,0 @@ });

@@ -14,3 +14,3 @@ "use strict";

return undefined;
const node = checker_1.findNodeAtOffset(g, offset);
const node = (0, checker_1.findNodeAtOffset)(g, offset);
if (node === undefined)

@@ -26,3 +26,3 @@ return undefined;

contents,
range: util_1.syntaxNodeToRange(doc, sf, n),
range: (0, util_1.syntaxNodeToRange)(doc, sf, n),
};

@@ -33,3 +33,3 @@ }

function getHoverContents(n) {
if (parser_1.isIdentifierNode(n)) {
if ((0, parser_1.isIdentifierNode)(n)) {
const parent = n.parent;

@@ -39,7 +39,7 @@ if (parent) {

case types_1.SyntaxKind.NodeId:
return `(node) ${checker_1.getIdentifierText(n)}`;
return `(node) ${(0, checker_1.getIdentifierText)(n)}`;
case types_1.SyntaxKind.Assignment: {
const assignment = parent;
const left = checker_1.getIdentifierText(assignment.leftId);
const right = checker_1.getIdentifierText(assignment.rightId);
const left = (0, checker_1.getIdentifierText)(assignment.leftId);
const right = (0, checker_1.getIdentifierText)(assignment.rightId);
return `(assignment) \`${left}\` = \`${right}\``;

@@ -55,3 +55,3 @@ }

return !!sg.id
? `(sub graph) ${checker_1.getIdentifierText(sg.id)}`
? `(sub graph) ${(0, checker_1.getIdentifierText)(sg.id)}`
: `(sub graph)`;

@@ -62,3 +62,3 @@ }

return !!sg.id
? `(sub graph) ${checker_1.getIdentifierText(sg.id)}`
? `(sub graph) ${(0, checker_1.getIdentifierText)(sg.id)}`
: `(sub graph)`;

@@ -68,4 +68,4 @@ }

const idEqId = parent;
const left = checker_1.getIdentifierText(idEqId.leftId);
const right = checker_1.getIdentifierText(idEqId.rightId);
const left = (0, checker_1.getIdentifierText)(idEqId.leftId);
const right = (0, checker_1.getIdentifierText)(idEqId.rightId);
return `(graph property) \`${left}\` = \`${right}\``;

@@ -103,3 +103,3 @@ }

return !!graphId
? `(${strict}${direction} graph) ${(checker_1.getIdentifierText(graphId))}`
? `(${strict}${direction} graph) ${((0, checker_1.getIdentifierText)(graphId))}`
: `(${strict}${direction} graph)`;

@@ -119,3 +119,3 @@ }

source = p.source;
const edgeOpStr = common_1.getEdgeStr(n.operation.kind);
const edgeOpStr = (0, common_1.getEdgeStr)(n.operation.kind);
return source === undefined

@@ -127,7 +127,7 @@ ? undefined

return n.kind === types_1.SyntaxKind.NodeId
? checker_1.getIdentifierText(n.id)
? (0, checker_1.getIdentifierText)(n.id)
: n.id !== undefined
? `${checker_1.getIdentifierText(n.id)}`
? `${(0, checker_1.getIdentifierText)(n.id)}`
: "sub graph";
}
//# sourceMappingURL=hover.js.map

@@ -14,6 +14,6 @@ "use strict";

const offset = doc.offsetAt(position);
const node = checker_1.findNodeAtOffset(g, offset);
const node = (0, checker_1.findNodeAtOffset)(g, offset);
if (!node)
return [];
if (__1.isIdentifierNode(node)) {
if ((0, __1.isIdentifierNode)(node)) {
const nodeSymbol = node.symbol;

@@ -38,3 +38,3 @@ if (!nodeSymbol)

}
const ranges = util_1.syntaxNodesToRanges(doc, sourceFile, symbolRefs);
const ranges = (0, util_1.syntaxNodesToRanges)(doc, sourceFile, symbolRefs);
const uri = doc.uri;

@@ -56,6 +56,6 @@ return ranges.map(range => {

const offset = doc.offsetAt(position);
const node = checker_1.findNodeAtOffset(g, offset);
const node = (0, checker_1.findNodeAtOffset)(g, offset);
if (!node)
return undefined;
if (__1.isIdentifierNode(node)) {
if ((0, __1.isIdentifierNode)(node)) {
const nodeSymbol = node.symbol;

@@ -69,3 +69,3 @@ if (!nodeSymbol)

return undefined;
const range = util_1.syntaxNodeToRange(doc, sourceFile, firstMention);
const range = (0, util_1.syntaxNodeToRange)(doc, sourceFile, firstMention);
return { uri: doc.uri, range };

@@ -72,0 +72,0 @@ }

@@ -18,7 +18,7 @@ "use strict";

const offset = doc.offsetAt(position);
const node = checker_1.findNodeAtOffset(g, offset);
const node = (0, checker_1.findNodeAtOffset)(g, offset);
if (!node)
return undefined;
const parent = node.parent;
if (__1.isIdentifierNode(node) && isRenamableIdentifier(node) && !!parent && isRenameableNode(parent)) {
if ((0, __1.isIdentifierNode)(node) && isRenamableIdentifier(node) && !!parent && isRenameableNode(parent)) {
const nodeSymbol = node.symbol;

@@ -29,3 +29,3 @@ if (!nodeSymbol)

const refs = r ? [nodeSymbol.firstMention, ...r] : [nodeSymbol.firstMention];
const ranges = util_1.syntaxNodesToRanges(doc, sourceFile, refs);
const ranges = (0, util_1.syntaxNodesToRanges)(doc, sourceFile, refs);
const uri = doc.uri;

@@ -32,0 +32,0 @@ const res = {

@@ -18,4 +18,4 @@ "use strict";

const sourceFile = parser.parse(content);
binder_1.bindSourceFile(sourceFile);
checker_1.checkSourceFile(sourceFile);
(0, binder_1.bindSourceFile)(sourceFile);
(0, checker_1.checkSourceFile)(sourceFile);
return sourceFile;

@@ -22,0 +22,0 @@ }

@@ -13,3 +13,3 @@ "use strict";

return node.pos;
return scanner_1.skipTrivia(sourceFile.content, node.pos);
return (0, scanner_1.skipTrivia)(sourceFile.content, node.pos);
}

@@ -43,3 +43,3 @@ function nodeIsMissing(node) {

const ch = text.charCodeAt(0);
if (!scanner_1.isIdentifierStart(ch) || text.includes(" "))
if (!(0, scanner_1.isIdentifierStart)(ch) || text.includes(" "))
return quote(text);

@@ -46,0 +46,0 @@ return text;

@@ -12,3 +12,3 @@ "use strict";

severity: source.category,
code: error_1.formatError(source.code),
code: (0, error_1.formatError)(source.code),
source: error_1.diagnosicSource,

@@ -15,0 +15,0 @@ message: source.message,

{
"name": "dot-language-support",
"version": "1.5.3",
"version": "1.5.4",
"description": "Parser and language service for graphviz (dot) files",

@@ -31,8 +31,8 @@ "author": "Niklas Mollenhauer",

"devDependencies": {
"@types/chai": "^4.2.21",
"@types/chai": "^4.2.22",
"@types/mocha": "^9.0.0",
"chai": "^4.3.4",
"mocha": "^9.0.3",
"ts-node": "^10.1.0",
"typescript": "^4.3.5",
"mocha": "^9.1.2",
"ts-node": "^10.2.1",
"typescript": "^4.4.3",
"vscode-languageserver": "^7.0.0"

@@ -39,0 +39,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc