Skip to content
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

Merged
merged 2 commits into from
Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ tasks.withType(JavaCompile) {
}

// See https://github.com/JetBrains/gradle-intellij-plugin/
// https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension

// https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
// https://plugins.jetbrains.com/docs/marketplace/product-versions-in-use-statistics.html
// https://www.jetbrains.com/idea/download/other.html
intellij {
version = ideaVersion
type.set(ideaType)
plugins = platformPlugins.tokenize(',')*.trim()
}

Expand Down Expand Up @@ -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"]
Copy link
Member

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.

}

publishPlugin {
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
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
Expand Up @@ -42,12 +42,12 @@ public void getLanguagesToInject(@NotNull final MultiHostRegistrar registrar, @N
return; // not a style attribute

Language language = findLanguage("CSS");
if (language == null) return;

if (language == null || value.getTextLength() < 2) return;
registrar.startInjecting(language);
registrar.addPlace("dummy_selector {","}",
(PsiLanguageInjectionHost)value,
TextRange.from(1, value.getTextLength() - 2));
registrar.addPlace("dummy_selector {", "}",
(PsiLanguageInjectionHost) value,
TextRange.from(1, value.getTextLength() - 2));
registrar.doneInjecting();
return;
}
Expand Down