-
Notifications
You must be signed in to change notification settings - Fork 965
Don't use cached type node when expanding #4050
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+265
−8
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
internal/fourslash/tests/quickinfoVerbosityIncreaseDecrease_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| package fourslash_test | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/microsoft/typescript-go/internal/fourslash" | ||
| "github.com/microsoft/typescript-go/internal/testutil" | ||
| ) | ||
|
|
||
| func TestQuickinfoVerbosityIncreaseDecrease(t *testing.T) { | ||
| fourslash.SkipIfFailing(t) | ||
| t.Parallel() | ||
| defer testutil.RecoverAndFail(t, "Panic on fourslash test") | ||
| const content = `export const JOB_STATES = ["created", "active", "completed", "failed", "retry", "cancelled", "archive"] as const | ||
| export type JobState = (typeof JOB_STATES)[number] | ||
| type Color = "default" | "primary" | "secondary" | "success" | "warning" | "danger" | ||
| const JobsStateToColor/*a*/: Record< | ||
| JobState, | ||
| { | ||
| color: Color | ||
| label: string | ||
| labelPlural: string | ||
| } | ||
| > = { | ||
| created: { | ||
| color: "success", | ||
| label: "Направљен", | ||
| labelPlural: "Направљени", | ||
| }, | ||
| active: { | ||
| color: "success", | ||
| label: "Активан", | ||
| labelPlural: "Активни", | ||
| }, | ||
| completed: { | ||
| color: "success", | ||
| label: "Успешан", | ||
| labelPlural: "Успешни", | ||
| }, | ||
| cancelled: { | ||
| color: "default", | ||
| label: "Отаказан", | ||
| labelPlural: "Отаказни", | ||
| }, | ||
| failed: { | ||
| color: "danger", | ||
| label: "Пао", | ||
| labelPlural: "Пали", | ||
| }, | ||
| archive: { | ||
| color: "default", | ||
| label: "Архивиран", | ||
| labelPlural: "Архивирани", | ||
| }, | ||
| retry: { | ||
| color: "warning", | ||
| label: "Понавља се", | ||
| labelPlural: "Понављају се", | ||
| }, | ||
| }` | ||
| f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content) | ||
| defer done() | ||
| f.VerifyBaselineHoverWithVerbosity(t, map[string][]int{"a": {0, 1, 0}}) | ||
| } |
179 changes: 179 additions & 0 deletions
179
testdata/baselines/reference/fourslash/quickInfo/quickinfoVerbosityIncreaseDecrease.baseline
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,179 @@ | ||
| // === QuickInfo === | ||
| === /quickinfoVerbosityIncreaseDecrease.ts === | ||
| // export const JOB_STATES = ["created", "active", "completed", "failed", "retry", "cancelled", "archive"] as const | ||
| // export type JobState = (typeof JOB_STATES)[number] | ||
| // type Color = "default" | "primary" | "secondary" | "success" | "warning" | "danger" | ||
| // const JobsStateToColor: Record< | ||
| // ^^^^^^^^^^^^^^^^ | ||
| // | ---------------------------------------------------------------------- | ||
| // | ```typescript | ||
| // | const JobsStateToColor: Record<"active" | "archive" | "cancelled" | "completed" | "created" | "failed" | "retry", { | ||
| // | color: Color; | ||
| // | label: string; | ||
| // | labelPlural: string; | ||
| // | }> | ||
| // | ``` | ||
| // | | ||
| // | (verbosity level: 0) | ||
| // | ---------------------------------------------------------------------- | ||
| // ^^^^^^^^^^^^^^^^ | ||
| // | ---------------------------------------------------------------------- | ||
| // | ```typescript | ||
| // | const JobsStateToColor: Record<"active" | "archive" | "cancelled" | "completed" | "created" | "failed" | "retry", { | ||
| // | color: "danger" | "default" | "primary" | "secondary" | "success" | "warning"; | ||
| // | label: string; | ||
| // | labelPlural: string; | ||
| // | }> | ||
| // | ``` | ||
| // | | ||
| // | (verbosity level: 1) | ||
| // | ---------------------------------------------------------------------- | ||
| // ^^^^^^^^^^^^^^^^ | ||
| // | ---------------------------------------------------------------------- | ||
| // | ```typescript | ||
| // | const JobsStateToColor: Record<"active" | "archive" | "cancelled" | "completed" | "created" | "failed" | "retry", { | ||
| // | color: Color; | ||
| // | label: string; | ||
| // | labelPlural: string; | ||
| // | }> | ||
| // | ``` | ||
| // | | ||
| // | (verbosity level: 0) | ||
| // | ---------------------------------------------------------------------- | ||
| // JobState, | ||
| // { | ||
| // color: Color | ||
| // label: string | ||
| // labelPlural: string | ||
| // } | ||
| // > = { | ||
| // created: { | ||
| // color: "success", | ||
| // label: "Направљен", | ||
| // labelPlural: "Направљени", | ||
| // }, | ||
| // active: { | ||
| // color: "success", | ||
| // label: "Активан", | ||
| // labelPlural: "Активни", | ||
| // }, | ||
| // completed: { | ||
| // color: "success", | ||
| // label: "Успешан", | ||
| // labelPlural: "Успешни", | ||
| // }, | ||
| // cancelled: { | ||
| // color: "default", | ||
| // label: "Отаказан", | ||
| // labelPlural: "Отаказни", | ||
| // }, | ||
| // failed: { | ||
| // color: "danger", | ||
| // label: "Пао", | ||
| // labelPlural: "Пали", | ||
| // }, | ||
| // archive: { | ||
| // color: "default", | ||
| // label: "Архивиран", | ||
| // labelPlural: "Архивирани", | ||
| // }, | ||
| // retry: { | ||
| // color: "warning", | ||
| // label: "Понавља се", | ||
| // labelPlural: "Понављају се", | ||
| // }, | ||
| // } | ||
| [ | ||
| { | ||
| "marker": { | ||
| "Position": 270, | ||
| "LSPosition": { | ||
| "line": 3, | ||
| "character": 22 | ||
| }, | ||
| "Name": "a", | ||
| "Data": {} | ||
| }, | ||
| "item": { | ||
| "hover": { | ||
| "contents": { | ||
| "kind": "markdown", | ||
| "value": "```typescript\nconst JobsStateToColor: Record<\"active\" | \"archive\" | \"cancelled\" | \"completed\" | \"created\" | \"failed\" | \"retry\", {\n color: Color;\n label: string;\n labelPlural: string;\n}>\n```\n" | ||
| }, | ||
| "range": { | ||
| "start": { | ||
| "line": 3, | ||
| "character": 6 | ||
| }, | ||
| "end": { | ||
| "line": 3, | ||
| "character": 22 | ||
| } | ||
| }, | ||
| "canIncreaseVerbosity": true | ||
| }, | ||
| "verbosityLevel": 0 | ||
| } | ||
| }, | ||
| { | ||
| "marker": { | ||
| "Position": 270, | ||
| "LSPosition": { | ||
| "line": 3, | ||
| "character": 22 | ||
| }, | ||
| "Name": "a", | ||
| "Data": {} | ||
| }, | ||
| "item": { | ||
| "hover": { | ||
| "contents": { | ||
| "kind": "markdown", | ||
| "value": "```typescript\nconst JobsStateToColor: Record<\"active\" | \"archive\" | \"cancelled\" | \"completed\" | \"created\" | \"failed\" | \"retry\", {\n color: \"danger\" | \"default\" | \"primary\" | \"secondary\" | \"success\" | \"warning\";\n label: string;\n labelPlural: string;\n}>\n```\n" | ||
| }, | ||
| "range": { | ||
| "start": { | ||
| "line": 3, | ||
| "character": 6 | ||
| }, | ||
| "end": { | ||
| "line": 3, | ||
| "character": 22 | ||
| } | ||
| } | ||
| }, | ||
| "verbosityLevel": 1 | ||
| } | ||
| }, | ||
| { | ||
| "marker": { | ||
| "Position": 270, | ||
| "LSPosition": { | ||
| "line": 3, | ||
| "character": 22 | ||
| }, | ||
| "Name": "a", | ||
| "Data": {} | ||
| }, | ||
| "item": { | ||
| "hover": { | ||
| "contents": { | ||
| "kind": "markdown", | ||
| "value": "```typescript\nconst JobsStateToColor: Record<\"active\" | \"archive\" | \"cancelled\" | \"completed\" | \"created\" | \"failed\" | \"retry\", {\n color: Color;\n label: string;\n labelPlural: string;\n}>\n```\n" | ||
| }, | ||
| "range": { | ||
| "start": { | ||
| "line": 3, | ||
| "character": 6 | ||
| }, | ||
| "end": { | ||
| "line": 3, | ||
| "character": 22 | ||
| } | ||
| }, | ||
| "canIncreaseVerbosity": true | ||
| }, | ||
| "verbosityLevel": 0 | ||
| } | ||
| } | ||
| ] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.