Files
tsgo/testdata/baselines/reference/fourslash/quickInfo/quickInfoForConstAssertions.baseline
2b43ca072d Fix hover on const in as const to display the specific type (#3951)
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: jakebailey <[email protected]>
2026-05-22 16:39:11 +00:00

146 lines
3.0 KiB
Plaintext

// === QuickInfo ===
=== /quickInfoForConstAssertions.ts ===
// const a = { a: 1 } as const;
// ^^^^^
// | ----------------------------------------------------------------------
// | ```typescript
// | type const = {
// | readonly a: 1;
// | }
// | ```
// |
// | ----------------------------------------------------------------------
// const b = 1 as const;
// ^^^^^
// | ----------------------------------------------------------------------
// | ```typescript
// | type const = 1
// | ```
// |
// | ----------------------------------------------------------------------
// const c = "c" as const;
// ^^^^^
// | ----------------------------------------------------------------------
// | ```typescript
// | type const = "c"
// | ```
// |
// | ----------------------------------------------------------------------
// const d = [1, 2] as const;
// ^^^^^
// | ----------------------------------------------------------------------
// | ```typescript
// | type const = readonly [1, 2]
// | ```
// |
// | ----------------------------------------------------------------------
[
{
"marker": {
"Position": 22,
"LSPosition": {
"line": 0,
"character": 22
},
"Name": "1",
"Data": {}
},
"item": {
"contents": {
"kind": "markdown",
"value": "```typescript\ntype const = {\n readonly a: 1;\n}\n```\n"
},
"range": {
"start": {
"line": 0,
"character": 22
},
"end": {
"line": 0,
"character": 27
}
}
}
},
{
"marker": {
"Position": 44,
"LSPosition": {
"line": 1,
"character": 15
},
"Name": "2",
"Data": {}
},
"item": {
"contents": {
"kind": "markdown",
"value": "```typescript\ntype const = 1\n```\n"
},
"range": {
"start": {
"line": 1,
"character": 15
},
"end": {
"line": 1,
"character": 20
}
}
}
},
{
"marker": {
"Position": 68,
"LSPosition": {
"line": 2,
"character": 17
},
"Name": "3",
"Data": {}
},
"item": {
"contents": {
"kind": "markdown",
"value": "```typescript\ntype const = \"c\"\n```\n"
},
"range": {
"start": {
"line": 2,
"character": 17
},
"end": {
"line": 2,
"character": 22
}
}
}
},
{
"marker": {
"Position": 95,
"LSPosition": {
"line": 3,
"character": 20
},
"Name": "4",
"Data": {}
},
"item": {
"contents": {
"kind": "markdown",
"value": "```typescript\ntype const = readonly [1, 2]\n```\n"
},
"range": {
"start": {
"line": 3,
"character": 20
},
"end": {
"line": 3,
"character": 25
}
}
}
}
]