* 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>
		
			
				
	
	
		
			502 lines
		
	
	
		
			17 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			502 lines
		
	
	
		
			17 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
---
 | 
						|
source: kcl-lib/src/simulation_tests.rs
 | 
						|
description: Result of parsing function_sketch_with_position.kcl
 | 
						|
---
 | 
						|
{
 | 
						|
  "Ok": {
 | 
						|
    "body": [
 | 
						|
      {
 | 
						|
        "declaration": {
 | 
						|
          "end": 218,
 | 
						|
          "id": {
 | 
						|
            "end": 6,
 | 
						|
            "name": "box",
 | 
						|
            "start": 3,
 | 
						|
            "type": "Identifier"
 | 
						|
          },
 | 
						|
          "init": {
 | 
						|
            "body": {
 | 
						|
              "body": [
 | 
						|
                {
 | 
						|
                  "declaration": {
 | 
						|
                    "end": 200,
 | 
						|
                    "id": {
 | 
						|
                      "end": 28,
 | 
						|
                      "name": "myBox",
 | 
						|
                      "start": 23,
 | 
						|
                      "type": "Identifier"
 | 
						|
                    },
 | 
						|
                    "init": {
 | 
						|
                      "body": [
 | 
						|
                        {
 | 
						|
                          "arguments": [
 | 
						|
                            {
 | 
						|
                              "end": 49,
 | 
						|
                              "raw": "'XY'",
 | 
						|
                              "start": 45,
 | 
						|
                              "type": "Literal",
 | 
						|
                              "type": "Literal",
 | 
						|
                              "value": "XY"
 | 
						|
                            }
 | 
						|
                          ],
 | 
						|
                          "callee": {
 | 
						|
                            "end": 44,
 | 
						|
                            "name": "startSketchOn",
 | 
						|
                            "start": 31,
 | 
						|
                            "type": "Identifier"
 | 
						|
                          },
 | 
						|
                          "end": 50,
 | 
						|
                          "start": 31,
 | 
						|
                          "type": "CallExpression",
 | 
						|
                          "type": "CallExpression"
 | 
						|
                        },
 | 
						|
                        {
 | 
						|
                          "arguments": [
 | 
						|
                            {
 | 
						|
                              "end": 74,
 | 
						|
                              "name": "p",
 | 
						|
                              "start": 73,
 | 
						|
                              "type": "Identifier",
 | 
						|
                              "type": "Identifier"
 | 
						|
                            },
 | 
						|
                            {
 | 
						|
                              "end": 77,
 | 
						|
                              "start": 76,
 | 
						|
                              "type": "PipeSubstitution",
 | 
						|
                              "type": "PipeSubstitution"
 | 
						|
                            }
 | 
						|
                          ],
 | 
						|
                          "callee": {
 | 
						|
                            "end": 72,
 | 
						|
                            "name": "startProfileAt",
 | 
						|
                            "start": 58,
 | 
						|
                            "type": "Identifier"
 | 
						|
                          },
 | 
						|
                          "end": 78,
 | 
						|
                          "start": 58,
 | 
						|
                          "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": 102,
 | 
						|
                                    "name": "l",
 | 
						|
                                    "start": 101,
 | 
						|
                                    "type": "Identifier",
 | 
						|
                                    "type": "Identifier"
 | 
						|
                                  }
 | 
						|
                                ],
 | 
						|
                                "end": 103,
 | 
						|
                                "start": 97,
 | 
						|
                                "type": "ArrayExpression",
 | 
						|
                                "type": "ArrayExpression"
 | 
						|
                              }
 | 
						|
                            }
 | 
						|
                          ],
 | 
						|
                          "callee": {
 | 
						|
                            "end": 90,
 | 
						|
                            "name": "line",
 | 
						|
                            "start": 86,
 | 
						|
                            "type": "Identifier"
 | 
						|
                          },
 | 
						|
                          "end": 104,
 | 
						|
                          "start": 86,
 | 
						|
                          "type": "CallExpressionKw",
 | 
						|
                          "type": "CallExpressionKw",
 | 
						|
                          "unlabeled": null
 | 
						|
                        },
 | 
						|
                        {
 | 
						|
                          "arguments": [
 | 
						|
                            {
 | 
						|
                              "type": "LabeledArg",
 | 
						|
                              "label": {
 | 
						|
                                "end": 120,
 | 
						|
                                "name": "end",
 | 
						|
                                "start": 117,
 | 
						|
                                "type": "Identifier"
 | 
						|
                              },
 | 
						|
                              "arg": {
 | 
						|
                                "elements": [
 | 
						|
                                  {
 | 
						|
                                    "end": 125,
 | 
						|
                                    "name": "w",
 | 
						|
                                    "start": 124,
 | 
						|
                                    "type": "Identifier",
 | 
						|
                                    "type": "Identifier"
 | 
						|
                                  },
 | 
						|
                                  {
 | 
						|
                                    "end": 128,
 | 
						|
                                    "raw": "0",
 | 
						|
                                    "start": 127,
 | 
						|
                                    "type": "Literal",
 | 
						|
                                    "type": "Literal",
 | 
						|
                                    "value": {
 | 
						|
                                      "value": 0.0,
 | 
						|
                                      "suffix": "None"
 | 
						|
                                    }
 | 
						|
                                  }
 | 
						|
                                ],
 | 
						|
                                "end": 129,
 | 
						|
                                "start": 123,
 | 
						|
                                "type": "ArrayExpression",
 | 
						|
                                "type": "ArrayExpression"
 | 
						|
                              }
 | 
						|
                            }
 | 
						|
                          ],
 | 
						|
                          "callee": {
 | 
						|
                            "end": 116,
 | 
						|
                            "name": "line",
 | 
						|
                            "start": 112,
 | 
						|
                            "type": "Identifier"
 | 
						|
                          },
 | 
						|
                          "end": 130,
 | 
						|
                          "start": 112,
 | 
						|
                          "type": "CallExpressionKw",
 | 
						|
                          "type": "CallExpressionKw",
 | 
						|
                          "unlabeled": null
 | 
						|
                        },
 | 
						|
                        {
 | 
						|
                          "arguments": [
 | 
						|
                            {
 | 
						|
                              "type": "LabeledArg",
 | 
						|
                              "label": {
 | 
						|
                                "end": 146,
 | 
						|
                                "name": "end",
 | 
						|
                                "start": 143,
 | 
						|
                                "type": "Identifier"
 | 
						|
                              },
 | 
						|
                              "arg": {
 | 
						|
                                "elements": [
 | 
						|
                                  {
 | 
						|
                                    "end": 151,
 | 
						|
                                    "raw": "0",
 | 
						|
                                    "start": 150,
 | 
						|
                                    "type": "Literal",
 | 
						|
                                    "type": "Literal",
 | 
						|
                                    "value": {
 | 
						|
                                      "value": 0.0,
 | 
						|
                                      "suffix": "None"
 | 
						|
                                    }
 | 
						|
                                  },
 | 
						|
                                  {
 | 
						|
                                    "argument": {
 | 
						|
                                      "end": 155,
 | 
						|
                                      "name": "l",
 | 
						|
                                      "start": 154,
 | 
						|
                                      "type": "Identifier",
 | 
						|
                                      "type": "Identifier"
 | 
						|
                                    },
 | 
						|
                                    "end": 155,
 | 
						|
                                    "operator": "-",
 | 
						|
                                    "start": 153,
 | 
						|
                                    "type": "UnaryExpression",
 | 
						|
                                    "type": "UnaryExpression"
 | 
						|
                                  }
 | 
						|
                                ],
 | 
						|
                                "end": 156,
 | 
						|
                                "start": 149,
 | 
						|
                                "type": "ArrayExpression",
 | 
						|
                                "type": "ArrayExpression"
 | 
						|
                              }
 | 
						|
                            }
 | 
						|
                          ],
 | 
						|
                          "callee": {
 | 
						|
                            "end": 142,
 | 
						|
                            "name": "line",
 | 
						|
                            "start": 138,
 | 
						|
                            "type": "Identifier"
 | 
						|
                          },
 | 
						|
                          "end": 157,
 | 
						|
                          "start": 138,
 | 
						|
                          "type": "CallExpressionKw",
 | 
						|
                          "type": "CallExpressionKw",
 | 
						|
                          "unlabeled": null
 | 
						|
                        },
 | 
						|
                        {
 | 
						|
                          "arguments": [
 | 
						|
                            {
 | 
						|
                              "end": 172,
 | 
						|
                              "start": 171,
 | 
						|
                              "type": "PipeSubstitution",
 | 
						|
                              "type": "PipeSubstitution"
 | 
						|
                            }
 | 
						|
                          ],
 | 
						|
                          "callee": {
 | 
						|
                            "end": 170,
 | 
						|
                            "name": "close",
 | 
						|
                            "start": 165,
 | 
						|
                            "type": "Identifier"
 | 
						|
                          },
 | 
						|
                          "end": 173,
 | 
						|
                          "start": 165,
 | 
						|
                          "type": "CallExpression",
 | 
						|
                          "type": "CallExpression"
 | 
						|
                        },
 | 
						|
                        {
 | 
						|
                          "arguments": [
 | 
						|
                            {
 | 
						|
                              "type": "LabeledArg",
 | 
						|
                              "label": {
 | 
						|
                                "end": 195,
 | 
						|
                                "name": "length",
 | 
						|
                                "start": 189,
 | 
						|
                                "type": "Identifier"
 | 
						|
                              },
 | 
						|
                              "arg": {
 | 
						|
                                "end": 199,
 | 
						|
                                "name": "h",
 | 
						|
                                "start": 198,
 | 
						|
                                "type": "Identifier",
 | 
						|
                                "type": "Identifier"
 | 
						|
                              }
 | 
						|
                            }
 | 
						|
                          ],
 | 
						|
                          "callee": {
 | 
						|
                            "end": 188,
 | 
						|
                            "name": "extrude",
 | 
						|
                            "start": 181,
 | 
						|
                            "type": "Identifier"
 | 
						|
                          },
 | 
						|
                          "end": 200,
 | 
						|
                          "start": 181,
 | 
						|
                          "type": "CallExpressionKw",
 | 
						|
                          "type": "CallExpressionKw",
 | 
						|
                          "unlabeled": null
 | 
						|
                        }
 | 
						|
                      ],
 | 
						|
                      "end": 200,
 | 
						|
                      "start": 31,
 | 
						|
                      "type": "PipeExpression",
 | 
						|
                      "type": "PipeExpression"
 | 
						|
                    },
 | 
						|
                    "start": 23,
 | 
						|
                    "type": "VariableDeclarator"
 | 
						|
                  },
 | 
						|
                  "end": 200,
 | 
						|
                  "kind": "const",
 | 
						|
                  "start": 23,
 | 
						|
                  "type": "VariableDeclaration",
 | 
						|
                  "type": "VariableDeclaration"
 | 
						|
                },
 | 
						|
                {
 | 
						|
                  "argument": {
 | 
						|
                    "end": 216,
 | 
						|
                    "name": "myBox",
 | 
						|
                    "start": 211,
 | 
						|
                    "type": "Identifier",
 | 
						|
                    "type": "Identifier"
 | 
						|
                  },
 | 
						|
                  "end": 216,
 | 
						|
                  "start": 204,
 | 
						|
                  "type": "ReturnStatement",
 | 
						|
                  "type": "ReturnStatement"
 | 
						|
                }
 | 
						|
              ],
 | 
						|
              "end": 218,
 | 
						|
              "nonCodeMeta": {
 | 
						|
                "nonCodeNodes": {
 | 
						|
                  "0": [
 | 
						|
                    {
 | 
						|
                      "end": 204,
 | 
						|
                      "start": 200,
 | 
						|
                      "type": "NonCodeNode",
 | 
						|
                      "value": {
 | 
						|
                        "type": "newLine"
 | 
						|
                      }
 | 
						|
                    }
 | 
						|
                  ]
 | 
						|
                },
 | 
						|
                "startNodes": []
 | 
						|
              },
 | 
						|
              "start": 19
 | 
						|
            },
 | 
						|
            "end": 218,
 | 
						|
            "params": [
 | 
						|
              {
 | 
						|
                "type": "Parameter",
 | 
						|
                "identifier": {
 | 
						|
                  "end": 8,
 | 
						|
                  "name": "p",
 | 
						|
                  "start": 7,
 | 
						|
                  "type": "Identifier"
 | 
						|
                }
 | 
						|
              },
 | 
						|
              {
 | 
						|
                "type": "Parameter",
 | 
						|
                "identifier": {
 | 
						|
                  "end": 11,
 | 
						|
                  "name": "h",
 | 
						|
                  "start": 10,
 | 
						|
                  "type": "Identifier"
 | 
						|
                }
 | 
						|
              },
 | 
						|
              {
 | 
						|
                "type": "Parameter",
 | 
						|
                "identifier": {
 | 
						|
                  "end": 14,
 | 
						|
                  "name": "l",
 | 
						|
                  "start": 13,
 | 
						|
                  "type": "Identifier"
 | 
						|
                }
 | 
						|
              },
 | 
						|
              {
 | 
						|
                "type": "Parameter",
 | 
						|
                "identifier": {
 | 
						|
                  "end": 17,
 | 
						|
                  "name": "w",
 | 
						|
                  "start": 16,
 | 
						|
                  "type": "Identifier"
 | 
						|
                }
 | 
						|
              }
 | 
						|
            ],
 | 
						|
            "start": 6,
 | 
						|
            "type": "FunctionExpression",
 | 
						|
            "type": "FunctionExpression"
 | 
						|
          },
 | 
						|
          "start": 3,
 | 
						|
          "type": "VariableDeclarator"
 | 
						|
        },
 | 
						|
        "end": 218,
 | 
						|
        "kind": "fn",
 | 
						|
        "start": 0,
 | 
						|
        "type": "VariableDeclaration",
 | 
						|
        "type": "VariableDeclaration"
 | 
						|
      },
 | 
						|
      {
 | 
						|
        "declaration": {
 | 
						|
          "end": 249,
 | 
						|
          "id": {
 | 
						|
            "end": 225,
 | 
						|
            "name": "thing",
 | 
						|
            "start": 220,
 | 
						|
            "type": "Identifier"
 | 
						|
          },
 | 
						|
          "init": {
 | 
						|
            "arguments": [
 | 
						|
              {
 | 
						|
                "elements": [
 | 
						|
                  {
 | 
						|
                    "end": 234,
 | 
						|
                    "raw": "0",
 | 
						|
                    "start": 233,
 | 
						|
                    "type": "Literal",
 | 
						|
                    "type": "Literal",
 | 
						|
                    "value": {
 | 
						|
                      "value": 0.0,
 | 
						|
                      "suffix": "None"
 | 
						|
                    }
 | 
						|
                  },
 | 
						|
                  {
 | 
						|
                    "end": 237,
 | 
						|
                    "raw": "0",
 | 
						|
                    "start": 236,
 | 
						|
                    "type": "Literal",
 | 
						|
                    "type": "Literal",
 | 
						|
                    "value": {
 | 
						|
                      "value": 0.0,
 | 
						|
                      "suffix": "None"
 | 
						|
                    }
 | 
						|
                  }
 | 
						|
                ],
 | 
						|
                "end": 238,
 | 
						|
                "start": 232,
 | 
						|
                "type": "ArrayExpression",
 | 
						|
                "type": "ArrayExpression"
 | 
						|
              },
 | 
						|
              {
 | 
						|
                "end": 241,
 | 
						|
                "raw": "3",
 | 
						|
                "start": 240,
 | 
						|
                "type": "Literal",
 | 
						|
                "type": "Literal",
 | 
						|
                "value": {
 | 
						|
                  "value": 3.0,
 | 
						|
                  "suffix": "None"
 | 
						|
                }
 | 
						|
              },
 | 
						|
              {
 | 
						|
                "end": 244,
 | 
						|
                "raw": "6",
 | 
						|
                "start": 243,
 | 
						|
                "type": "Literal",
 | 
						|
                "type": "Literal",
 | 
						|
                "value": {
 | 
						|
                  "value": 6.0,
 | 
						|
                  "suffix": "None"
 | 
						|
                }
 | 
						|
              },
 | 
						|
              {
 | 
						|
                "end": 248,
 | 
						|
                "raw": "10",
 | 
						|
                "start": 246,
 | 
						|
                "type": "Literal",
 | 
						|
                "type": "Literal",
 | 
						|
                "value": {
 | 
						|
                  "value": 10.0,
 | 
						|
                  "suffix": "None"
 | 
						|
                }
 | 
						|
              }
 | 
						|
            ],
 | 
						|
            "callee": {
 | 
						|
              "end": 231,
 | 
						|
              "name": "box",
 | 
						|
              "start": 228,
 | 
						|
              "type": "Identifier"
 | 
						|
            },
 | 
						|
            "end": 249,
 | 
						|
            "start": 228,
 | 
						|
            "type": "CallExpression",
 | 
						|
            "type": "CallExpression"
 | 
						|
          },
 | 
						|
          "start": 220,
 | 
						|
          "type": "VariableDeclarator"
 | 
						|
        },
 | 
						|
        "end": 249,
 | 
						|
        "kind": "const",
 | 
						|
        "start": 220,
 | 
						|
        "type": "VariableDeclaration",
 | 
						|
        "type": "VariableDeclaration"
 | 
						|
      }
 | 
						|
    ],
 | 
						|
    "end": 250,
 | 
						|
    "nonCodeMeta": {
 | 
						|
      "nonCodeNodes": {
 | 
						|
        "0": [
 | 
						|
          {
 | 
						|
            "end": 220,
 | 
						|
            "start": 218,
 | 
						|
            "type": "NonCodeNode",
 | 
						|
            "value": {
 | 
						|
              "type": "newLine"
 | 
						|
            }
 | 
						|
          }
 | 
						|
        ]
 | 
						|
      },
 | 
						|
      "startNodes": []
 | 
						|
    },
 | 
						|
    "start": 0
 | 
						|
  }
 | 
						|
}
 |