-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
Add comptibility for 2024.1 IDEs #3569
Changes from all commits
05780d0
060ae30
f032c1f
21f7562
398243f
6f55b2c
564e98f
d7481d0
b9f59f4
4649b09
b4369d3
7289afd
2f2ef1f
2c97d9e
ea98112
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,5 @@ | ||
plugins { | ||
id "org.jetbrains.intellij" version "1.13.3" | ||
id "org.jetbrains.intellij" version "1.17.3" | ||
id "org.jetbrains.kotlin.jvm" version "1.9.10" | ||
id "de.undercouch.download" version "4.1.2" | ||
} | ||
|
@@ -69,8 +69,8 @@ allprojects { | |
changeNotes.set(bodyInnerHTML("resources/META-INF/changelog.html")) | ||
pluginDescription.set(bodyInnerHTML("resources/META-INF/description.html")) | ||
|
||
sinceBuild = "233.11799.241" | ||
untilBuild = "233.*" | ||
sinceBuild = "241.*" | ||
untilBuild = "241.*" | ||
} | ||
|
||
publishPlugin { | ||
|
@@ -82,7 +82,7 @@ allprojects { | |
} | ||
|
||
runPluginVerifier { | ||
ideVersions = ["2023.3"] | ||
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. Based on previous compatibility PRs we normally drop support for the previous version, so this should probably just be 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. The old version is only dropped if a required code change makes it impossible to build for both versions. It's a coincidence that that has been the case for recent one. 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. Gotcha, thanks for the clarification! 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. The commit I used for reference was this one: 876b770 |
||
ideVersions = ["2024.1"] | ||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,34 +2,40 @@ | |
|
||
import com.intellij.openapi.util.io.FileUtil; | ||
import com.intellij.testFramework.UsefulTestCase; | ||
import com.intellij.util.containers.MultiMap; | ||
import gnu.trove.THashSet; | ||
import com.intellij.util.containers.CollectionFactory; | ||
import org.jetbrains.jps.builders.impl.logging.ProjectBuilderLoggerBase; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
import java.util.List; | ||
import java.util.HashMap; | ||
import java.util.Set; | ||
|
||
|
||
|
||
/** | ||
* Created by zyuyou on 15/7/17. | ||
*/ | ||
public class TestProjectBuilderLogger extends ProjectBuilderLoggerBase { | ||
private MultiMap<String, File> myCompiledFiles = new MultiMap<String, File>(); | ||
private Set<File> myDeletedFiles = new THashSet<File>(FileUtil.FILE_HASHING_STRATEGY); | ||
private HashMap<String, Set<String>> myCompiledFiles = new HashMap<String, Set<String>>(); | ||
private Set<String> myDeletedFiles = CollectionFactory.createFilePathSet(); | ||
|
||
@Override | ||
public void logDeletedFiles(Collection<String> paths) { | ||
for (String path:paths){ | ||
myDeletedFiles.add(new File(path)); | ||
myDeletedFiles.add(new File(path).getAbsolutePath()); | ||
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. Is this a change in behavior? I'm not sure if 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. The change is the set is storing the string version of the file instead of the |
||
} | ||
} | ||
|
||
@Override | ||
public void logCompiledFiles(Collection<File> files, String builderName, String description) throws IOException { | ||
myCompiledFiles.putValues(builderName, files); | ||
List<String> paths = new ArrayList<String>(); | ||
for (File file: files) { | ||
paths.add(file.getPath()); | ||
} | ||
myCompiledFiles.put(builderName, CollectionFactory.createFilePathSet(paths)); | ||
} | ||
|
||
@Override | ||
|
@@ -54,17 +60,19 @@ public void assertDeleted(File[] baseDirs, String... paths){ | |
assertRelativePaths(baseDirs, myDeletedFiles, paths); | ||
} | ||
|
||
private static void assertRelativePaths(File[] baseDirs, Collection<File> files, String[] expected){ | ||
private static void assertRelativePaths(File[] baseDirs, Set<String> files, String[] expected){ | ||
List<String> relativePaths = new ArrayList<String>(); | ||
for (File file: files){ | ||
String path = file.getAbsolutePath(); | ||
for (String file: files) { | ||
String path = new File(file).getAbsolutePath(); | ||
for(File baseDir:baseDirs){ | ||
if(baseDir != null && FileUtil.isAncestor(baseDir, file, false)){ | ||
path = FileUtil.getRelativePath(baseDir, file); | ||
if(baseDir != null && FileUtil.isAncestor(baseDir.getPath(), file, false)){ | ||
path = FileUtil.getRelativePath(baseDir.getPath(), file, File.separatorChar); | ||
break; | ||
} | ||
} | ||
relativePaths.add(FileUtil.toSystemIndependentName(path)); | ||
if (path != null) { | ||
relativePaths.add(FileUtil.toSystemIndependentName(path)); | ||
} | ||
} | ||
UsefulTestCase.assertSameElements(relativePaths, expected); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
package org.elixir_lang | ||
|
||
import com.intellij.openapi.application.ex.ApplicationInfoEx | ||
import com.intellij.openapi.util.Version | ||
import com.intellij.psi.PsiPolyVariantReference | ||
import com.intellij.usages.UsageInfo2UsageAdapter | ||
import org.elixir_lang.find_usages.handler.AlreadyResolved | ||
|
@@ -650,10 +651,15 @@ class FindUsagesTest : PlatformTestCase() { | |
) | ||
} | ||
|
||
private fun usages(): String = | ||
if (ApplicationInfoEx.getInstance().fullVersion == "2021.1.3") { | ||
private fun usages(): String { | ||
val ideVersion = Version.parseVersion(ApplicationInfoEx.getInstance().fullVersion) | ||
val usagesString = if (ideVersion === null || ideVersion.lessThan(2021,2,0)) { | ||
"Found usages" | ||
} else { | ||
} else if (ideVersion.lessThan(2024,1,0)) { | ||
"Usages in" | ||
} else { | ||
"Usages" | ||
} | ||
return usagesString | ||
} | ||
Comment on lines
+654
to
+664
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. I'm not sure I understand what's driving this change. Can you walk me through it please? 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. This is to help some tests pass. In February, IntelliJ changed the wording of the text representation of the find usages response. That change made its way into all 2024.1 IDEs and broke these tests. Note, there are still some other changes in 2024.1 that are preventing these tests from actually passing, but this is the simple first step to remedy the bulk of the error messages. 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. Is it necessary to support previous build versions if we are bocking these versions with the from-version attribute? 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. Good point, we really don't need the case to handle the pre-2021.2 usages string. |
||
} |
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.
Based on previous compatibility PRs
sinceBuild
typically matchesuntilBuild
since we're dropping support for previous versions.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.
I haven't seen any compatibility PRs in this repo where the
sinceBuild
matches theuntilBuild
, that doesn't seem right.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.
The following warning shows for this:
I believe it needs to match.
Since we also only support the last version of the IDE per version, I think this is fine?