-
Notifications
You must be signed in to change notification settings - Fork 307
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[2020.3 compat] remove obsolete
StatementParsing.FUTURE
flag from s…
…dkcompat The Enum does not exist anymore in the 2020.3 sdk PiperOrigin-RevId: 355938588
- Loading branch information
1 parent
abe429e
commit bce2fd8
Showing
18 changed files
with
562 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Description: Indirections for SDK changes to the underlying platform library. | ||
|
||
load("//intellij_platform_sdk:build_defs.bzl", "select_for_ide") | ||
|
||
licenses(["notice"]) | ||
|
||
java_library( | ||
name = "v203", | ||
srcs = glob([ | ||
"com/google/idea/sdkcompat/general/**", | ||
"com/google/idea/sdkcompat/formatter/**", | ||
"com/google/idea/sdkcompat/platform/**", | ||
"com/google/idea/sdkcompat/python/**", | ||
"com/google/idea/sdkcompat/vcs/**", | ||
]) + select_for_ide( | ||
android_studio = glob([ | ||
"com/google/idea/sdkcompat/cpp/**", | ||
"com/google/idea/sdkcompat/java/**", | ||
]), | ||
clion = glob([ | ||
"com/google/idea/sdkcompat/clion/**", | ||
"com/google/idea/sdkcompat/cpp/**", | ||
]), | ||
intellij = glob([ | ||
"com/google/idea/sdkcompat/java/**", | ||
"com/google/idea/sdkcompat/scala/**", | ||
]), | ||
intellij_ue = glob([ | ||
"com/google/idea/sdkcompat/java/**", | ||
"com/google/idea/sdkcompat/scala/**", | ||
]), | ||
), | ||
visibility = ["//sdkcompat:__pkg__"], | ||
deps = [ | ||
"//intellij_platform_sdk:jsr305", | ||
"//intellij_platform_sdk:plugin_api", | ||
"//third_party/python", | ||
"//third_party/scala", | ||
], | ||
) |
12 changes: 12 additions & 0 deletions
12
sdkcompat/v203/com/google/idea/sdkcompat/clion/CidrConsoleBuilderAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.google.idea.sdkcompat.clion; | ||
|
||
import com.intellij.openapi.project.Project; | ||
import com.jetbrains.cidr.execution.CidrConsoleBuilder; | ||
|
||
/** Api compat with 2020.2 #api201 */ | ||
public class CidrConsoleBuilderAdapter extends CidrConsoleBuilder { | ||
|
||
public CidrConsoleBuilderAdapter(Project project) { | ||
super(project, null, null); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
sdkcompat/v203/com/google/idea/sdkcompat/clion/CidrLauncherAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.google.idea.sdkcompat.clion; | ||
|
||
import com.jetbrains.cidr.execution.CidrLauncher; | ||
|
||
/** Api compat with 2020.2 #api201 */ | ||
public abstract class CidrLauncherAdapter extends CidrLauncher {} |
10 changes: 10 additions & 0 deletions
10
sdkcompat/v203/com/google/idea/sdkcompat/clion/ToolchainCompat.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.google.idea.sdkcompat.clion; | ||
|
||
import com.jetbrains.cidr.cpp.toolchains.CPPToolchains.Toolchain; | ||
|
||
/** Api compat with 2020.1 #api193 */ | ||
public class ToolchainCompat { | ||
public static String getDefaultName() { | ||
return Toolchain.getDefault(); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
sdkcompat/v203/com/google/idea/sdkcompat/cpp/IncludedHeadersRootCompat.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.google.idea.sdkcompat.cpp; | ||
|
||
import com.intellij.openapi.project.Project; | ||
import com.intellij.openapi.vfs.VirtualFile; | ||
import com.jetbrains.cidr.lang.workspace.headerRoots.HeadersSearchPath; | ||
import com.jetbrains.cidr.lang.workspace.headerRoots.HeadersSearchRoot; | ||
import com.jetbrains.cidr.lang.workspace.headerRoots.IncludedHeadersRoot; | ||
|
||
/** | ||
* Compat for {@link IncludedHeadersRoot}. | ||
* | ||
* <p>#api201 | ||
*/ | ||
public class IncludedHeadersRootCompat { | ||
public static boolean isUserHeaders(IncludedHeadersRoot root) { | ||
return root.getKind() == HeadersSearchPath.Kind.USER; | ||
} | ||
|
||
public static HeadersSearchRoot create( | ||
Project project, VirtualFile vf, boolean recursive, boolean isUserHeader) { | ||
HeadersSearchPath.Kind kind = | ||
isUserHeader ? HeadersSearchPath.Kind.USER : HeadersSearchPath.Kind.SYSTEM; | ||
return IncludedHeadersRoot.create(project, vf, recursive, kind); | ||
} | ||
|
||
private IncludedHeadersRootCompat() {} | ||
} |
32 changes: 32 additions & 0 deletions
32
sdkcompat/v203/com/google/idea/sdkcompat/cpp/MessageBusSupplier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.google.idea.sdkcompat.cpp; | ||
|
||
import com.intellij.openapi.project.Project; | ||
import com.intellij.util.messages.ListenerDescriptor; | ||
import com.intellij.util.messages.MessageBus; | ||
import com.intellij.util.messages.MessageBusOwner; | ||
import com.intellij.util.messages.impl.MessageBusFactoryImpl; | ||
|
||
/** Compat for 2020.1 api changes #api193 */ | ||
public class MessageBusSupplier { | ||
public static MessageBus createMessageBus(Project project) { | ||
return MessageBusFactoryImpl.createRootBus(new MessageBusOwnerForProject(project)); | ||
} | ||
|
||
private static class MessageBusOwnerForProject implements MessageBusOwner { | ||
private final Project realOwner; | ||
|
||
MessageBusOwnerForProject(Project project) { | ||
realOwner = project; | ||
} | ||
|
||
@Override | ||
public Object createListener(ListenerDescriptor listenerDescriptor) { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override | ||
public boolean isDisposed() { | ||
return realOwner.isDisposed(); | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
sdkcompat/v203/com/google/idea/sdkcompat/cpp/OCImportGraphCompat.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.google.idea.sdkcompat.cpp; | ||
|
||
import com.intellij.openapi.project.Project; | ||
import com.intellij.openapi.vfs.VirtualFile; | ||
import com.jetbrains.cidr.lang.preprocessor.OCImportGraph; | ||
import java.util.Collection; | ||
|
||
/** Compat utilities for {@link OCImportGraph}. */ | ||
public class OCImportGraphCompat { | ||
// #api193 | ||
public static Collection<VirtualFile> getAllHeaderRoots(Project project, VirtualFile headerFile) { | ||
return OCImportGraph.getInstance(project).getAllHeaderRoots(headerFile); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
sdkcompat/v203/com/google/idea/sdkcompat/cpp/OCWorkspaceEventCompat.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.google.idea.sdkcompat.cpp; | ||
|
||
import com.jetbrains.cidr.lang.workspace.OCWorkspaceEventImpl; | ||
|
||
/** | ||
* Compat methods for {@link OCWorkspaceEventImpl}. | ||
* | ||
* <p>#api201 | ||
*/ | ||
public class OCWorkspaceEventCompat { | ||
private OCWorkspaceEventCompat() {} | ||
|
||
public static OCWorkspaceEventImpl newEvent( | ||
boolean resolveConfigurationsChanged, | ||
boolean sourceFilesChanged, | ||
boolean compilerSettingsChanged, | ||
boolean clientVersionChanged) { | ||
return new OCWorkspaceEventImpl( | ||
resolveConfigurationsChanged, | ||
sourceFilesChanged, | ||
compilerSettingsChanged, | ||
clientVersionChanged); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
sdkcompat/v203/com/google/idea/sdkcompat/formatter/DelegatingCodeStyleManagerCompat.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.google.idea.sdkcompat.formatter; | ||
|
||
import com.intellij.psi.PsiFile; | ||
import com.intellij.psi.codeStyle.CodeStyleManager; | ||
|
||
/** | ||
* Compat for {@code DelegatingCodeStyleManager}. {@link CodeStyleManager} got a new method in | ||
* 2020.2. #api201 | ||
*/ | ||
public class DelegatingCodeStyleManagerCompat { | ||
|
||
private DelegatingCodeStyleManagerCompat() {} | ||
|
||
// #api201: Method introduced in 2020.2. If not overridden, an exception is thrown upon class | ||
// creation. | ||
public static void scheduleReformatWhenSettingsComputed(CodeStyleManager delegate, PsiFile file) { | ||
delegate.scheduleReformatWhenSettingsComputed(file); | ||
} | ||
} |
Oops, something went wrong.