* Show more info on hover for variables Signed-off-by: Nick Cameron <nrc@ncameron.org> * Move hover impls to lsp module Signed-off-by: Nick Cameron <nrc@ncameron.org> * Make hover work on names inside calls, fix doc line breaking, trim docs in tool tips Signed-off-by: Nick Cameron <nrc@ncameron.org> * Test the new hovers; fix signature syntax Signed-off-by: Nick Cameron <nrc@ncameron.org> * Hover tips for kwargs Signed-off-by: Nick Cameron <nrc@ncameron.org> --------- Signed-off-by: Nick Cameron <nrc@ncameron.org>
815 lines
27 KiB
Plaintext
815 lines
27 KiB
Plaintext
---
|
|
source: kcl-lib/src/simulation_tests.rs
|
|
description: Result of parsing sketch_on_face_start.kcl
|
|
---
|
|
{
|
|
"Ok": {
|
|
"body": [
|
|
{
|
|
"declaration": {
|
|
"end": 184,
|
|
"id": {
|
|
"end": 7,
|
|
"name": "cube",
|
|
"start": 3,
|
|
"type": "Identifier"
|
|
},
|
|
"init": {
|
|
"body": {
|
|
"body": [
|
|
{
|
|
"declaration": {
|
|
"end": 169,
|
|
"id": {
|
|
"end": 26,
|
|
"name": "sg",
|
|
"start": 24,
|
|
"type": "Identifier"
|
|
},
|
|
"init": {
|
|
"body": [
|
|
{
|
|
"arguments": [
|
|
{
|
|
"end": 47,
|
|
"raw": "'XY'",
|
|
"start": 43,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": "XY"
|
|
}
|
|
],
|
|
"callee": {
|
|
"end": 42,
|
|
"name": "startSketchOn",
|
|
"start": 29,
|
|
"type": "Identifier"
|
|
},
|
|
"end": 48,
|
|
"start": 29,
|
|
"type": "CallExpression",
|
|
"type": "CallExpression"
|
|
},
|
|
{
|
|
"arguments": [
|
|
{
|
|
"end": 74,
|
|
"name": "pos",
|
|
"start": 71,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
},
|
|
{
|
|
"end": 77,
|
|
"start": 76,
|
|
"type": "PipeSubstitution",
|
|
"type": "PipeSubstitution"
|
|
}
|
|
],
|
|
"callee": {
|
|
"end": 70,
|
|
"name": "startProfileAt",
|
|
"start": 56,
|
|
"type": "Identifier"
|
|
},
|
|
"end": 78,
|
|
"start": 56,
|
|
"type": "CallExpression",
|
|
"type": "CallExpression"
|
|
},
|
|
{
|
|
"arguments": [
|
|
{
|
|
"type": "LabeledArg",
|
|
"label": {
|
|
"end": 94,
|
|
"name": "end",
|
|
"start": 91,
|
|
"type": "Identifier"
|
|
},
|
|
"arg": {
|
|
"elements": [
|
|
{
|
|
"end": 99,
|
|
"raw": "0",
|
|
"start": 98,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 0.0,
|
|
"suffix": "None"
|
|
}
|
|
},
|
|
{
|
|
"end": 106,
|
|
"name": "scale",
|
|
"start": 101,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
}
|
|
],
|
|
"end": 107,
|
|
"start": 97,
|
|
"type": "ArrayExpression",
|
|
"type": "ArrayExpression"
|
|
}
|
|
}
|
|
],
|
|
"callee": {
|
|
"end": 90,
|
|
"name": "line",
|
|
"start": 86,
|
|
"type": "Identifier"
|
|
},
|
|
"end": 108,
|
|
"start": 86,
|
|
"type": "CallExpressionKw",
|
|
"type": "CallExpressionKw",
|
|
"unlabeled": null
|
|
},
|
|
{
|
|
"arguments": [
|
|
{
|
|
"type": "LabeledArg",
|
|
"label": {
|
|
"end": 124,
|
|
"name": "end",
|
|
"start": 121,
|
|
"type": "Identifier"
|
|
},
|
|
"arg": {
|
|
"elements": [
|
|
{
|
|
"end": 133,
|
|
"name": "scale",
|
|
"start": 128,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
},
|
|
{
|
|
"end": 136,
|
|
"raw": "0",
|
|
"start": 135,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 0.0,
|
|
"suffix": "None"
|
|
}
|
|
}
|
|
],
|
|
"end": 137,
|
|
"start": 127,
|
|
"type": "ArrayExpression",
|
|
"type": "ArrayExpression"
|
|
}
|
|
}
|
|
],
|
|
"callee": {
|
|
"end": 120,
|
|
"name": "line",
|
|
"start": 116,
|
|
"type": "Identifier"
|
|
},
|
|
"end": 138,
|
|
"start": 116,
|
|
"type": "CallExpressionKw",
|
|
"type": "CallExpressionKw",
|
|
"unlabeled": null
|
|
},
|
|
{
|
|
"arguments": [
|
|
{
|
|
"type": "LabeledArg",
|
|
"label": {
|
|
"end": 154,
|
|
"name": "end",
|
|
"start": 151,
|
|
"type": "Identifier"
|
|
},
|
|
"arg": {
|
|
"elements": [
|
|
{
|
|
"end": 159,
|
|
"raw": "0",
|
|
"start": 158,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 0.0,
|
|
"suffix": "None"
|
|
}
|
|
},
|
|
{
|
|
"argument": {
|
|
"end": 167,
|
|
"name": "scale",
|
|
"start": 162,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
},
|
|
"end": 167,
|
|
"operator": "-",
|
|
"start": 161,
|
|
"type": "UnaryExpression",
|
|
"type": "UnaryExpression"
|
|
}
|
|
],
|
|
"end": 168,
|
|
"start": 157,
|
|
"type": "ArrayExpression",
|
|
"type": "ArrayExpression"
|
|
}
|
|
}
|
|
],
|
|
"callee": {
|
|
"end": 150,
|
|
"name": "line",
|
|
"start": 146,
|
|
"type": "Identifier"
|
|
},
|
|
"end": 169,
|
|
"start": 146,
|
|
"type": "CallExpressionKw",
|
|
"type": "CallExpressionKw",
|
|
"unlabeled": null
|
|
}
|
|
],
|
|
"end": 169,
|
|
"start": 29,
|
|
"type": "PipeExpression",
|
|
"type": "PipeExpression"
|
|
},
|
|
"start": 24,
|
|
"type": "VariableDeclarator"
|
|
},
|
|
"end": 169,
|
|
"kind": "const",
|
|
"start": 24,
|
|
"type": "VariableDeclaration",
|
|
"type": "VariableDeclaration"
|
|
},
|
|
{
|
|
"argument": {
|
|
"end": 182,
|
|
"name": "sg",
|
|
"start": 180,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
},
|
|
"end": 182,
|
|
"start": 173,
|
|
"type": "ReturnStatement",
|
|
"type": "ReturnStatement"
|
|
}
|
|
],
|
|
"end": 184,
|
|
"nonCodeMeta": {
|
|
"nonCodeNodes": {
|
|
"0": [
|
|
{
|
|
"end": 173,
|
|
"start": 169,
|
|
"type": "NonCodeNode",
|
|
"value": {
|
|
"type": "newLine"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"startNodes": []
|
|
},
|
|
"start": 20
|
|
},
|
|
"end": 184,
|
|
"params": [
|
|
{
|
|
"type": "Parameter",
|
|
"identifier": {
|
|
"end": 11,
|
|
"name": "pos",
|
|
"start": 8,
|
|
"type": "Identifier"
|
|
}
|
|
},
|
|
{
|
|
"type": "Parameter",
|
|
"identifier": {
|
|
"end": 18,
|
|
"name": "scale",
|
|
"start": 13,
|
|
"type": "Identifier"
|
|
}
|
|
}
|
|
],
|
|
"start": 7,
|
|
"type": "FunctionExpression",
|
|
"type": "FunctionExpression"
|
|
},
|
|
"start": 3,
|
|
"type": "VariableDeclarator"
|
|
},
|
|
"end": 184,
|
|
"kind": "fn",
|
|
"start": 0,
|
|
"type": "VariableDeclaration",
|
|
"type": "VariableDeclaration"
|
|
},
|
|
{
|
|
"declaration": {
|
|
"end": 258,
|
|
"id": {
|
|
"end": 192,
|
|
"name": "part001",
|
|
"start": 185,
|
|
"type": "Identifier"
|
|
},
|
|
"init": {
|
|
"body": [
|
|
{
|
|
"arguments": [
|
|
{
|
|
"elements": [
|
|
{
|
|
"end": 202,
|
|
"raw": "0",
|
|
"start": 201,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 0.0,
|
|
"suffix": "None"
|
|
}
|
|
},
|
|
{
|
|
"end": 205,
|
|
"raw": "0",
|
|
"start": 204,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 0.0,
|
|
"suffix": "None"
|
|
}
|
|
}
|
|
],
|
|
"end": 206,
|
|
"start": 200,
|
|
"type": "ArrayExpression",
|
|
"type": "ArrayExpression"
|
|
},
|
|
{
|
|
"end": 210,
|
|
"raw": "20",
|
|
"start": 208,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 20.0,
|
|
"suffix": "None"
|
|
}
|
|
}
|
|
],
|
|
"callee": {
|
|
"end": 199,
|
|
"name": "cube",
|
|
"start": 195,
|
|
"type": "Identifier"
|
|
},
|
|
"end": 211,
|
|
"start": 195,
|
|
"type": "CallExpression",
|
|
"type": "CallExpression"
|
|
},
|
|
{
|
|
"arguments": [
|
|
{
|
|
"end": 224,
|
|
"start": 223,
|
|
"type": "PipeSubstitution",
|
|
"type": "PipeSubstitution"
|
|
}
|
|
],
|
|
"callee": {
|
|
"end": 222,
|
|
"name": "close",
|
|
"start": 217,
|
|
"type": "Identifier"
|
|
},
|
|
"end": 225,
|
|
"start": 217,
|
|
"type": "CallExpression",
|
|
"type": "CallExpression"
|
|
},
|
|
{
|
|
"end": 258,
|
|
"expr": {
|
|
"arguments": [
|
|
{
|
|
"type": "LabeledArg",
|
|
"label": {
|
|
"end": 245,
|
|
"name": "length",
|
|
"start": 239,
|
|
"type": "Identifier"
|
|
},
|
|
"arg": {
|
|
"end": 250,
|
|
"raw": "20",
|
|
"start": 248,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 20.0,
|
|
"suffix": "None"
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"callee": {
|
|
"end": 238,
|
|
"name": "extrude",
|
|
"start": 231,
|
|
"type": "Identifier"
|
|
},
|
|
"end": 251,
|
|
"start": 231,
|
|
"type": "CallExpressionKw",
|
|
"type": "CallExpressionKw",
|
|
"unlabeled": null
|
|
},
|
|
"label": {
|
|
"end": 258,
|
|
"name": "foo",
|
|
"start": 255,
|
|
"type": "Identifier"
|
|
},
|
|
"start": 231,
|
|
"type": "LabelledExpression",
|
|
"type": "LabelledExpression"
|
|
}
|
|
],
|
|
"end": 258,
|
|
"start": 195,
|
|
"type": "PipeExpression",
|
|
"type": "PipeExpression"
|
|
},
|
|
"start": 185,
|
|
"type": "VariableDeclarator"
|
|
},
|
|
"end": 258,
|
|
"kind": "const",
|
|
"start": 185,
|
|
"type": "VariableDeclaration",
|
|
"type": "VariableDeclaration"
|
|
},
|
|
{
|
|
"declaration": {
|
|
"end": 443,
|
|
"id": {
|
|
"end": 267,
|
|
"name": "part002",
|
|
"start": 260,
|
|
"type": "Identifier"
|
|
},
|
|
"init": {
|
|
"body": [
|
|
{
|
|
"arguments": [
|
|
{
|
|
"end": 287,
|
|
"name": "foo",
|
|
"start": 284,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
},
|
|
{
|
|
"end": 296,
|
|
"raw": "\"start\"",
|
|
"start": 289,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": "start"
|
|
}
|
|
],
|
|
"callee": {
|
|
"end": 283,
|
|
"name": "startSketchOn",
|
|
"start": 270,
|
|
"type": "Identifier"
|
|
},
|
|
"end": 297,
|
|
"start": 270,
|
|
"type": "CallExpression",
|
|
"type": "CallExpression"
|
|
},
|
|
{
|
|
"arguments": [
|
|
{
|
|
"elements": [
|
|
{
|
|
"end": 320,
|
|
"raw": "0",
|
|
"start": 319,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 0.0,
|
|
"suffix": "None"
|
|
}
|
|
},
|
|
{
|
|
"end": 323,
|
|
"raw": "0",
|
|
"start": 322,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 0.0,
|
|
"suffix": "None"
|
|
}
|
|
}
|
|
],
|
|
"end": 324,
|
|
"start": 318,
|
|
"type": "ArrayExpression",
|
|
"type": "ArrayExpression"
|
|
},
|
|
{
|
|
"end": 327,
|
|
"start": 326,
|
|
"type": "PipeSubstitution",
|
|
"type": "PipeSubstitution"
|
|
}
|
|
],
|
|
"callee": {
|
|
"end": 317,
|
|
"name": "startProfileAt",
|
|
"start": 303,
|
|
"type": "Identifier"
|
|
},
|
|
"end": 328,
|
|
"start": 303,
|
|
"type": "CallExpression",
|
|
"type": "CallExpression"
|
|
},
|
|
{
|
|
"arguments": [
|
|
{
|
|
"type": "LabeledArg",
|
|
"label": {
|
|
"end": 342,
|
|
"name": "end",
|
|
"start": 339,
|
|
"type": "Identifier"
|
|
},
|
|
"arg": {
|
|
"elements": [
|
|
{
|
|
"end": 347,
|
|
"raw": "0",
|
|
"start": 346,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 0.0,
|
|
"suffix": "None"
|
|
}
|
|
},
|
|
{
|
|
"end": 351,
|
|
"raw": "10",
|
|
"start": 349,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 10.0,
|
|
"suffix": "None"
|
|
}
|
|
}
|
|
],
|
|
"end": 352,
|
|
"start": 345,
|
|
"type": "ArrayExpression",
|
|
"type": "ArrayExpression"
|
|
}
|
|
}
|
|
],
|
|
"callee": {
|
|
"end": 338,
|
|
"name": "line",
|
|
"start": 334,
|
|
"type": "Identifier"
|
|
},
|
|
"end": 353,
|
|
"start": 334,
|
|
"type": "CallExpressionKw",
|
|
"type": "CallExpressionKw",
|
|
"unlabeled": null
|
|
},
|
|
{
|
|
"arguments": [
|
|
{
|
|
"type": "LabeledArg",
|
|
"label": {
|
|
"end": 367,
|
|
"name": "end",
|
|
"start": 364,
|
|
"type": "Identifier"
|
|
},
|
|
"arg": {
|
|
"elements": [
|
|
{
|
|
"end": 373,
|
|
"raw": "10",
|
|
"start": 371,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 10.0,
|
|
"suffix": "None"
|
|
}
|
|
},
|
|
{
|
|
"end": 376,
|
|
"raw": "0",
|
|
"start": 375,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 0.0,
|
|
"suffix": "None"
|
|
}
|
|
}
|
|
],
|
|
"end": 377,
|
|
"start": 370,
|
|
"type": "ArrayExpression",
|
|
"type": "ArrayExpression"
|
|
}
|
|
}
|
|
],
|
|
"callee": {
|
|
"end": 363,
|
|
"name": "line",
|
|
"start": 359,
|
|
"type": "Identifier"
|
|
},
|
|
"end": 378,
|
|
"start": 359,
|
|
"type": "CallExpressionKw",
|
|
"type": "CallExpressionKw",
|
|
"unlabeled": null
|
|
},
|
|
{
|
|
"arguments": [
|
|
{
|
|
"type": "LabeledArg",
|
|
"label": {
|
|
"end": 392,
|
|
"name": "end",
|
|
"start": 389,
|
|
"type": "Identifier"
|
|
},
|
|
"arg": {
|
|
"elements": [
|
|
{
|
|
"end": 397,
|
|
"raw": "0",
|
|
"start": 396,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 0.0,
|
|
"suffix": "None"
|
|
}
|
|
},
|
|
{
|
|
"argument": {
|
|
"end": 402,
|
|
"raw": "10",
|
|
"start": 400,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 10.0,
|
|
"suffix": "None"
|
|
}
|
|
},
|
|
"end": 402,
|
|
"operator": "-",
|
|
"start": 399,
|
|
"type": "UnaryExpression",
|
|
"type": "UnaryExpression"
|
|
}
|
|
],
|
|
"end": 403,
|
|
"start": 395,
|
|
"type": "ArrayExpression",
|
|
"type": "ArrayExpression"
|
|
}
|
|
}
|
|
],
|
|
"callee": {
|
|
"end": 388,
|
|
"name": "line",
|
|
"start": 384,
|
|
"type": "Identifier"
|
|
},
|
|
"end": 404,
|
|
"start": 384,
|
|
"type": "CallExpressionKw",
|
|
"type": "CallExpressionKw",
|
|
"unlabeled": null
|
|
},
|
|
{
|
|
"arguments": [
|
|
{
|
|
"end": 417,
|
|
"start": 416,
|
|
"type": "PipeSubstitution",
|
|
"type": "PipeSubstitution"
|
|
}
|
|
],
|
|
"callee": {
|
|
"end": 415,
|
|
"name": "close",
|
|
"start": 410,
|
|
"type": "Identifier"
|
|
},
|
|
"end": 418,
|
|
"start": 410,
|
|
"type": "CallExpression",
|
|
"type": "CallExpression"
|
|
},
|
|
{
|
|
"arguments": [
|
|
{
|
|
"type": "LabeledArg",
|
|
"label": {
|
|
"end": 438,
|
|
"name": "length",
|
|
"start": 432,
|
|
"type": "Identifier"
|
|
},
|
|
"arg": {
|
|
"end": 442,
|
|
"raw": "5",
|
|
"start": 441,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 5.0,
|
|
"suffix": "None"
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"callee": {
|
|
"end": 431,
|
|
"name": "extrude",
|
|
"start": 424,
|
|
"type": "Identifier"
|
|
},
|
|
"end": 443,
|
|
"start": 424,
|
|
"type": "CallExpressionKw",
|
|
"type": "CallExpressionKw",
|
|
"unlabeled": null
|
|
}
|
|
],
|
|
"end": 443,
|
|
"start": 270,
|
|
"type": "PipeExpression",
|
|
"type": "PipeExpression"
|
|
},
|
|
"start": 260,
|
|
"type": "VariableDeclarator"
|
|
},
|
|
"end": 443,
|
|
"kind": "const",
|
|
"start": 260,
|
|
"type": "VariableDeclaration",
|
|
"type": "VariableDeclaration"
|
|
}
|
|
],
|
|
"end": 444,
|
|
"nonCodeMeta": {
|
|
"nonCodeNodes": {
|
|
"1": [
|
|
{
|
|
"end": 260,
|
|
"start": 258,
|
|
"type": "NonCodeNode",
|
|
"value": {
|
|
"type": "newLine"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"startNodes": []
|
|
},
|
|
"start": 0
|
|
}
|
|
}
|