-
Notifications
You must be signed in to change notification settings - Fork 21
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# https://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html | ||
# the first year based version (2016.2) | ||
ideaVersion=2020.3 | ||
# see https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension for list of accepted types | ||
ideaType=IC | ||
platformPlugins=properties,java | ||
intellijPublishToken= |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,11 +44,15 @@ public void getLanguagesToInject(@NotNull final MultiHostRegistrar registrar, @N | |
Language language = findLanguage("CSS"); | ||
if (language == null) return; | ||
|
||
registrar.startInjecting(language); | ||
registrar.addPlace("dummy_selector {","}", | ||
(PsiLanguageInjectionHost)value, | ||
TextRange.from(1, value.getTextLength() - 2)); | ||
registrar.doneInjecting(); | ||
try { | ||
registrar.startInjecting(language); | ||
registrar.addPlace("dummy_selector {", "}", | ||
(PsiLanguageInjectionHost) value, | ||
TextRange.from(1, value.getTextLength() - 2)); | ||
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 commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right @duemir , pushed another commit! |
||
return; | ||
} | ||
|
||
|
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.