-
Notifications
You must be signed in to change notification settings - Fork 20
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 "IllegalArgumentException: Invalid range specified: (1, -1)" when editing style
attribute in Jelly files
#115
Conversation
@@ -103,7 +105,7 @@ runPluginVerifier { | |||
// Rather arbitrarily chosen first releases of last three year. | |||
// Product version in use statistics say last 3 major releases. It does not define "major release" though but | |||
// but educated guess is that `year.version` is what is considered major. | |||
ideVersions = ["2020.3.2", "2021.3.3", "2022.1"] | |||
ideVersions = ["2020.3.4", "2021.3.3", "2022.2.3"] |
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.
These are only used by the Plugin Verifier. IMO, not relevant to the fix but OK to have.
registrar.doneInjecting(); | ||
} catch (IllegalArgumentException ignored) { | ||
// occurs when syntax is malformed, like style=="" | ||
} |
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 rely on exceptions to handle this? It is, after all, an exception about this plugin not preparing the parameters correctly for an API. We can probably just add another if
checking that textLength
is greater than 2, i.e. there are two quotes and something in them.
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.
Right @duemir , pushed another commit!
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.
Tested locally.
CSS language injection into the style
attribute works for well-formed attributes. For not well-formed, there is no IllegalArgumentException
.
style
attribute in Jelly files
Fixes #103
Issue reproduced:
Changes:
build.gradle
type
attribute inbuild.gradle
in order to be able to use ultimate edition during testsvalue.getTextLength()
To test:
runIde -PideaVersion=<some version> -PideaType=IU
-> will run ultimate edition which contains CSS pluginreproduce steps, and see no exception, and completion works when syntax correctly fomed
Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
Ensure that the pull request title represents the desired changelog entry
Please describe what you did
Link to relevant issues in GitHub or Jira
Link to relevant pull requests, esp. upstream and downstream changes
Ensure you have provided tests - that demonstrates feature works or fixes the issue