-
Notifications
You must be signed in to change notification settings - Fork 317
[typespec-vscode] show NoTarget diagnostic message in vscode #8757
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
base: main
Are you sure you want to change the base?
[typespec-vscode] show NoTarget diagnostic message in vscode #8757
Conversation
commit: |
|
All changed packages have been documented.
|
| emitterName: string | undefined = undefined, | ||
| ): Promise<VSLocation | typeof NoTarget | undefined> { | ||
| if (configFilePath && emitterName && emitterName.length > 0 && location === undefined) { | ||
| const [yamlScript] = parseYaml(await NodeSystemHost.readFile(configFilePath)); |
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.
why do we need to load the yaml here? I think we did the same thing for the import error in tspconfig.yaml but didn't need this change.
| diagnostic: Diagnostic, | ||
| ): [VSDiagnostic, TextDocument][] { | ||
| const root = getVSLocation( | ||
| emitters?: string[] | undefined, |
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.
emitters is confusing here, better to pass in the settings directly
| if (root === NoTarget) { | ||
| let customMsg = ""; | ||
| if (emitters && emitters.includes(emitterName || "")) { | ||
| customMsg = ". It's configured in vscode settings."; |
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.
" [...]", ". " may not be correct because you dont know the original message
| let customMsg = ""; | ||
| if (emitters && emitters.includes(emitterName || "")) { | ||
| customMsg = ". It's configured in vscode settings."; | ||
| } |
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.
else {
... [No target source location reported for this Error/Warning]
}
Fix: #8539.
show NoTarget diagnostic message in vscode