-
Notifications
You must be signed in to change notification settings - Fork 943
Fixed a class member completion crash after JSDoc comment with degenerate JSDoc tag in it #2888
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
gabritto
merged 15 commits into
microsoft:main
from
Andarist:fix/completion-class-member-at-rule-crash
Mar 5, 2026
Merged
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
d2d03e1
Fixed a class member completion crash after JSDoc comment with degene…
Andarist 8c01906
Merge remote-tracking branch 'origin/main' into fix/completion-class-…
Andarist 6b79264
handle this in the parser
Andarist 6f90fa3
Merge remote-tracking branch 'origin/main' into fix/completion-class-…
Andarist 17f014e
Merge remote-tracking branch 'origin/main' into fix/completion-class-…
Andarist 3222aaa
add tests
Andarist 6c5bf13
simplify scanner change
Andarist 177e178
tests
Andarist 76580f3
simplify
Andarist 3b6d7c1
revert redundant changes
Andarist 9c267b2
tests
Andarist 415698c
fix completions at eof
Andarist aa1a8d5
tweak code
Andarist 7b8766e
add comment
Andarist 63d2f9a
mv tests
Andarist 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
38 changes: 38 additions & 0 deletions
38
...lash/tests/manual/completionClassMemberAfterJSDocWithInvalidJSDocTagInTheComment1_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,38 @@ | ||
| package fourslash_test | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/microsoft/typescript-go/internal/fourslash" | ||
| . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" | ||
| "github.com/microsoft/typescript-go/internal/testutil" | ||
| ) | ||
|
|
||
| func TestCompletionClassMemberAfterJSDocWithInvalidJSDocTagInTheComment1(t *testing.T) { | ||
| t.Parallel() | ||
| defer testutil.RecoverAndFail(t, "Panic on fourslash test") | ||
| const content = `export class NeedsPrefix { | ||
| private _prefixes: { | ||
| add: Record<string, any>; | ||
| browsers: {selected: string[]}; | ||
| }; | ||
|
|
||
| constructor(browsers: string[]) { | ||
| } | ||
|
|
||
| /** Checks whether an @-rule needs to be prefixed. */ | ||
| /**/atRule(identifier: string): boolean { | ||
| return true; | ||
| } | ||
| }` | ||
| f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content) | ||
| defer done() | ||
| f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ | ||
| IsIncomplete: false, | ||
| ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ | ||
| CommitCharacters: &[]string{}, | ||
| EditRange: Ignored, | ||
| }, | ||
| Items: &fourslash.CompletionsExpectedItems{}, | ||
| }) | ||
| } |
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.