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.1.6 to 1.1.7

2

lib/checker.d.ts

@@ -13,2 +13,2 @@ import { SyntaxNode, Identifier, SyntaxKind, Graph, EdgeStatement, EdgeRhs, SourceFile, SubGraphStatement, NodeId, AttributeStatement, Statement, StatementOf, Token } from "./types";

export declare function edgeStatementHasAttributes(es: EdgeStatement): boolean;
export declare function getIdentifierText(n: Identifier): string | undefined;
export declare function getIdentifierText(n: Identifier): string;

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

const util_1 = require("./util");
const common_1 = require("./command/common");
function hover(doc, sourceFile, position) {

@@ -69,2 +70,4 @@ const offset = doc.offsetAt(position);

}
case types_1.SyntaxKind.EdgeRhs:
return getEdgeHover(parent);
}

@@ -86,2 +89,5 @@ return types_1.SyntaxKind[parent.kind];

return getGraphHover(n);
case types_1.SyntaxKind.DirectedEdgeOp:
case types_1.SyntaxKind.UndirectedEdgeOp:
return getEdgeHover(n.parent);
default:

@@ -99,2 +105,26 @@ return undefined;

}
function getEdgeHover(n) {
const p = n.parent;
if (!p || p.rhs.length === 0)
return undefined;
let source = undefined;
for (const curr of p.rhs) {
if (curr === n)
break;
source = curr.target;
}
if (source === undefined)
source = p.source;
const edgeOpStr = common_1.getEdgeStr(n.operation.kind);
return source === undefined
? undefined
: `(edge) ${getEdgeSourceOrTargetText(source)} ${edgeOpStr} ${getEdgeSourceOrTargetText(n.target)}`;
}
function getEdgeSourceOrTargetText(n) {
return n.kind === types_1.SyntaxKind.NodeId
? checker_1.getIdentifierText(n.id)
: n.id !== undefined
? `${checker_1.getIdentifierText(n.id)}`
: "sub graph";
}
//# sourceMappingURL=hover.js.map
{
"name": "dot-language-support",
"version": "1.1.6",
"version": "1.1.7",
"description": "Parser and language service for graphviz (dot) files",

@@ -11,3 +11,3 @@ "author": "Niklas Mollenhauer",

"test": "mocha -r ts-node/register tests/**/*.spec.ts tests/*.spec.ts",
"clean": "rm -rv -- lib/* || true",
"clean": "rimraf lib",
"compile": "tsc",

@@ -36,2 +36,3 @@ "prepare": "npm run compile"

"mocha": "^5.2.0",
"rimraf": "^2.6.2",
"ts-node": "^6.0.5",

@@ -38,0 +39,0 @@ "typescript": "^2.9.1",

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