Repository navigation
Fixing > character in JSX text should have a "fix all in file" #37409
Description
Activity
- addedDomain: LS: Quick FixesEditor-provided fixes, often called code actions.Editor-provided fixes, often called code actions.Experience EnhancementNoncontroversial enhancementsNoncontroversial enhancements
on Mar 16, 2020 - addedGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do this
on Mar 16, 2020 - changed the title
[-]Fixing '>' character should have a "fix all in file"[/-][+]Fixing `>` character in JSX text should have a "fix all in file"[/+]on Mar 16, 2020 Could this fix choose
{'>'}or{">"}intelligently based on other quote usage in the file?I think we already have checks for that sort of thing - so it's likely, yes
a-tarasyuk commented
on Mar 16, 2020 ContributorMore actionsOrta Therox (@orta) I tried to add a test/fix for the
Fix allQF and got the following error messageNo available code fix has the expected id. Fix All is not available if there is only one potentially fixable diagnostic present
The code which I tried to test
let a = <div>>{"foo"}</div>; let b = <div>>{"foo"}</div>; let c = <div>>{"foo"}</div>;
Are there any special cases that need to be considered when processing scanner errors in QF services?
I think we already have checks for that sort of thing - so it's likely, yes
You are right, however, it seems that the current service doesn't use quote preferences
: `{'${character}'}`; andrewbranch commented
on Mar 16, 2020 MemberMore actionsOleksandr Tarasiuk (@a-tarasyuk) I worked on the fix-all changes that generate that message somewhat recently; seems like there might be a bug there in
codeFixProvider. I’m happy to help take a look if you need a hand.Reacted by Oleksandr Tarasiuka-tarasyuk commented
on Mar 17, 2020 ContributorMore actionsAndrew Branch (@andrewbranch) Thanks. I've created PR, with the one change in the
codeFixProvider.
We introduced a breaking change in #36636 so that
>in JSX text would become an error as per the JSX spec:I hit this several times on the new website's
src/templates/pages/download.tsxeven though the code was just working. Users shouldn't have to fix them one-by-one, so it'd probably be a good idea to auto-fix them all.