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 selection after running a settings quick action #2756
Comments
@b-j-p has volunteered to take on this issue / is working on it soon :) |
Muchas gracias, @slimsag 🙏 |
Took me a little longer than I expected to get to this, @slimsag @sqs and @nicksnyder. |
Ah gotcha, apologies for missing this @b-j-p. Can you fork this repository and send a pull request? (this is the right way to do it) Details here: https://help.github.com/en/articles/creating-a-pull-request |
That’s what I will do @slimsag !🙌 |
Heads up @AlicjaSuska @felixfbecker @umpox @valerybugakov @5h1rU @pdubroy - the "team/frontend-platform" label was applied to this issue. |
In JSON, properties are comma-separated. When formatted, two important things happen:
These are done in This is technically correct (because the formatting is part of the edit), but our usage demands additional information which could be described as "the edit range after it has been shrunken to exclude commas and formatting (newlines and spaces)", which would be used to set the selection. This is highly unlikely to be implemented in the library. Instead, we could compensate with a little parsing of our own. The unit of every Settings Quick Action is a property so we can match that with a regex and select the corresponding value. |
The settings quick actions (the buttons on the global/org/user settings JSON editor pages) yield the wrong selection after clicking them in some cases. The selection should be the newly added line, but it instead is the line above.
This only occurs for actions (such as
setSearchContextLines
) that DO NOT specify aselection
text.This is because the selection is computed as:
and this breaks when the edit needs to add a trailing comma to the preceding line.
The text was updated successfully, but these errors were encountered: