-
Notifications
You must be signed in to change notification settings - Fork 226
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
Feature: Code fixes #2888
Feature: Code fixes #2888
Conversation
All changed packages have been documented. |
You can try these changes at https://cadlplayground.z22.web.core.windows.net/prs/2888/ Check the website changes at https://tspwebsitepr.z22.web.core.windows.net/prs/2888/ |
…ture/code-fixes
|
||
async function toEqual(expectedCode: string) { | ||
const diagnostics = await diagnose(code); | ||
const codefix = diagnostics[0].codefixes?.find((x) => x.id === fixId); |
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.
This is expected to be used only when there is a single diagnostic?
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.
Yeah the expectation is you emit a single linter warning and apply the code fix on it
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.
If we endup having cases where there is multiple diagnostic always emitted, I think then we can add a extra option to choose which one
Co-authored-by: Mark Cowlishaw <markcowl@microsoft.com>
Co-authored-by: Mark Cowlishaw <markcowl@microsoft.com>
Co-authored-by: Mark Cowlishaw <markcowl@microsoft.com>
…ture/code-fixes
…ture/code-fixes
closes microsoft#615 ## Code fixes added ### Suppress ![Kapture 2024-02-05 at 15 16 22](https://github.com/microsoft/typespec/assets/1031227/644014a3-9352-4bd4-b1b8-0d314c627405) ### `number` -> `float64` typo fix ![Kapture 2024-02-06 at 09 50 28](https://github.com/microsoft/typespec/assets/1031227/65b2e9aa-c510-440f-a1c6-7851611b65a2) ### Enum to extensible enum in typespec-azure Azure/typespec-azure#258 --------- Co-authored-by: Mark Cowlishaw <markcowl@microsoft.com>
closes #615
Code fixes added
Suppress
number
->float64
typo fixEnum to extensible enum in typespec-azure
Azure/typespec-azure#258