-
Notifications
You must be signed in to change notification settings - Fork 12.9k
fix jsdoc errors in .ts in tsserver #54185
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
fix jsdoc errors in .ts in tsserver #54185
Conversation
when requesting diagnostics *after* a different services command. There are two fixes, and though they probably don't address every possible error that could appear in JSDoc, they should at least improve the problem substantially. Fixes microsoft#50341 I need to check whether it helps microsoft#49109 as well.
import { baselineTsserverLogs, createLoggerWithInMemoryLogs, createSession } from "../helpers/tsserver"; | ||
import { createServerHost, File } from "../helpers/virtualFileSystemWithWatch"; | ||
|
||
describe("unittests:: services:: goToDefinition", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fourslash no longer supports the methods needed to make the diagnostic call out-of-order, so I think this is better as a unit test, especially since the answer might turn out to be "don't make ooorder calls".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like we should try as much as possible to make sure that things work no matter the order; it may be the case that VS Code does it a certain way but I think it's super likely that some other client will do it that way. I know that in LSP, these orders are totally possible.
@@ -0,0 +1,140 @@ | |||
import { protocol } from "../../_namespaces/ts.server"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move this file to unittests/tsserver instead.. All the tests throgh tsserver are in there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied findAllReferences in this same directory. Should I move that one too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes pls.
when requesting diagnostics after a different services command.
There are two fixes, and though they probably don't address every possible error that could appear in JSDoc, they should at least improve the problem substantially. However, I don't actually know if the scenario makes sense. Is it required that diagnostics be requested before other services work reliably? If so, the fix is to figure out why the language service is getting ooorder calls instead. (And document the requirement in the API so others know it too.)
Fixes #50341
Fixes #49109