* 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>
486 lines
17 KiB
Plaintext
486 lines
17 KiB
Plaintext
---
|
|
source: kcl-lib/src/simulation_tests.rs
|
|
description: Result of parsing function_sketch.kcl
|
|
---
|
|
{
|
|
"Ok": {
|
|
"body": [
|
|
{
|
|
"declaration": {
|
|
"end": 220,
|
|
"id": {
|
|
"end": 6,
|
|
"name": "box",
|
|
"start": 3,
|
|
"type": "Identifier"
|
|
},
|
|
"init": {
|
|
"body": {
|
|
"body": [
|
|
{
|
|
"declaration": {
|
|
"end": 202,
|
|
"id": {
|
|
"end": 25,
|
|
"name": "myBox",
|
|
"start": 20,
|
|
"type": "Identifier"
|
|
},
|
|
"init": {
|
|
"body": [
|
|
{
|
|
"arguments": [
|
|
{
|
|
"end": 46,
|
|
"raw": "'XY'",
|
|
"start": 42,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": "XY"
|
|
}
|
|
],
|
|
"callee": {
|
|
"end": 41,
|
|
"name": "startSketchOn",
|
|
"start": 28,
|
|
"type": "Identifier"
|
|
},
|
|
"end": 47,
|
|
"start": 28,
|
|
"type": "CallExpression",
|
|
"type": "CallExpression"
|
|
},
|
|
{
|
|
"arguments": [
|
|
{
|
|
"elements": [
|
|
{
|
|
"end": 72,
|
|
"raw": "0",
|
|
"start": 71,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 0.0,
|
|
"suffix": "None"
|
|
}
|
|
},
|
|
{
|
|
"end": 75,
|
|
"raw": "0",
|
|
"start": 74,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 0.0,
|
|
"suffix": "None"
|
|
}
|
|
}
|
|
],
|
|
"end": 76,
|
|
"start": 70,
|
|
"type": "ArrayExpression",
|
|
"type": "ArrayExpression"
|
|
},
|
|
{
|
|
"end": 79,
|
|
"start": 78,
|
|
"type": "PipeSubstitution",
|
|
"type": "PipeSubstitution"
|
|
}
|
|
],
|
|
"callee": {
|
|
"end": 69,
|
|
"name": "startProfileAt",
|
|
"start": 55,
|
|
"type": "Identifier"
|
|
},
|
|
"end": 80,
|
|
"start": 55,
|
|
"type": "CallExpression",
|
|
"type": "CallExpression"
|
|
},
|
|
{
|
|
"arguments": [
|
|
{
|
|
"type": "LabeledArg",
|
|
"label": {
|
|
"end": 96,
|
|
"name": "end",
|
|
"start": 93,
|
|
"type": "Identifier"
|
|
},
|
|
"arg": {
|
|
"elements": [
|
|
{
|
|
"end": 101,
|
|
"raw": "0",
|
|
"start": 100,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 0.0,
|
|
"suffix": "None"
|
|
}
|
|
},
|
|
{
|
|
"end": 104,
|
|
"name": "l",
|
|
"start": 103,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
}
|
|
],
|
|
"end": 105,
|
|
"start": 99,
|
|
"type": "ArrayExpression",
|
|
"type": "ArrayExpression"
|
|
}
|
|
}
|
|
],
|
|
"callee": {
|
|
"end": 92,
|
|
"name": "line",
|
|
"start": 88,
|
|
"type": "Identifier"
|
|
},
|
|
"end": 106,
|
|
"start": 88,
|
|
"type": "CallExpressionKw",
|
|
"type": "CallExpressionKw",
|
|
"unlabeled": null
|
|
},
|
|
{
|
|
"arguments": [
|
|
{
|
|
"type": "LabeledArg",
|
|
"label": {
|
|
"end": 122,
|
|
"name": "end",
|
|
"start": 119,
|
|
"type": "Identifier"
|
|
},
|
|
"arg": {
|
|
"elements": [
|
|
{
|
|
"end": 127,
|
|
"name": "w",
|
|
"start": 126,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
},
|
|
{
|
|
"end": 130,
|
|
"raw": "0",
|
|
"start": 129,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 0.0,
|
|
"suffix": "None"
|
|
}
|
|
}
|
|
],
|
|
"end": 131,
|
|
"start": 125,
|
|
"type": "ArrayExpression",
|
|
"type": "ArrayExpression"
|
|
}
|
|
}
|
|
],
|
|
"callee": {
|
|
"end": 118,
|
|
"name": "line",
|
|
"start": 114,
|
|
"type": "Identifier"
|
|
},
|
|
"end": 132,
|
|
"start": 114,
|
|
"type": "CallExpressionKw",
|
|
"type": "CallExpressionKw",
|
|
"unlabeled": null
|
|
},
|
|
{
|
|
"arguments": [
|
|
{
|
|
"type": "LabeledArg",
|
|
"label": {
|
|
"end": 148,
|
|
"name": "end",
|
|
"start": 145,
|
|
"type": "Identifier"
|
|
},
|
|
"arg": {
|
|
"elements": [
|
|
{
|
|
"end": 153,
|
|
"raw": "0",
|
|
"start": 152,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 0.0,
|
|
"suffix": "None"
|
|
}
|
|
},
|
|
{
|
|
"argument": {
|
|
"end": 157,
|
|
"name": "l",
|
|
"start": 156,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
},
|
|
"end": 157,
|
|
"operator": "-",
|
|
"start": 155,
|
|
"type": "UnaryExpression",
|
|
"type": "UnaryExpression"
|
|
}
|
|
],
|
|
"end": 158,
|
|
"start": 151,
|
|
"type": "ArrayExpression",
|
|
"type": "ArrayExpression"
|
|
}
|
|
}
|
|
],
|
|
"callee": {
|
|
"end": 144,
|
|
"name": "line",
|
|
"start": 140,
|
|
"type": "Identifier"
|
|
},
|
|
"end": 159,
|
|
"start": 140,
|
|
"type": "CallExpressionKw",
|
|
"type": "CallExpressionKw",
|
|
"unlabeled": null
|
|
},
|
|
{
|
|
"arguments": [
|
|
{
|
|
"end": 174,
|
|
"start": 173,
|
|
"type": "PipeSubstitution",
|
|
"type": "PipeSubstitution"
|
|
}
|
|
],
|
|
"callee": {
|
|
"end": 172,
|
|
"name": "close",
|
|
"start": 167,
|
|
"type": "Identifier"
|
|
},
|
|
"end": 175,
|
|
"start": 167,
|
|
"type": "CallExpression",
|
|
"type": "CallExpression"
|
|
},
|
|
{
|
|
"arguments": [
|
|
{
|
|
"type": "LabeledArg",
|
|
"label": {
|
|
"end": 197,
|
|
"name": "length",
|
|
"start": 191,
|
|
"type": "Identifier"
|
|
},
|
|
"arg": {
|
|
"end": 201,
|
|
"name": "h",
|
|
"start": 200,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
}
|
|
}
|
|
],
|
|
"callee": {
|
|
"end": 190,
|
|
"name": "extrude",
|
|
"start": 183,
|
|
"type": "Identifier"
|
|
},
|
|
"end": 202,
|
|
"start": 183,
|
|
"type": "CallExpressionKw",
|
|
"type": "CallExpressionKw",
|
|
"unlabeled": null
|
|
}
|
|
],
|
|
"end": 202,
|
|
"start": 28,
|
|
"type": "PipeExpression",
|
|
"type": "PipeExpression"
|
|
},
|
|
"start": 20,
|
|
"type": "VariableDeclarator"
|
|
},
|
|
"end": 202,
|
|
"kind": "const",
|
|
"start": 20,
|
|
"type": "VariableDeclaration",
|
|
"type": "VariableDeclaration"
|
|
},
|
|
{
|
|
"argument": {
|
|
"end": 218,
|
|
"name": "myBox",
|
|
"start": 213,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
},
|
|
"end": 218,
|
|
"start": 206,
|
|
"type": "ReturnStatement",
|
|
"type": "ReturnStatement"
|
|
}
|
|
],
|
|
"end": 220,
|
|
"nonCodeMeta": {
|
|
"nonCodeNodes": {
|
|
"0": [
|
|
{
|
|
"end": 206,
|
|
"start": 202,
|
|
"type": "NonCodeNode",
|
|
"value": {
|
|
"type": "newLine"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"startNodes": []
|
|
},
|
|
"start": 16
|
|
},
|
|
"end": 220,
|
|
"params": [
|
|
{
|
|
"type": "Parameter",
|
|
"identifier": {
|
|
"end": 8,
|
|
"name": "h",
|
|
"start": 7,
|
|
"type": "Identifier"
|
|
}
|
|
},
|
|
{
|
|
"type": "Parameter",
|
|
"identifier": {
|
|
"end": 11,
|
|
"name": "l",
|
|
"start": 10,
|
|
"type": "Identifier"
|
|
}
|
|
},
|
|
{
|
|
"type": "Parameter",
|
|
"identifier": {
|
|
"end": 14,
|
|
"name": "w",
|
|
"start": 13,
|
|
"type": "Identifier"
|
|
}
|
|
}
|
|
],
|
|
"start": 6,
|
|
"type": "FunctionExpression",
|
|
"type": "FunctionExpression"
|
|
},
|
|
"start": 3,
|
|
"type": "VariableDeclarator"
|
|
},
|
|
"end": 220,
|
|
"kind": "fn",
|
|
"start": 0,
|
|
"type": "VariableDeclaration",
|
|
"type": "VariableDeclaration"
|
|
},
|
|
{
|
|
"declaration": {
|
|
"end": 243,
|
|
"id": {
|
|
"end": 227,
|
|
"name": "fnBox",
|
|
"start": 222,
|
|
"type": "Identifier"
|
|
},
|
|
"init": {
|
|
"arguments": [
|
|
{
|
|
"end": 235,
|
|
"raw": "3",
|
|
"start": 234,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 3.0,
|
|
"suffix": "None"
|
|
}
|
|
},
|
|
{
|
|
"end": 238,
|
|
"raw": "6",
|
|
"start": 237,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 6.0,
|
|
"suffix": "None"
|
|
}
|
|
},
|
|
{
|
|
"end": 242,
|
|
"raw": "10",
|
|
"start": 240,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 10.0,
|
|
"suffix": "None"
|
|
}
|
|
}
|
|
],
|
|
"callee": {
|
|
"end": 233,
|
|
"name": "box",
|
|
"start": 230,
|
|
"type": "Identifier"
|
|
},
|
|
"end": 243,
|
|
"start": 230,
|
|
"type": "CallExpression",
|
|
"type": "CallExpression"
|
|
},
|
|
"start": 222,
|
|
"type": "VariableDeclarator"
|
|
},
|
|
"end": 243,
|
|
"kind": "const",
|
|
"start": 222,
|
|
"type": "VariableDeclaration",
|
|
"type": "VariableDeclaration"
|
|
}
|
|
],
|
|
"end": 244,
|
|
"nonCodeMeta": {
|
|
"nonCodeNodes": {
|
|
"0": [
|
|
{
|
|
"end": 222,
|
|
"start": 220,
|
|
"type": "NonCodeNode",
|
|
"value": {
|
|
"type": "newLine"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"startNodes": []
|
|
},
|
|
"start": 0
|
|
}
|
|
}
|