Skip to content

Commit

Permalink
Merge pull request #90 from duemir/update-baseline
Browse files Browse the repository at this point in the history
Compatibility baseline is changed to 2020.3
  • Loading branch information
duemir authored Apr 25, 2022
2 parents f415b79 + 71fd431 commit 69dee0e
Show file tree
Hide file tree
Showing 19 changed files with 48 additions and 112 deletions.
21 changes: 0 additions & 21 deletions .run/idea-stapler-plugin [runIde 2018.1].run.xml

This file was deleted.

21 changes: 0 additions & 21 deletions .run/idea-stapler-plugin [runIde 2019.1].run.xml

This file was deleted.

21 changes: 0 additions & 21 deletions .run/idea-stapler-plugin [runIde 2020.1].run.xml

This file was deleted.

2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pipeline {
if (isUnix()) {
command = "./${command}"
}
infra.runWithJava(command, "8", extraEnv)
infra.runWithJava(command, "11", extraEnv)
}
}
post {
Expand Down
16 changes: 12 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ plugins {
}

group = "org.kohsuke.stapler.idea"
version = "2.0.4"
version = "2.0.5-SNAPSHOT"

sourceCompatibility = 1.8
java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
}

repositories {
mavenCentral()
Expand Down Expand Up @@ -48,9 +52,13 @@ intellij {
}

patchPluginXml {
sinceBuild = "162.00"
sinceBuild = "203.00"
untilBuild = ""
changeNotes = """
<h3>2.0.5</h3>
<ul>
<li>Compatibility baseline is changed to 2020.3 which also changes Java level to 11.</li>
</ul>
<h3>2.0.4</h3>
<ul>
<li>Avoid <code>java.lang.NullPointerException</code> at <code>org.kohsuke.stapler.idea.JellyDocumentationProvider.generateDoc()</code>
Expand Down Expand Up @@ -79,7 +87,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 = ["2019.1.4", "2020.1.3", "2021.1"]
ideVersions = ["2020.3.2", "2021.3.3", "2022.1"]
}

publishPlugin {
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# https://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html
# the first year based version (2016.2)
ideaVersion=2016.2
platformPlugins=properties
ideaVersion=2020.3
platformPlugins=properties,java
intellijPublishToken=
23 changes: 9 additions & 14 deletions src/main/java/org/kohsuke/stapler/idea/GotoViewAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
public class GotoViewAction extends GotoActionBase {

@Override
public void gotoActionPerformed(AnActionEvent anactionevent) {
public void gotoActionPerformed(@NotNull AnActionEvent anactionevent) {
PsiElement context = getPsiContext(anactionevent);

final Project project = anactionevent.getData(PlatformDataKeys.PROJECT);
Expand Down Expand Up @@ -81,12 +81,12 @@ public String getPromptText() {
}

@Override
public String getNotInMessage() {
public @NotNull String getNotInMessage() {
return "getNotInMessage";
}

@Override
public String getNotFoundMessage() {
public @NotNull String getNotFoundMessage() {
return "getNotFoundMessage";
}

Expand All @@ -95,11 +95,6 @@ public String getCheckBoxName() {
return null; // no check box
}

@Override
public char getCheckBoxMnemonic() {
return '\0';
}

@Override
public boolean loadInitialCheckBoxState() {
return false;
Expand All @@ -111,13 +106,13 @@ public void saveInitialCheckBoxState(boolean state) {
}

@Override
public ListCellRenderer getListCellRenderer() {
public @NotNull ListCellRenderer getListCellRenderer() {
return new DefaultPsiElementCellRenderer();
}

@NotNull
@Override
public String[] getNames(boolean checkBoxState) {
public String @NotNull [] getNames(boolean checkBoxState) {
List<String> r = new ArrayList<>();
for (PsiPackage pkg : viewPackages) {
for (PsiDirectory dir : pkg.getDirectories()) {
Expand All @@ -133,7 +128,7 @@ public String[] getNames(boolean checkBoxState) {

@Override
@NotNull
public Object[] getElementsByName(String name, boolean checkBoxState, String pattern) {
public Object @NotNull [] getElementsByName(@NotNull String name, boolean checkBoxState, @NotNull String pattern) {
for (PsiPackage pkg : viewPackages) {
for (PsiDirectory dir : pkg.getDirectories()) {
for (PsiFile file : dir.getFiles()) {
Expand All @@ -147,12 +142,12 @@ public Object[] getElementsByName(String name, boolean checkBoxState, String pat

@Override
@NotNull
public String[] getSeparators() {
public String @NotNull [] getSeparators() {
return ArrayUtils.EMPTY_STRING_ARRAY;
}

@Override
public String getElementName(Object obj) {
public String getElementName(@NotNull Object obj) {
if (obj instanceof PsiFile) {
return ((PsiFile) obj).getName();
} else {
Expand All @@ -161,7 +156,7 @@ public String getElementName(Object obj) {
}

@Override
public String getFullName(Object obj) {
public String getFullName(@NotNull Object obj) {
if (obj instanceof PsiFile) {
VirtualFile virtualfile = ((PsiFile) obj).getVirtualFile();
return virtualfile == null ? null : virtualfile.getPath();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.intellij.psi.PsiPackage;
import com.intellij.psi.PsiType;
import com.intellij.util.IncorrectOperationException;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;
Expand All @@ -42,7 +43,7 @@ public class I18nRefactorAction extends EditorAction {
public I18nRefactorAction() {
super(new EditorActionHandler() {
@Override
public void doExecute(final Editor editor, @Nullable Caret caret, DataContext dataContext) {
public void doExecute(final @NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) {
if (editor == null) // be defensive
return;

Expand Down
5 changes: 4 additions & 1 deletion src/main/java/org/kohsuke/stapler/idea/JellyAnnotator.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.intellij.lang.annotation.AnnotationHolder;
import com.intellij.lang.annotation.Annotator;
import com.intellij.lang.annotation.HighlightSeverity;
import com.intellij.psi.PsiElement;
import com.intellij.psi.xml.XmlTag;
import com.intellij.xml.XmlElementDescriptor;
Expand Down Expand Up @@ -36,7 +37,9 @@ public void annotate(@NotNull PsiElement psi, @NotNull AnnotationHolder holder)
XmlElementDescriptor e = ns.getElementDescriptor(tag);
if(e instanceof AnyXmlElementDescriptor) {
PsiElement startTagName = tag.getFirstChild().getNextSibling();
holder.createErrorAnnotation(startTagName,"Undefined element");
holder.newAnnotation(HighlightSeverity.ERROR, "Undefined jelly element")
.range(startTagName)
.create();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ public class JellyCompletionContributor extends CompletionContributor {
public JellyCompletionContributor() {
extend(CompletionType.BASIC, // in case of XML completion, this always seems to be BASIC
XML_ELEMENT_NAME_PATTERN,
new CompletionProvider<CompletionParameters>() {
new CompletionProvider<>() {
// REFERENCE: spring plugin adds CompletionContributor as well.
@Override
protected void addCompletions(@NotNull CompletionParameters parameters, ProcessingContext context, @NotNull CompletionResultSet result) {
protected void addCompletions(@NotNull CompletionParameters parameters, @NotNull ProcessingContext context, @NotNull CompletionResultSet result) {
XmlElement name = (XmlElement)parameters.getPosition();

// do this only inside Jelly files
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class JellyTagLibReferenceProvider extends PsiReferenceProvider {
*/
@Override
@NotNull
public PsiReference[] getReferencesByElement(@NotNull PsiElement e, @NotNull ProcessingContext processingContext) {
public PsiReference @NotNull [] getReferencesByElement(@NotNull PsiElement e, @NotNull ProcessingContext processingContext) {
/*
This was the old way of marking references to tag files, but
with the custom XmlNSDescriptor this is no longer necessary
Expand Down Expand Up @@ -88,7 +88,7 @@ private PsiReference[] onAttributeValue(final XmlAttributeValue xav) {
if(p.getAttribute("it")==null
&& p.getAttribute("from")==null) {
// the page must be coming from the same object
return array(new PsiReferenceBase<XmlAttributeValue>(xav,
return array(new PsiReferenceBase<>(xav,
TextRange.from(1,xav.getTextLength()-2)) {
private final String page = xav.getValue();
@Override
Expand Down Expand Up @@ -140,7 +140,7 @@ public PsiFile resolve() {

@Override
@NotNull
public Object[] getVariants() {
public Object @NotNull [] getVariants() {
return ArrayUtils.EMPTY_OBJECT_ARRAY;
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
import com.intellij.facet.ui.FacetEditorContext;
import com.intellij.facet.ui.FacetEditorTab;
import com.intellij.facet.ui.FacetValidatorsManager;
import com.intellij.openapi.util.InvalidDataException;
import com.intellij.openapi.util.WriteExternalException;
import org.jdom.Element;

/**
* @author Kohsuke Kawaguchi
Expand All @@ -17,12 +14,4 @@ public FacetEditorTab[] createEditorTabs(FacetEditorContext editorContext, Facet
// nothing to configure
return new FacetEditorTab[0];
}

@Override
public void readExternal(Element element) throws InvalidDataException {
}

@Override
public void writeExternal(Element element) throws WriteExternalException {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.intellij.xml.XmlNSDescriptor;
import com.intellij.xml.impl.schema.AnyXmlAttributeDescriptor;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
Expand Down Expand Up @@ -97,7 +98,7 @@ public void init(PsiElement element) {
}

@Override
public Object[] getDependences() {
public Object @NotNull [] getDependencies() {
// TODO
throw new UnsupportedOperationException();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.intellij.psi.PsiElement;
import com.intellij.psi.xml.XmlElement;
import com.intellij.xml.XmlAttributeDescriptor;
import org.jetbrains.annotations.NotNull;
import org.kohsuke.stapler.idea.dom.model.AttributeTag;

/**
Expand Down Expand Up @@ -98,7 +99,7 @@ public void init(PsiElement element) {
}

@Override
public Object[] getDependences() {
public Object @NotNull [] getDependencies() {
return new Object[]{def.tag};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.intellij.xml.XmlElementDescriptor;
import com.intellij.xml.XmlNSDescriptor;
import com.intellij.xml.impl.dtd.BaseXmlElementDescriptorImpl;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.kohsuke.stapler.idea.dom.model.AttributeTag;
import org.kohsuke.stapler.idea.dom.model.DocumentationTag;
Expand Down Expand Up @@ -157,7 +158,7 @@ public void init(PsiElement element) {
}

@Override
public Object[] getDependences() {
public Object @NotNull [] getDependencies() {
return new Object[] {nsDescriptor,tagFile};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public XmlElementDescriptor getElementDescriptor(@NotNull XmlTag tag) {
*/
@Override
@NotNull
public XmlElementDescriptor[] getRootElementsDescriptors(@Nullable XmlDocument document) {
public XmlElementDescriptor @NotNull [] getRootElementsDescriptors(@Nullable XmlDocument document) {
List<XmlElementDescriptor> r = new ArrayList<>();
for(PsiFile f : dir.getFiles()) {
if(!f.getName().endsWith(".jelly")) continue;
Expand Down Expand Up @@ -115,7 +115,7 @@ public void init(PsiElement element) {
}

@Override
public Object[] getDependences() {
public Object @NotNull [] getDependencies() {
return new Object[]{dir};
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.kohsuke.stapler.idea.descriptor;

import com.intellij.openapi.fileTypes.StdFileTypes;
import com.intellij.ide.highlighter.XmlFileType;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.util.Key;
import com.intellij.psi.PsiDirectory;
Expand All @@ -26,7 +26,7 @@ public XmlFile getSchema(@NotNull String url, @Nullable Module module, @NotNull
if(d==null) return null;

XmlFile pseudoSchema = (XmlFile) PsiFileFactory.getInstance(module.getProject()).createFileFromText(
url + ".xml", StdFileTypes.XML, "<schema uri=\"" + url + "\" xmlns='" + JellyTaglibMetadataContributor.DUMMY_SCHEMA_URL + "'>");
url + ".xml", XmlFileType.INSTANCE , "<schema uri=\"" + url + "\" xmlns='" + JellyTaglibMetadataContributor.DUMMY_SCHEMA_URL + "'>");
pseudoSchema.putUserData(MODULE,d.getDir());
return pseudoSchema;
}
Expand Down
Loading

0 comments on commit 69dee0e

Please sign in to comment.