IJPL-797 intellij.platform.codeStyle review internal API

GitOrigin-RevId: 37a934f36d5ef626e6ad7435508eec889729628a
This commit is contained in:
Rustam Vishniakov
2024-05-14 18:47:12 +02:00
committed by intellij-monorepo-bot
parent 2615f425f0
commit c3d4e53c52
15 changed files with 23 additions and 144 deletions

View File

@@ -1,7 +1,3 @@
f:com.intellij.CodeStyleBundle
- sf:BUNDLE:java.lang.String
- s:message(java.lang.String,java.lang.Object[]):java.lang.String
- s:messagePointer(java.lang.String,java.lang.Object[]):java.util.function.Supplier
f:com.intellij.application.options.CodeStyle
- sf:LOG:com.intellij.openapi.diagnostic.Logger
- s:createTestSettings():com.intellij.psi.codeStyle.CodeStyleSettings
@@ -88,17 +84,6 @@ com.intellij.formatting.Block
com.intellij.formatting.BlockEx
- com.intellij.formatting.Block
- a:getLanguage():com.intellij.lang.Language
e:com.intellij.formatting.BraceStyle
- java.lang.Enum
- sf:EndOfLine:com.intellij.formatting.BraceStyle
- sf:NextLine:com.intellij.formatting.BraceStyle
- sf:NextLineEachShifted:com.intellij.formatting.BraceStyle
- sf:NextLineIfWrapped:com.intellij.formatting.BraceStyle
- sf:NextLineShifted:com.intellij.formatting.BraceStyle
- s:fromInt(I):com.intellij.formatting.BraceStyle
- f:intValue():I
- s:valueOf(java.lang.String):com.intellij.formatting.BraceStyle
- s:values():com.intellij.formatting.BraceStyle[]
c:com.intellij.formatting.ChildAttributes
- sf:DELEGATE_TO_NEXT_CHILD:com.intellij.formatting.ChildAttributes
- sf:DELEGATE_TO_PREV_CHILD:com.intellij.formatting.ChildAttributes
@@ -127,15 +112,6 @@ e:com.intellij.formatting.DependentSpacingRule$Trigger
- sf:HAS_LINE_FEEDS:com.intellij.formatting.DependentSpacingRule$Trigger
- s:valueOf(java.lang.String):com.intellij.formatting.DependentSpacingRule$Trigger
- s:values():com.intellij.formatting.DependentSpacingRule$Trigger[]
e:com.intellij.formatting.ForceBraces
- java.lang.Enum
- sf:Always:com.intellij.formatting.ForceBraces
- sf:IfMultiline:com.intellij.formatting.ForceBraces
- sf:Never:com.intellij.formatting.ForceBraces
- s:fromInt(I):com.intellij.formatting.ForceBraces
- intValue():I
- s:valueOf(java.lang.String):com.intellij.formatting.ForceBraces
- s:values():com.intellij.formatting.ForceBraces[]
com.intellij.formatting.Formatter
- a:createAlignment(Z,com.intellij.formatting.Alignment$Anchor):com.intellij.formatting.Alignment
- a:createChildAlignment(com.intellij.formatting.Alignment):com.intellij.formatting.Alignment
@@ -320,14 +296,6 @@ e:com.intellij.formatting.WrapType
- getLegacyRepresentation():I
- s:valueOf(java.lang.String):com.intellij.formatting.WrapType
- s:values():com.intellij.formatting.WrapType[]
c:com.intellij.formatting.fileSet.AnyFileDescriptor
- com.intellij.formatting.fileSet.FileSetDescriptor
- sf:TYPE:java.lang.String
- <init>():V
- getPattern():java.lang.String
- getType():java.lang.String
- matches(com.intellij.psi.PsiFile):Z
- setPattern(java.lang.String):V
com.intellij.formatting.fileSet.FileSetDescriptor
- getName():java.lang.String
- a:getPattern():java.lang.String
@@ -422,9 +390,6 @@ com.intellij.lang.LanguageFormattingRestriction
- sf:EP_NAME:com.intellij.openapi.extensions.ExtensionPointName
- isAutoFormatAllowed(com.intellij.psi.PsiElement):Z
- a:isFormatterAllowed(com.intellij.psi.PsiElement):Z
com.intellij.lang.VirtualFormattingListener
- a:replaceWhiteSpace(com.intellij.openapi.util.TextRange,java.lang.String):V
- a:shiftIndentInsideRange(com.intellij.lang.ASTNode,com.intellij.openapi.util.TextRange,I):V
c:com.intellij.openapi.editor.DefaultLineWrapPositionStrategy
- com.intellij.openapi.editor.GenericLineWrapPositionStrategy
- <init>():V
@@ -470,9 +435,6 @@ f:com.intellij.openapi.editor.LanguageLineWrapPositionStrategy
- sf:INSTANCE:com.intellij.openapi.editor.LanguageLineWrapPositionStrategy
- forEditor(com.intellij.openapi.editor.Editor):com.intellij.openapi.editor.LineWrapPositionStrategy
- getDefaultImplementation():com.intellij.openapi.editor.LineWrapPositionStrategy
f:com.intellij.psi.codeStyle.AppCodeStyleSettingsManager
- com.intellij.psi.codeStyle.CodeStyleSettingsManager
- <init>():V
com.intellij.psi.codeStyle.CodeStyleConstraints
- sf:MAX_INDENT_SIZE:I
- sf:MAX_RIGHT_MARGIN:I
@@ -921,8 +883,6 @@ c:com.intellij.psi.codeStyle.CommonCodeStyleSettings
- setArrangementSettings(com.intellij.psi.codeStyle.arrangement.ArrangementSettings):V
- setForceArrangeMenuAvailable(Z):V
- setSoftMargins(java.util.List):V
- writeExternal(org.jdom.Element):V
- writeExternal(org.jdom.Element,com.intellij.psi.codeStyle.LanguageCodeStyleProvider):V
@:com.intellij.psi.codeStyle.CommonCodeStyleSettings$BraceStyleConstant
- java.lang.annotation.Annotation
@:com.intellij.psi.codeStyle.CommonCodeStyleSettings$ForceBraceConstant
@@ -1084,11 +1044,6 @@ c:com.intellij.psi.codeStyle.LegacyCodeStyleSettings
- SPACE_WITHIN_PARENTHESES:Z
- SPACE_WITHIN_WHILE_PARENTHESES:Z
- <init>():V
f:com.intellij.psi.codeStyle.LegacyCodeStyleSettingsManager
- com.intellij.openapi.components.PersistentStateComponent
- <init>():V
- getState():org.jdom.Element
- loadState(org.jdom.Element):V
c:com.intellij.psi.codeStyle.PackageEntry
- sf:ALL_OTHER_IMPORTS_ENTRY:com.intellij.psi.codeStyle.PackageEntry
- sf:ALL_OTHER_STATIC_IMPORTS_ENTRY:com.intellij.psi.codeStyle.PackageEntry
@@ -1134,14 +1089,6 @@ a:com.intellij.psi.codeStyle.PredefinedCodeStyle
- hashCode():I
- isApplicableToLanguage(com.intellij.lang.Language):Z
- toString():java.lang.String
f:com.intellij.psi.codeStyle.ProjectCodeStyleSettingsManager
- com.intellij.psi.codeStyle.CodeStyleSettingsManager
- <init>(com.intellij.openapi.project.Project):V
- getMainProjectCodeStyle():com.intellij.psi.codeStyle.CodeStyleSettings
- getState():org.jdom.Element
- initializeComponent():V
- loadState(org.jdom.Element):V
- setMainProjectCodeStyle(com.intellij.psi.codeStyle.CodeStyleSettings):V
a:com.intellij.psi.codeStyle.PsiBasedFileIndentOptionsProvider
- com.intellij.psi.codeStyle.FileIndentOptionsProvider
- <init>():V

View File

@@ -1 +0,0 @@
com/intellij/psi/codeStyle/LanguageCodeStyleProvider

View File

@@ -1,13 +1,11 @@
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.PropertyKey;
import org.jetbrains.annotations.*;
import java.util.function.Supplier;
@ApiStatus.Internal
public final class CodeStyleBundle {
public static final @NonNls String BUNDLE = "messages.CodeStyleBundle";
private static final DynamicBundle INSTANCE = new DynamicBundle(CodeStyleBundle.class, BUNDLE);

View File

@@ -1,33 +0,0 @@
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.formatting;
import com.intellij.openapi.util.InvalidDataException;
import com.intellij.psi.codeStyle.CommonCodeStyleSettings;
public enum BraceStyle {
EndOfLine(CommonCodeStyleSettings.END_OF_LINE),
NextLine(CommonCodeStyleSettings.NEXT_LINE),
NextLineShifted(CommonCodeStyleSettings.NEXT_LINE_SHIFTED),
NextLineEachShifted(CommonCodeStyleSettings.NEXT_LINE_SHIFTED2),
NextLineIfWrapped(CommonCodeStyleSettings.NEXT_LINE_IF_WRAPPED);
private final int value;
BraceStyle(@CommonCodeStyleSettings.BraceStyleConstant int value) {
this.value = value;
}
@CommonCodeStyleSettings.BraceStyleConstant
public final int intValue() {
return value;
}
public static BraceStyle fromInt(int value) {
for (BraceStyle style : values()) {
if (style.intValue() == value) {
return style;
}
}
throw new InvalidDataException("Unknown brace style integer value " + value);
}
}

View File

@@ -1,30 +0,0 @@
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.formatting;
import com.intellij.openapi.util.InvalidDataException;
import com.intellij.psi.codeStyle.CommonCodeStyleSettings;
public enum ForceBraces {
Never(CommonCodeStyleSettings.DO_NOT_FORCE),
IfMultiline(CommonCodeStyleSettings.FORCE_BRACES_IF_MULTILINE),
Always(CommonCodeStyleSettings.FORCE_BRACES_ALWAYS);
private final int myIntValue;
ForceBraces(int value) {
myIntValue = value;
}
public int intValue() {
return myIntValue;
}
public static ForceBraces fromInt(int value) {
for (ForceBraces mode : values()) {
if (mode.intValue() == value) {
return mode;
}
}
throw new InvalidDataException("Unknown brace style integer value " + value);
}
}

View File

@@ -2,12 +2,14 @@
package com.intellij.formatting.fileSet;
import com.intellij.psi.PsiFile;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* Used to disable formatting for any file programmatically
*/
@ApiStatus.Internal
public class AnyFileDescriptor implements FileSetDescriptor {
public final static String TYPE = "anyFile";

View File

@@ -2,8 +2,9 @@
package com.intellij.lang
import com.intellij.openapi.util.TextRange
import org.jetbrains.annotations.ApiStatus
@ApiStatus.Internal
interface VirtualFormattingListener {
fun shiftIndentInsideRange(node: ASTNode?, range: TextRange, indent: Int)

View File

@@ -6,6 +6,7 @@ import com.intellij.openapi.components.SettingsCategory;
import com.intellij.openapi.components.State;
import com.intellij.openapi.components.Storage;
import com.intellij.util.messages.MessageBus;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
@@ -13,6 +14,7 @@ import java.util.Collection;
import java.util.List;
@State(name = "CodeStyleSettingsManager", storages = @Storage("code.style.schemes"), category = SettingsCategory.CODE)
@ApiStatus.Internal
public final class AppCodeStyleSettingsManager extends CodeStyleSettingsManager {
public AppCodeStyleSettingsManager() {
registerExtensionPointListeners(null);

View File

@@ -21,6 +21,7 @@ import com.intellij.util.xmlb.SerializationFilter;
import com.intellij.util.xmlb.SkipDefaultValuesSerializationFilters;
import org.intellij.lang.annotations.MagicConstant;
import org.jdom.Element;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -168,6 +169,7 @@ public class CommonCodeStyleSettings implements CommentStyleSettings {
LOG.info("Loaded " + getLanguage().getDisplayName() + " common code style settings");
}
@ApiStatus.Internal
public void writeExternal(Element element) {
LanguageCodeStyleProvider provider = LanguageCodeStyleProvider.forLanguage(getLanguage());
if (provider != null) {
@@ -175,6 +177,7 @@ public class CommonCodeStyleSettings implements CommentStyleSettings {
}
}
@ApiStatus.Internal
public void writeExternal(@NotNull Element element, @NotNull LanguageCodeStyleProvider provider) {
CommonCodeStyleSettings defaultSettings = provider.getDefaultCommonSettings();
Set<String> supportedFields = provider.getSupportedFields();

View File

@@ -6,6 +6,7 @@ import com.intellij.openapi.components.Service;
import com.intellij.openapi.components.State;
import com.intellij.openapi.components.Storage;
import org.jdom.Element;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
/**
@@ -14,6 +15,7 @@ import org.jetbrains.annotations.NotNull;
*/
@Service(Service.Level.PROJECT)
@State(name = "ProjectCodeStyleSettingsManager", storages = @Storage("codeStyleSettings.xml"))
@ApiStatus.Internal
public final class LegacyCodeStyleSettingsManager implements PersistentStateComponent<Element> {
private Element myState;

View File

@@ -10,6 +10,7 @@ import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.messages.MessageBus;
import org.jdom.Element;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -20,6 +21,7 @@ import java.util.*;
name = "ProjectCodeStyleConfiguration",
storages = @Storage(value = "codeStyles", stateSplitter = ProjectCodeStyleSettingsManager.StateSplitter.class)
)
@ApiStatus.Internal
public final class ProjectCodeStyleSettingsManager extends CodeStyleSettingsManager {
private static final Logger LOG = Logger.getInstance(ProjectCodeStyleSettingsManager.class);

View File

@@ -1,11 +1,3 @@
f:com.intellij.application.options.codeStyle.cache.CodeStyleCachingServiceImpl
- com.intellij.openapi.Disposable
- sf:MAX_CACHE_SIZE:I
- <init>(com.intellij.openapi.project.Project):V
- dispose():V
- getDataHolder(com.intellij.openapi.vfs.VirtualFile):com.intellij.openapi.util.UserDataHolder
- scheduleWhenSettingsComputed(com.intellij.psi.PsiFile,java.lang.Runnable):V
- tryGetSettings(com.intellij.openapi.vfs.VirtualFile):com.intellij.psi.codeStyle.CodeStyleSettings
a:com.intellij.formatting.AbstractBlockAlignmentProcessor
- com.intellij.formatting.BlockAlignmentProcessor
- <init>():V
@@ -391,19 +383,8 @@ c:com.intellij.formatting.SpacingImpl
- f:shouldKeepLineFeeds():Z
- toString():java.lang.String
f:com.intellij.formatting.VirtualFormattingImplKt
- sf:getVirtualFormattingListener(com.intellij.psi.PsiElement):com.intellij.lang.VirtualFormattingListener
- sf:isEligibleForVirtualFormatting(com.intellij.psi.PsiElement):Z
- sf:setVirtualFormattingListener(com.intellij.psi.PsiElement,com.intellij.lang.VirtualFormattingListener):V
- sf:wrapForVirtualFormatting(com.intellij.psi.PsiElement,com.intellij.formatting.FormattingModelBuilder):com.intellij.formatting.FormattingModelBuilder
f:com.intellij.formatting.VirtualFormattingModelBuilder
- com.intellij.formatting.FormattingModelBuilder
- <init>(com.intellij.formatting.FormattingModelBuilder,com.intellij.psi.PsiFile,com.intellij.lang.VirtualFormattingListener):V
- createModel(com.intellij.formatting.FormattingContext):com.intellij.formatting.FormattingModel
- createModel(com.intellij.psi.PsiElement,com.intellij.openapi.util.TextRange,com.intellij.psi.codeStyle.CodeStyleSettings,com.intellij.formatting.FormattingMode):com.intellij.formatting.FormattingModel
- createModel(com.intellij.psi.PsiElement,com.intellij.psi.codeStyle.CodeStyleSettings):com.intellij.formatting.FormattingModel
- createModel(com.intellij.psi.PsiElement,com.intellij.psi.codeStyle.CodeStyleSettings,com.intellij.formatting.FormattingMode):com.intellij.formatting.FormattingModel
- f:getFile():com.intellij.psi.PsiFile
- f:getListener():com.intellij.lang.VirtualFormattingListener
f:com.intellij.formatting.WhiteSpace
- <init>(I,Z):V
- arrangeLineFeeds(com.intellij.formatting.SpacingImpl,com.intellij.formatting.engine.BlockRangesMap):V

View File

@@ -14,6 +14,7 @@ import com.intellij.psi.PsiFile;
import com.intellij.psi.codeStyle.CodeStyleSettings;
import com.intellij.reference.SoftReference;
import com.intellij.testFramework.LightVirtualFile;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import java.util.Comparator;
@@ -22,6 +23,7 @@ import java.util.Map;
import java.util.PriorityQueue;
import java.util.function.Supplier;
@ApiStatus.Internal
public final class CodeStyleCachingServiceImpl implements CodeStyleCachingService, Disposable {
public static final int MAX_CACHE_SIZE = 100;

View File

@@ -10,15 +10,18 @@ import com.intellij.psi.PsiElement
import com.intellij.psi.PsiFile
import com.intellij.psi.codeStyle.CodeStyleSettings
import com.intellij.psi.formatter.FormattingDocumentModelImpl
import org.jetbrains.annotations.ApiStatus
private val formattingListenerKey = Key.create<VirtualFormattingListener?>("VIRTUAL_FORMATTING_CHANGE_LISTENER")
var PsiElement.virtualFormattingListener: VirtualFormattingListener?
@ApiStatus.Internal
get() = getUserData(formattingListenerKey)
@ApiStatus.Internal
set(value) = putUserData(formattingListenerKey, value)
@ApiStatus.Internal
class VirtualFormattingModelBuilder(private val underlyingBuilder: FormattingModelBuilder,
val file: PsiFile,
val listener: VirtualFormattingListener) : FormattingModelBuilder {

View File

@@ -22,11 +22,11 @@ import org.jetbrains.annotations.NotNull;
import java.util.List;
public class FormattingUiNotificationService implements FormattingNotificationService {
final class FormattingUiNotificationService implements FormattingNotificationService {
private @NotNull final Project myProject;
public FormattingUiNotificationService(@NotNull Project project) {
FormattingUiNotificationService(@NotNull Project project) {
myProject = project;
}