dot-language-support
Advanced tools
Comparing version 1.1.7 to 1.1.8
@@ -26,4 +26,7 @@ "use strict"; | ||
} | ||
function rangeContainsOffset(range, offset) { | ||
return range.pos <= offset && offset <= range.end; | ||
} | ||
function findNodeAtOffset(root, offset) { | ||
if (root.pos <= offset && offset <= root.end) { | ||
if (rangeContainsOffset(root, offset)) { | ||
let candidate = root; | ||
@@ -30,0 +33,0 @@ visitor_1.forEachChild(root, n => { |
@@ -173,3 +173,3 @@ "use strict"; | ||
subgraphStatement.terminator = this.parseExpectedToken(types_1.SyntaxKind.SemicolonToken); | ||
return subgraphStatement; | ||
return this.finishNode(subgraphStatement); | ||
} | ||
@@ -180,3 +180,3 @@ if (this.isEdgeOp()) | ||
subgraphStatement.subgraph = subgraph; | ||
return subgraphStatement; | ||
return this.finishNode(subgraphStatement); | ||
default: { | ||
@@ -183,0 +183,0 @@ if (!this.isIdentifier) |
@@ -7,6 +7,4 @@ "use strict"; | ||
const main_1 = require("vscode-languageserver-types/lib/umd/main"); | ||
const completion_1 = require("./service/completion"); | ||
const text = `graph { | ||
a -- b [color=,shape=box]; | ||
}`; | ||
const hover_1 = require("./service/hover"); | ||
const text = `graph{subgraph{c--a;c--b}}`; | ||
function main() { | ||
@@ -18,7 +16,6 @@ const parser = new parser_1.Parser(); | ||
const doc = main_1.TextDocument.create("inmemory://model.json", "DOT", 0, text); | ||
const requestOffset = text.indexOf("color=") + "color=".length; | ||
const completions = completion_1.getCompletions(doc, sf, doc.positionAt(requestOffset)); | ||
console.dir(completions); | ||
const h = hover_1.hover(doc, sf, doc.positionAt(15)); | ||
console.dir(h); | ||
} | ||
main(); | ||
//# sourceMappingURL=tester.js.map |
{ | ||
"name": "dot-language-support", | ||
"version": "1.1.7", | ||
"version": "1.1.8", | ||
"description": "Parser and language service for graphviz (dot) files", | ||
@@ -5,0 +5,0 @@ "author": "Niklas Mollenhauer", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
157801