Repository navigation
Add fourslash test for JSDoc @this/@param types in JS files - #65307
Open
Harsh Vardhan Chauhan (1-DARK) wants to merge 1 commit into
Open
Harsh Vardhan Chauhan (1-DARK) wants to merge 1 commit into
Harsh Vardhan Chauhan (1-DARK) wants to merge 1 commit into
Conversation
Covers completions, hover, and signature help using JSDoc @this and @PARAM types in a JS file (see microsoft#65167).
Contributor
|
This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise. |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the added JavaScript JSDoc regression coverage.
No open issues 🎉
What changed in this PR
Adds regression coverage related to #65167 for JSDoc types in the native language server. The test explicitly uses a JavaScript file and introduces no production behavior changes.
Changes:
- Checks
@thisand@parammember completions. - Verifies parameter hover types and function signature help.
| File | Description |
|---|---|
tsc/internal/fourslash/tests/jsdocThisAndParamTypesInJs_test.go |
Adds a fourslash test for JSDoc-based completions, hover, and signature help in JavaScript. |
Review effort: Balanced
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #65167
Summary
Adds a fourslash regression test showing that the native language service already uses JSDoc
@thisand@paramtypes in JS files for completions, hover, and signature help.This is a test-only change. It doesn't change any behavior.
Background
#65167 reports that the native LS treats JSDoc
@this/@paramtypes asanyfor completions, hover, and signature help, even though the checker uses them correctly.The repro in the issue sets
@allowJs/@checkJsbut has no// @filename: /x.js, so the content isn't treated as JS. In TS files, JSDoc@this/@paramtypes aren't used for typing, so the reportedany(and no member completions) is expected there.With an actual
.jsfile, every scenario from the issue and its follow-up comments already works onmain.Test
tsc/internal/fourslash/tests/jsdocThisAndParamTypesInJs_test.go, in/a.jswith@allowJs+@checkJs:@this)this.click,id@param)p.name@param)p(parameter) p: { name: string; }@param)f(f(a: string, b: number): voidTo confirm the test catches the reported failure, I changed the file to
/a.ts. The test then fails with the same error as the issue (At marker 'thisCompletions': Expected completion list but got nil.).Checklist
Backlogmilestone (Native LS: JSDoc@this/@paramtypes areanyfor hover & completions (checker OK) #65167)mainbranchgo test ./internal/fourslash/...; test-only change, so I didn't run the fullnpx hereby testsuite)npx hereby lintpassesnpx hereby check:formatpasses