* 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
		
	
	
		
			16 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			486 lines
		
	
	
		
			16 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
---
 | 
						|
source: kcl-lib/src/simulation_tests.rs
 | 
						|
description: Result of parsing angled_line.kcl
 | 
						|
---
 | 
						|
{
 | 
						|
  "Ok": {
 | 
						|
    "body": [
 | 
						|
      {
 | 
						|
        "declaration": {
 | 
						|
          "end": 289,
 | 
						|
          "id": {
 | 
						|
            "end": 7,
 | 
						|
            "name": "part001",
 | 
						|
            "start": 0,
 | 
						|
            "type": "Identifier"
 | 
						|
          },
 | 
						|
          "init": {
 | 
						|
            "body": [
 | 
						|
              {
 | 
						|
                "arguments": [
 | 
						|
                  {
 | 
						|
                    "end": 28,
 | 
						|
                    "raw": "'XY'",
 | 
						|
                    "start": 24,
 | 
						|
                    "type": "Literal",
 | 
						|
                    "type": "Literal",
 | 
						|
                    "value": "XY"
 | 
						|
                  }
 | 
						|
                ],
 | 
						|
                "callee": {
 | 
						|
                  "end": 23,
 | 
						|
                  "name": "startSketchOn",
 | 
						|
                  "start": 10,
 | 
						|
                  "type": "Identifier"
 | 
						|
                },
 | 
						|
                "end": 29,
 | 
						|
                "start": 10,
 | 
						|
                "type": "CallExpression",
 | 
						|
                "type": "CallExpression"
 | 
						|
              },
 | 
						|
              {
 | 
						|
                "arguments": [
 | 
						|
                  {
 | 
						|
                    "elements": [
 | 
						|
                      {
 | 
						|
                        "end": 55,
 | 
						|
                        "raw": "4.83",
 | 
						|
                        "start": 51,
 | 
						|
                        "type": "Literal",
 | 
						|
                        "type": "Literal",
 | 
						|
                        "value": {
 | 
						|
                          "value": 4.83,
 | 
						|
                          "suffix": "None"
 | 
						|
                        }
 | 
						|
                      },
 | 
						|
                      {
 | 
						|
                        "end": 62,
 | 
						|
                        "raw": "12.56",
 | 
						|
                        "start": 57,
 | 
						|
                        "type": "Literal",
 | 
						|
                        "type": "Literal",
 | 
						|
                        "value": {
 | 
						|
                          "value": 12.56,
 | 
						|
                          "suffix": "None"
 | 
						|
                        }
 | 
						|
                      }
 | 
						|
                    ],
 | 
						|
                    "end": 63,
 | 
						|
                    "start": 50,
 | 
						|
                    "type": "ArrayExpression",
 | 
						|
                    "type": "ArrayExpression"
 | 
						|
                  },
 | 
						|
                  {
 | 
						|
                    "end": 66,
 | 
						|
                    "start": 65,
 | 
						|
                    "type": "PipeSubstitution",
 | 
						|
                    "type": "PipeSubstitution"
 | 
						|
                  }
 | 
						|
                ],
 | 
						|
                "callee": {
 | 
						|
                  "end": 49,
 | 
						|
                  "name": "startProfileAt",
 | 
						|
                  "start": 35,
 | 
						|
                  "type": "Identifier"
 | 
						|
                },
 | 
						|
                "end": 67,
 | 
						|
                "start": 35,
 | 
						|
                "type": "CallExpression",
 | 
						|
                "type": "CallExpression"
 | 
						|
              },
 | 
						|
              {
 | 
						|
                "arguments": [
 | 
						|
                  {
 | 
						|
                    "type": "LabeledArg",
 | 
						|
                    "label": {
 | 
						|
                      "end": 81,
 | 
						|
                      "name": "end",
 | 
						|
                      "start": 78,
 | 
						|
                      "type": "Identifier"
 | 
						|
                    },
 | 
						|
                    "arg": {
 | 
						|
                      "elements": [
 | 
						|
                        {
 | 
						|
                          "end": 89,
 | 
						|
                          "raw": "15.1",
 | 
						|
                          "start": 85,
 | 
						|
                          "type": "Literal",
 | 
						|
                          "type": "Literal",
 | 
						|
                          "value": {
 | 
						|
                            "value": 15.1,
 | 
						|
                            "suffix": "None"
 | 
						|
                          }
 | 
						|
                        },
 | 
						|
                        {
 | 
						|
                          "end": 95,
 | 
						|
                          "raw": "2.48",
 | 
						|
                          "start": 91,
 | 
						|
                          "type": "Literal",
 | 
						|
                          "type": "Literal",
 | 
						|
                          "value": {
 | 
						|
                            "value": 2.48,
 | 
						|
                            "suffix": "None"
 | 
						|
                          }
 | 
						|
                        }
 | 
						|
                      ],
 | 
						|
                      "end": 96,
 | 
						|
                      "start": 84,
 | 
						|
                      "type": "ArrayExpression",
 | 
						|
                      "type": "ArrayExpression"
 | 
						|
                    }
 | 
						|
                  }
 | 
						|
                ],
 | 
						|
                "callee": {
 | 
						|
                  "end": 77,
 | 
						|
                  "name": "line",
 | 
						|
                  "start": 73,
 | 
						|
                  "type": "Identifier"
 | 
						|
                },
 | 
						|
                "end": 97,
 | 
						|
                "start": 73,
 | 
						|
                "type": "CallExpressionKw",
 | 
						|
                "type": "CallExpressionKw",
 | 
						|
                "unlabeled": null
 | 
						|
              },
 | 
						|
              {
 | 
						|
                "arguments": [
 | 
						|
                  {
 | 
						|
                    "type": "LabeledArg",
 | 
						|
                    "label": {
 | 
						|
                      "end": 111,
 | 
						|
                      "name": "end",
 | 
						|
                      "start": 108,
 | 
						|
                      "type": "Identifier"
 | 
						|
                    },
 | 
						|
                    "arg": {
 | 
						|
                      "elements": [
 | 
						|
                        {
 | 
						|
                          "end": 119,
 | 
						|
                          "raw": "3.15",
 | 
						|
                          "start": 115,
 | 
						|
                          "type": "Literal",
 | 
						|
                          "type": "Literal",
 | 
						|
                          "value": {
 | 
						|
                            "value": 3.15,
 | 
						|
                            "suffix": "None"
 | 
						|
                          }
 | 
						|
                        },
 | 
						|
                        {
 | 
						|
                          "argument": {
 | 
						|
                            "end": 126,
 | 
						|
                            "raw": "9.85",
 | 
						|
                            "start": 122,
 | 
						|
                            "type": "Literal",
 | 
						|
                            "type": "Literal",
 | 
						|
                            "value": {
 | 
						|
                              "value": 9.85,
 | 
						|
                              "suffix": "None"
 | 
						|
                            }
 | 
						|
                          },
 | 
						|
                          "end": 126,
 | 
						|
                          "operator": "-",
 | 
						|
                          "start": 121,
 | 
						|
                          "type": "UnaryExpression",
 | 
						|
                          "type": "UnaryExpression"
 | 
						|
                        }
 | 
						|
                      ],
 | 
						|
                      "end": 127,
 | 
						|
                      "start": 114,
 | 
						|
                      "type": "ArrayExpression",
 | 
						|
                      "type": "ArrayExpression"
 | 
						|
                    }
 | 
						|
                  },
 | 
						|
                  {
 | 
						|
                    "type": "LabeledArg",
 | 
						|
                    "label": {
 | 
						|
                      "end": 132,
 | 
						|
                      "name": "tag",
 | 
						|
                      "start": 129,
 | 
						|
                      "type": "Identifier"
 | 
						|
                    },
 | 
						|
                    "arg": {
 | 
						|
                      "end": 141,
 | 
						|
                      "start": 135,
 | 
						|
                      "type": "TagDeclarator",
 | 
						|
                      "type": "TagDeclarator",
 | 
						|
                      "value": "seg01"
 | 
						|
                    }
 | 
						|
                  }
 | 
						|
                ],
 | 
						|
                "callee": {
 | 
						|
                  "end": 107,
 | 
						|
                  "name": "line",
 | 
						|
                  "start": 103,
 | 
						|
                  "type": "Identifier"
 | 
						|
                },
 | 
						|
                "end": 142,
 | 
						|
                "start": 103,
 | 
						|
                "type": "CallExpressionKw",
 | 
						|
                "type": "CallExpressionKw",
 | 
						|
                "unlabeled": null
 | 
						|
              },
 | 
						|
              {
 | 
						|
                "arguments": [
 | 
						|
                  {
 | 
						|
                    "type": "LabeledArg",
 | 
						|
                    "label": {
 | 
						|
                      "end": 156,
 | 
						|
                      "name": "end",
 | 
						|
                      "start": 153,
 | 
						|
                      "type": "Identifier"
 | 
						|
                    },
 | 
						|
                    "arg": {
 | 
						|
                      "elements": [
 | 
						|
                        {
 | 
						|
                          "argument": {
 | 
						|
                            "end": 166,
 | 
						|
                            "raw": "15.17",
 | 
						|
                            "start": 161,
 | 
						|
                            "type": "Literal",
 | 
						|
                            "type": "Literal",
 | 
						|
                            "value": {
 | 
						|
                              "value": 15.17,
 | 
						|
                              "suffix": "None"
 | 
						|
                            }
 | 
						|
                          },
 | 
						|
                          "end": 166,
 | 
						|
                          "operator": "-",
 | 
						|
                          "start": 160,
 | 
						|
                          "type": "UnaryExpression",
 | 
						|
                          "type": "UnaryExpression"
 | 
						|
                        },
 | 
						|
                        {
 | 
						|
                          "argument": {
 | 
						|
                            "end": 172,
 | 
						|
                            "raw": "4.1",
 | 
						|
                            "start": 169,
 | 
						|
                            "type": "Literal",
 | 
						|
                            "type": "Literal",
 | 
						|
                            "value": {
 | 
						|
                              "value": 4.1,
 | 
						|
                              "suffix": "None"
 | 
						|
                            }
 | 
						|
                          },
 | 
						|
                          "end": 172,
 | 
						|
                          "operator": "-",
 | 
						|
                          "start": 168,
 | 
						|
                          "type": "UnaryExpression",
 | 
						|
                          "type": "UnaryExpression"
 | 
						|
                        }
 | 
						|
                      ],
 | 
						|
                      "end": 173,
 | 
						|
                      "start": 159,
 | 
						|
                      "type": "ArrayExpression",
 | 
						|
                      "type": "ArrayExpression"
 | 
						|
                    }
 | 
						|
                  }
 | 
						|
                ],
 | 
						|
                "callee": {
 | 
						|
                  "end": 152,
 | 
						|
                  "name": "line",
 | 
						|
                  "start": 148,
 | 
						|
                  "type": "Identifier"
 | 
						|
                },
 | 
						|
                "end": 174,
 | 
						|
                "start": 148,
 | 
						|
                "type": "CallExpressionKw",
 | 
						|
                "type": "CallExpressionKw",
 | 
						|
                "unlabeled": null
 | 
						|
              },
 | 
						|
              {
 | 
						|
                "arguments": [
 | 
						|
                  {
 | 
						|
                    "elements": [
 | 
						|
                      {
 | 
						|
                        "arguments": [
 | 
						|
                          {
 | 
						|
                            "end": 204,
 | 
						|
                            "name": "seg01",
 | 
						|
                            "start": 199,
 | 
						|
                            "type": "Identifier",
 | 
						|
                            "type": "Identifier"
 | 
						|
                          }
 | 
						|
                        ],
 | 
						|
                        "callee": {
 | 
						|
                          "end": 198,
 | 
						|
                          "name": "segAng",
 | 
						|
                          "start": 192,
 | 
						|
                          "type": "Identifier"
 | 
						|
                        },
 | 
						|
                        "end": 205,
 | 
						|
                        "start": 192,
 | 
						|
                        "type": "CallExpression",
 | 
						|
                        "type": "CallExpression"
 | 
						|
                      },
 | 
						|
                      {
 | 
						|
                        "end": 212,
 | 
						|
                        "raw": "12.35",
 | 
						|
                        "start": 207,
 | 
						|
                        "type": "Literal",
 | 
						|
                        "type": "Literal",
 | 
						|
                        "value": {
 | 
						|
                          "value": 12.35,
 | 
						|
                          "suffix": "None"
 | 
						|
                        }
 | 
						|
                      }
 | 
						|
                    ],
 | 
						|
                    "end": 213,
 | 
						|
                    "start": 191,
 | 
						|
                    "type": "ArrayExpression",
 | 
						|
                    "type": "ArrayExpression"
 | 
						|
                  },
 | 
						|
                  {
 | 
						|
                    "end": 216,
 | 
						|
                    "start": 215,
 | 
						|
                    "type": "PipeSubstitution",
 | 
						|
                    "type": "PipeSubstitution"
 | 
						|
                  }
 | 
						|
                ],
 | 
						|
                "callee": {
 | 
						|
                  "end": 190,
 | 
						|
                  "name": "angledLine",
 | 
						|
                  "start": 180,
 | 
						|
                  "type": "Identifier"
 | 
						|
                },
 | 
						|
                "end": 217,
 | 
						|
                "start": 180,
 | 
						|
                "type": "CallExpression",
 | 
						|
                "type": "CallExpression"
 | 
						|
              },
 | 
						|
              {
 | 
						|
                "arguments": [
 | 
						|
                  {
 | 
						|
                    "type": "LabeledArg",
 | 
						|
                    "label": {
 | 
						|
                      "end": 231,
 | 
						|
                      "name": "end",
 | 
						|
                      "start": 228,
 | 
						|
                      "type": "Identifier"
 | 
						|
                    },
 | 
						|
                    "arg": {
 | 
						|
                      "elements": [
 | 
						|
                        {
 | 
						|
                          "argument": {
 | 
						|
                            "end": 241,
 | 
						|
                            "raw": "13.02",
 | 
						|
                            "start": 236,
 | 
						|
                            "type": "Literal",
 | 
						|
                            "type": "Literal",
 | 
						|
                            "value": {
 | 
						|
                              "value": 13.02,
 | 
						|
                              "suffix": "None"
 | 
						|
                            }
 | 
						|
                          },
 | 
						|
                          "end": 241,
 | 
						|
                          "operator": "-",
 | 
						|
                          "start": 235,
 | 
						|
                          "type": "UnaryExpression",
 | 
						|
                          "type": "UnaryExpression"
 | 
						|
                        },
 | 
						|
                        {
 | 
						|
                          "end": 248,
 | 
						|
                          "raw": "10.03",
 | 
						|
                          "start": 243,
 | 
						|
                          "type": "Literal",
 | 
						|
                          "type": "Literal",
 | 
						|
                          "value": {
 | 
						|
                            "value": 10.03,
 | 
						|
                            "suffix": "None"
 | 
						|
                          }
 | 
						|
                        }
 | 
						|
                      ],
 | 
						|
                      "end": 249,
 | 
						|
                      "start": 234,
 | 
						|
                      "type": "ArrayExpression",
 | 
						|
                      "type": "ArrayExpression"
 | 
						|
                    }
 | 
						|
                  }
 | 
						|
                ],
 | 
						|
                "callee": {
 | 
						|
                  "end": 227,
 | 
						|
                  "name": "line",
 | 
						|
                  "start": 223,
 | 
						|
                  "type": "Identifier"
 | 
						|
                },
 | 
						|
                "end": 250,
 | 
						|
                "start": 223,
 | 
						|
                "type": "CallExpressionKw",
 | 
						|
                "type": "CallExpressionKw",
 | 
						|
                "unlabeled": null
 | 
						|
              },
 | 
						|
              {
 | 
						|
                "arguments": [
 | 
						|
                  {
 | 
						|
                    "end": 263,
 | 
						|
                    "start": 262,
 | 
						|
                    "type": "PipeSubstitution",
 | 
						|
                    "type": "PipeSubstitution"
 | 
						|
                  }
 | 
						|
                ],
 | 
						|
                "callee": {
 | 
						|
                  "end": 261,
 | 
						|
                  "name": "close",
 | 
						|
                  "start": 256,
 | 
						|
                  "type": "Identifier"
 | 
						|
                },
 | 
						|
                "end": 264,
 | 
						|
                "start": 256,
 | 
						|
                "type": "CallExpression",
 | 
						|
                "type": "CallExpression"
 | 
						|
              },
 | 
						|
              {
 | 
						|
                "arguments": [
 | 
						|
                  {
 | 
						|
                    "type": "LabeledArg",
 | 
						|
                    "label": {
 | 
						|
                      "end": 284,
 | 
						|
                      "name": "length",
 | 
						|
                      "start": 278,
 | 
						|
                      "type": "Identifier"
 | 
						|
                    },
 | 
						|
                    "arg": {
 | 
						|
                      "end": 288,
 | 
						|
                      "raw": "4",
 | 
						|
                      "start": 287,
 | 
						|
                      "type": "Literal",
 | 
						|
                      "type": "Literal",
 | 
						|
                      "value": {
 | 
						|
                        "value": 4.0,
 | 
						|
                        "suffix": "None"
 | 
						|
                      }
 | 
						|
                    }
 | 
						|
                  }
 | 
						|
                ],
 | 
						|
                "callee": {
 | 
						|
                  "end": 277,
 | 
						|
                  "name": "extrude",
 | 
						|
                  "start": 270,
 | 
						|
                  "type": "Identifier"
 | 
						|
                },
 | 
						|
                "end": 289,
 | 
						|
                "start": 270,
 | 
						|
                "type": "CallExpressionKw",
 | 
						|
                "type": "CallExpressionKw",
 | 
						|
                "unlabeled": null
 | 
						|
              }
 | 
						|
            ],
 | 
						|
            "end": 289,
 | 
						|
            "start": 10,
 | 
						|
            "type": "PipeExpression",
 | 
						|
            "type": "PipeExpression"
 | 
						|
          },
 | 
						|
          "start": 0,
 | 
						|
          "type": "VariableDeclarator"
 | 
						|
        },
 | 
						|
        "end": 289,
 | 
						|
        "kind": "const",
 | 
						|
        "start": 0,
 | 
						|
        "type": "VariableDeclaration",
 | 
						|
        "type": "VariableDeclaration"
 | 
						|
      }
 | 
						|
    ],
 | 
						|
    "end": 290,
 | 
						|
    "start": 0
 | 
						|
  }
 | 
						|
}
 |