fix - reduce member visibility (public -> private)

GitOrigin-RevId: fe8a4740e27d192798a9fa55ff41112d1b633e49
This commit is contained in:
Vladimir Krivosheev
2022-09-14 13:35:02 +02:00
committed by intellij-monorepo-bot
parent 9e885d86a6
commit 0af2e7b5c5
415 changed files with 821 additions and 814 deletions

View File

@@ -52,7 +52,7 @@ internal class GridOptionsImpl(private val propertyChangeSupport: PropertyChange
EditorColorsManager.getInstance().globalScheme.getColor(GRID_LINE_COLOR_KEY) ?: JBColor.DARK_GRAY
}
fun setLineMinZoomFactor(lineMinZoomFactor: Int) {
private fun setLineMinZoomFactor(lineMinZoomFactor: Int) {
val oldValue = this.lineMinZoomFactor
if (oldValue != lineMinZoomFactor) {
this.lineMinZoomFactor = lineMinZoomFactor
@@ -60,7 +60,7 @@ internal class GridOptionsImpl(private val propertyChangeSupport: PropertyChange
}
}
fun setLineSpan(lineSpan: Int) {
private fun setLineSpan(lineSpan: Int) {
val oldValue = this.lineSpan
if (oldValue != lineSpan) {
this.lineSpan = lineSpan

View File

@@ -33,8 +33,8 @@ import java.awt.Rectangle
import javax.swing.event.TreeModelEvent
import javax.swing.tree.TreeNode
final class ArrayFilterInplaceEditor(node: XDebuggerTreeNode, val myTemp: Boolean, thisType: PsiType?) : XDebuggerTreeInplaceEditor(node,
"arrayFilter") {
final class ArrayFilterInplaceEditor(node: XDebuggerTreeNode, private val myTemp: Boolean, thisType: PsiType?) : XDebuggerTreeInplaceEditor(node,
"arrayFilter") {
init {
if (thisType != null) {
myExpressionEditor.setDocumentProcessor({ d ->

View File

@@ -71,7 +71,7 @@ abstract class DefaultJreSelector {
override fun isValid(): Boolean = !project.isDisposed
}
open class SdkFromModuleDependencies<T: ComboBox<*>>(val moduleComboBox: T, val getSelectedModule: (T) -> Module?, val productionOnly: () -> Boolean): DefaultJreSelector() {
open class SdkFromModuleDependencies<T: ComboBox<*>>(private val moduleComboBox: T, val getSelectedModule: (T) -> Module?, val productionOnly: () -> Boolean): DefaultJreSelector() {
override fun getNameAndDescription(): Pair<String?, String> {
val moduleNotSpecified = ExecutionBundle.message("module.not.specified")
val module = getSelectedModule(moduleComboBox) ?: return Pair.create(null, moduleNotSpecified)
@@ -103,7 +103,7 @@ abstract class DefaultJreSelector {
}
}
class SdkFromSourceRootDependencies<T: ComboBox<*>>(moduleComboBox: T, getSelectedModule: (T) -> Module?, val classSelector: EditorTextField)
class SdkFromSourceRootDependencies<T: ComboBox<*>>(moduleComboBox: T, getSelectedModule: (T) -> Module?, private val classSelector: EditorTextField)
: SdkFromModuleDependencies<T>(moduleComboBox, getSelectedModule, { isClassInProductionSources(moduleComboBox, getSelectedModule, classSelector) }) {
override fun addChangeListener(listener: Runnable) {
super.addChangeListener(listener)

View File

@@ -39,14 +39,14 @@ abstract class AssetsNewProjectWizardStep(parent: NewProjectWizardStep) : Abstra
fun addTemplateProperties(vararg properties: Pair<String, Any>) =
addTemplateProperties(properties.toMap())
fun addTemplateProperties(properties: Map<String, Any>) {
private fun addTemplateProperties(properties: Map<String, Any>) {
templateProperties.putAll(properties)
}
fun addFilesToOpen(vararg relativeCanonicalPaths: String) =
addFilesToOpen(relativeCanonicalPaths.toList())
fun addFilesToOpen(relativeCanonicalPaths: Iterable<String>) {
private fun addFilesToOpen(relativeCanonicalPaths: Iterable<String>) {
filesToOpen.addAll(relativeCanonicalPaths.map { "$outputDirectory/$it" })
}

View File

@@ -37,7 +37,7 @@ import javax.swing.tree.TreeSelectionModel
open class StarterLibrariesStep(contextProvider: StarterContextProvider) : ModuleWizardStep() {
protected val starterContext = contextProvider.starterContext
protected val starterSettings: StarterWizardSettings = contextProvider.settings
private val starterSettings: StarterWizardSettings = contextProvider.settings
protected val moduleBuilder: StarterModuleBuilder = contextProvider.moduleBuilder
private val topLevelPanel: BorderLayoutPanel = BorderLayoutPanel()

View File

@@ -47,8 +47,8 @@ abstract class CommonStarterInitialStep(
protected val propertyGraph: PropertyGraph = PropertyGraph()
protected val entityNameProperty: GraphProperty<String> = propertyGraph.lazyProperty(::suggestName)
protected val locationProperty: GraphProperty<String> = propertyGraph.lazyProperty(::suggestLocationByName)
protected val canonicalPathProperty = locationProperty.joinCanonicalPath(entityNameProperty)
private val locationProperty: GraphProperty<String> = propertyGraph.lazyProperty(::suggestLocationByName)
private val canonicalPathProperty = locationProperty.joinCanonicalPath(entityNameProperty)
protected val groupIdProperty: GraphProperty<String> = propertyGraph.lazyProperty { starterContext.group }
protected val artifactIdProperty: GraphProperty<String> = propertyGraph.lazyProperty { entityName }
protected val sdkProperty: GraphProperty<Sdk?> = propertyGraph.lazyProperty { null }
@@ -184,7 +184,7 @@ abstract class CommonStarterInitialStep(
protected fun <T : JComponent> Cell<T>.withSpecialValidation(vararg errorValidationUnits: TextValidationFunction): Cell<T> =
withValidation(this, errorValidationUnits.asList(), null, validatedTextComponents, parentDisposable)
protected fun <T : JComponent> Cell<T>.withSpecialValidation(
private fun <T : JComponent> Cell<T>.withSpecialValidation(
errorValidationUnits: List<TextValidationFunction>,
warningValidationUnit: TextValidationFunction?
): Cell<T> {

View File

@@ -48,7 +48,7 @@ class JavaSuggestedRefactoringAvailability(refactoringSupport: SuggestedRefactor
}
}
fun callStateToDeclarationState(state: SuggestedRefactoringState): SuggestedRefactoringState? {
private fun callStateToDeclarationState(state: SuggestedRefactoringState): SuggestedRefactoringState? {
val anchor = state.anchor as? PsiCallExpression ?: return null
val resolveResult = anchor.resolveMethodGenerics()
if (resolveResult.isValidResult) return null

View File

@@ -85,18 +85,18 @@ class CallBuilder(private val context: PsiElement) {
}
}
fun buildCall(methodCall: String, flowOutput: FlowOutput, dataOutput: DataOutput, exposedDeclarations: List<PsiVariable>): List<PsiStatement> {
private fun buildCall(methodCall: String, flowOutput: FlowOutput, dataOutput: DataOutput, exposedDeclarations: List<PsiVariable>): List<PsiStatement> {
val variableDeclaration = if (flowOutput !is ConditionalFlow && dataOutput is ExpressionOutput) emptyList() else variableDeclaration(methodCall, dataOutput)
return variableDeclaration + createFlowStatements(methodCall, flowOutput, dataOutput) + exposedDeclarations.map { createDeclaration(it) }
}
fun buildExpressionCall(methodCall: String, dataOutput: DataOutput): List<PsiElement> {
private fun buildExpressionCall(methodCall: String, dataOutput: DataOutput): List<PsiElement> {
require(dataOutput is ExpressionOutput)
val expression = if (dataOutput.name != null) "${dataOutput.name} = $methodCall" else methodCall
return listOf(factory.createExpressionFromText(expression, context))
}
fun createMethodCall(method: PsiMethod, parameters: List<PsiExpression>): PsiMethodCallExpression {
private fun createMethodCall(method: PsiMethod, parameters: List<PsiExpression>): PsiMethodCallExpression {
val name = if (method.isConstructor) "this" else method.name
val callText = name + "(" + parameters.joinToString { it.text } + ")"
val factory = PsiElementFactory.getInstance(method.project)

View File

@@ -48,7 +48,7 @@ object ExtractMethodHelper {
return annotationClass != null
}
fun wrapWithCodeBlock(elements: List<PsiElement>): List<PsiCodeBlock> {
private fun wrapWithCodeBlock(elements: List<PsiElement>): List<PsiCodeBlock> {
require(elements.isNotEmpty())
val codeBlock = PsiElementFactory.getInstance(elements.first().project).createCodeBlock()
elements.forEach { codeBlock.add(it) }
@@ -121,7 +121,7 @@ object ExtractMethodHelper {
return references.asSequence().mapNotNull { reference -> (reference.resolve() as? PsiVariable) }
}
fun hasConflictResolve(name: String?, scopeToIgnore: List<PsiElement>): Boolean {
private fun hasConflictResolve(name: String?, scopeToIgnore: List<PsiElement>): Boolean {
require(scopeToIgnore.isNotEmpty())
if (name == null) return false
val lastElement = scopeToIgnore.last()

View File

@@ -100,7 +100,7 @@ object ExtractMethodPipeline {
return extractOptions.copy(inputParameters = parameters)
}
fun withMappedParametersInput(extractOptions: ExtractOptions, variablesData: List<VariableData>): ExtractOptions {
private fun withMappedParametersInput(extractOptions: ExtractOptions, variablesData: List<VariableData>): ExtractOptions {
fun findMappedParameter(variableData: VariableData): InputParameter? {
return extractOptions.inputParameters
.find { parameter -> parameter.name == variableData.variable.name }
@@ -126,7 +126,7 @@ object ExtractMethodPipeline {
return options.copy(visibility = visibility, isStatic = isStatic)
}
fun withMappedName(extractOptions: ExtractOptions, methodName: String) = if (extractOptions.isConstructor) extractOptions else extractOptions.copy(methodName = methodName)
private fun withMappedName(extractOptions: ExtractOptions, methodName: String) = if (extractOptions.isConstructor) extractOptions else extractOptions.copy(methodName = methodName)
fun withDefaultStatic(extractOptions: ExtractOptions): ExtractOptions {
val expression = extractOptions.elements.singleOrNull() as? PsiExpression
@@ -138,7 +138,7 @@ object ExtractMethodPipeline {
return extractOptions.copy(isStatic = shouldBeStatic)
}
fun findDefaultTargetCandidate(candidates: List<PsiClass>): PsiClass {
private fun findDefaultTargetCandidate(candidates: List<PsiClass>): PsiClass {
return AnonymousTargetClassPreselectionUtil.getPreselection(candidates, candidates.first()) ?: candidates.first()
}

View File

@@ -120,9 +120,9 @@ class JavaDuplicatesFinder(pattern: List<PsiElement>, private val predefinedChan
return duplicate.copy(changedExpressions = changedExpressions)
}
fun traverseAndCollectChanges(pattern: List<PsiElement>,
candidate: List<PsiElement>,
changedExpressions: MutableList<ChangedExpression>): Boolean {
private fun traverseAndCollectChanges(pattern: List<PsiElement>,
candidate: List<PsiElement>,
changedExpressions: MutableList<ChangedExpression>): Boolean {
if (candidate.size != pattern.size) return false
val notEqualElements = pattern.zip(candidate).filterNot { (pattern, candidate) ->
pattern !in predefinedChanges &&
@@ -134,7 +134,7 @@ class JavaDuplicatesFinder(pattern: List<PsiElement>, private val predefinedChan
return true
}
fun areEquivalent(pattern: PsiElement, candidate: PsiElement): Boolean {
private fun areEquivalent(pattern: PsiElement, candidate: PsiElement): Boolean {
return when {
pattern is PsiTypeElement && candidate is PsiTypeElement -> canBeReplaced(pattern.type, candidate.type)
pattern is PsiJavaCodeReferenceElement && candidate is PsiJavaCodeReferenceElement ->

View File

@@ -109,7 +109,7 @@ class MethodExtractor {
val ExtractOptions.targetClass: PsiClass
get() = anchor.containingClass ?: throw IllegalStateException()
fun suggestSafeMethodNames(options: ExtractOptions): List<String> {
private fun suggestSafeMethodNames(options: ExtractOptions): List<String> {
val unsafeNames = guessMethodName(options)
val safeNames = unsafeNames.filterNot { name -> hasConflicts(options.copy(methodName = name)) }
if (safeNames.isNotEmpty()) return safeNames
@@ -126,7 +126,7 @@ class MethodExtractor {
return ! conflicts.isEmpty
}
fun createInplaceSettingsPopup(options: ExtractOptions): ExtractMethodPopupProvider {
private fun createInplaceSettingsPopup(options: ExtractOptions): ExtractMethodPopupProvider {
val isStatic = options.isStatic
val analyzer = CodeFragmentAnalyzer(options.elements)
val optionsWithStatic = ExtractMethodPipeline.withForcedStatic(analyzer, options)

View File

@@ -41,7 +41,7 @@ class ExtractMethodPopupProvider(val annotateDefault: Boolean? = null,
val panel: JPanel by lazy { createPanel() }
val makeStaticLabel = if (staticPassFields) {
private val makeStaticLabel = if (staticPassFields) {
JavaRefactoringBundle.message("extract.method.checkbox.make.static.and.pass.fields")
} else {
JavaRefactoringBundle.message("extract.method.checkbox.make.static")

View File

@@ -19,7 +19,7 @@ class MigrationDialogUi(map: MigrationMap?) {
lateinit var nameLabel: JLabel
var removeLink: ActionLink? = null
lateinit var editLink: ActionLink
lateinit var descriptionLabel: JEditorPane
private lateinit var descriptionLabel: JEditorPane
lateinit var modulesCombo: ModulesComboBox
val panel = panel {

View File

@@ -27,14 +27,14 @@ data class MasterDetailsItem(@NlsContexts.Checkbox val text: String, val checkbo
object JavadocUIUtil {
fun Cell<JBCheckBox>.bindCheckbox(get: () -> Boolean, set: (Boolean) -> Unit): Cell<JBCheckBox> = applyToComponent {
private fun Cell<JBCheckBox>.bindCheckbox(get: () -> Boolean, set: (Boolean) -> Unit): Cell<JBCheckBox> = applyToComponent {
isSelected = get()
addActionListener {
set(isSelected)
}
}
fun Cell<JBCheckBox>.bindCheckbox(property: KMutableProperty0<Boolean>): Cell<JBCheckBox> = bindCheckbox(property::get, property::set)
private fun Cell<JBCheckBox>.bindCheckbox(property: KMutableProperty0<Boolean>): Cell<JBCheckBox> = bindCheckbox(property::get, property::set)
fun <T> Cell<ComboBox<T>>.bindItem(property: KMutableProperty0<T>): Cell<ComboBox<T>> = applyToComponent {
selectedItem = property.get()
@@ -48,7 +48,7 @@ object JavadocUIUtil {
return MasterDetailsItem(text, PropertyBinding(checkboxBinding::get, checkboxBinding::set), description)
}
fun createMasterDetails(items: List<MasterDetailsItem>): JPanel {
private fun createMasterDetails(items: List<MasterDetailsItem>): JPanel {
val layout = CardLayout()
val description = JPanel(layout)
val list = CheckBoxList<MasterDetailsItem>()

View File

@@ -70,7 +70,7 @@ internal class JsonPathEvaluateSnippetView(project: Project) : JsonPathEvaluateV
initToolbar()
}
fun setSource(json: String) {
private fun setSource(json: String) {
WriteAction.run<Throwable> {
sourceEditor.document.setText(json)
}

View File

@@ -9,7 +9,7 @@ import com.jayway.jsonpath.*
class JsonPathEvaluator(val jsonFile: JsonFile?,
val expression: String,
val evalOptions: Set<Option>) {
private val evalOptions: Set<Option>) {
fun evaluate(): EvaluateResult? {
val jsonPath: JsonPath = try {

View File

@@ -18,9 +18,9 @@ import javax.swing.JPanel
abstract class USerializableInspectionBase(vararg hint: Class<out UElement>) : AbstractBaseUastLocalInspectionTool(*hint) {
var ignoreAnonymousInnerClasses = false
var superClassString: @NonNls String = "java.awt.Component"
private var superClassString: @NonNls String = "java.awt.Component"
protected val superClassList: MutableList<String> = mutableListOf()
private val superClassList: MutableList<String> = mutableListOf()
override fun readSettings(node: Element) {
super.readSettings(node)
@@ -49,7 +49,7 @@ abstract class USerializableInspectionBase(vararg hint: Class<out UElement>) : A
addCheckbox(InspectionGadgetsBundle.message("ignore.anonymous.inner.classes"), "ignoreAnonymousInnerClasses")
}
protected fun createAdditionalOptions(): Array<JComponent> = emptyArray()
private fun createAdditionalOptions(): Array<JComponent> = emptyArray()
protected fun isIgnoredSubclass(aClass: PsiClass): Boolean {
if (SerializationUtils.isDirectlySerializable(aClass)) return false

View File

@@ -102,7 +102,7 @@ class JUnit5AssertionsConverterInspection(val frameworkName: @NonNls String = "J
}
}
inner class ReplaceObsoleteAssertsFix(val baseClassName: String) : LocalQuickFix {
inner class ReplaceObsoleteAssertsFix(private val baseClassName: String) : LocalQuickFix {
override fun applyFix(project: Project, descriptor: ProblemDescriptor) {
val element = descriptor.psiElement
when (val uElement = element.toUElement()) {

View File

@@ -79,7 +79,7 @@ internal class CollapsingComponent(
}
val mainComponent: JComponent get() = getComponent(0) as JComponent
val stubComponent: JComponent get() = getComponent(1) as JComponent
private val stubComponent: JComponent get() = getComponent(1) as JComponent
val isWorthCollapsing: Boolean get() = !isSeen || mainComponent.height >= MIN_HEIGHT_TO_COLLAPSE

View File

@@ -113,7 +113,7 @@ open class InlayComponent : JPanel(BorderLayout()), EditorCustomElementRenderer
}
/** Fits size and position of component to inlay's size and position. */
protected fun updateComponentBounds(targetRegion: Rectangle) {
private fun updateComponentBounds(targetRegion: Rectangle) {
if (bounds == targetRegion) {
return
}

View File

@@ -48,7 +48,7 @@ class NotebookTabs private constructor(private val editor: BorderLayoutPanel) :
addTab(VisualizationBundle.message("notebook.tabs.code.title"), center)
}
fun addTab(@Nls name: String, page: Component) {
private fun addTab(@Nls name: String, page: Component) {
val tab = JToggleButton(name)
val action = {

View File

@@ -61,7 +61,7 @@ class ToolbarPane(val inlayOutput: InlayOutput) : JPanel(BorderLayout()) {
}
}
fun updateChildrenBounds() {
private fun updateChildrenBounds() {
mainPanel?.setBounds(0, 0, width, height)
val progressBarWidth = if (progressComponent != null) PROGRESS_BAR_DEFAULT_WIDTH else 0
toolbarComponent?.setBounds(width - toolbarComponent!!.preferredSize.width, progressBarWidth, toolbarComponent!!.preferredSize.width,

View File

@@ -106,7 +106,7 @@ open class MaterialTable : JBTable {
addMouseListener(mouseListener)
}
fun isHighlightRowSelected(row: Int) = isRowSelected(row) || row == rollOverRowIndex
private fun isHighlightRowSelected(row: Int) = isRowSelected(row) || row == rollOverRowIndex
fun isRollOverRowIndex(row: Int): Boolean = row == rollOverRowIndex

View File

@@ -11,7 +11,7 @@ import kotlin.math.min
object MaterialTableUtils {
fun getColumnHeaderWidth(table: JTable, column: Int): Int {
private fun getColumnHeaderWidth(table: JTable, column: Int): Int {
if (table.tableHeader == null || table.columnModel.columnCount <= column) {
return 0
@@ -29,7 +29,7 @@ object MaterialTableUtils {
return c.preferredSize.width
}
fun getColumnWidth(table: JTable, column: Int, maxRows: Int? = null): Int {
private fun getColumnWidth(table: JTable, column: Int, maxRows: Int? = null): Int {
var width = max(JBUI.scale(65), getColumnHeaderWidth(table, column)) // Min width
// We should not cycle through all
@@ -42,7 +42,7 @@ object MaterialTableUtils {
return width
}
fun fitColumnWidth(column: Int, table: JTable, maxWidth: Int = 350, maxRows: Int? = null) {
private fun fitColumnWidth(column: Int, table: JTable, maxWidth: Int = 350, maxRows: Int? = null) {
var width = getColumnWidth(table, column, maxRows)
if (maxWidth in 1 until width) {

View File

@@ -32,8 +32,8 @@ open class CompositeDeclarativeInsertHandler(val handlers: Map<String, Lazy<Decl
}
companion object {
fun withUniversalHandler(completionChars: String,
handler: Lazy<DeclarativeInsertHandler2>): CompositeDeclarativeInsertHandler {
private fun withUniversalHandler(completionChars: String,
handler: Lazy<DeclarativeInsertHandler2>): CompositeDeclarativeInsertHandler {
val handlersMap = mapOf(completionChars to handler)
// it's important not to provide a fallbackInsertHandler
return CompositeDeclarativeInsertHandler(handlersMap, null)

View File

@@ -8,7 +8,7 @@ import com.intellij.openapi.project.Project
import java.util.*
// search by full name, not partially (not by words)
class SearchConfigurableByNameHelper(name: String, val rootGroup: ConfigurableGroup) {
class SearchConfigurableByNameHelper(name: String, private val rootGroup: ConfigurableGroup) {
private val names = name.splitToSequence("--", "|").map { it.trim() }.toList()
private val stack = ArrayDeque<Item>()

View File

@@ -72,7 +72,7 @@ internal class ToolboxUpdateAction(
val lifetime: Disposable,
text: @Nls String,
description: @Nls String,
val actionHandler: Consumer<AnActionEvent>,
private val actionHandler: Consumer<AnActionEvent>,
val restartRequired: Boolean
) : SettingsEntryPointAction.UpdateAction(text) {
lateinit var registry : ToolboxSettingsActionRegistry

View File

@@ -49,10 +49,10 @@ class LineCommentAddSpacePostFormatProcessor : PostFormatProcessor {
internal class SingleLineCommentFinder(val rangeToReformat: TextRange,
val languageCodeStyleSettingsProvider: LanguageCodeStyleProvider,
private val languageCodeStyleSettingsProvider: LanguageCodeStyleProvider,
commenter: Commenter) : PsiRecursiveElementVisitor() {
val lineCommentPrefixes = commenter.lineCommentPrefixes.map { it.trim() }
private val lineCommentPrefixes = commenter.lineCommentPrefixes.map { it.trim() }
val commentOffsets = arrayListOf<Int>()
override fun visitElement(element: PsiElement) {

View File

@@ -19,7 +19,7 @@ var PsiElement.virtualFormattingListener: VirtualFormattingListener?
set(value) = putUserData(formattingListenerKey, value)
class VirtualFormattingModelBuilder(val underlyingBuilder: FormattingModelBuilder,
class VirtualFormattingModelBuilder(private val underlyingBuilder: FormattingModelBuilder,
val file: PsiFile,
val listener: VirtualFormattingListener) : FormattingModelBuilder {

View File

@@ -42,7 +42,7 @@ abstract class GraphQLApiClient : HttpApiClient() {
suspend inline fun <reified T> loadGQLResponse(request: HttpRequest, vararg pathFromData: String)
: HttpResponse<T?> = loadGQLResponse(request, T::class.java, *pathFromData)
fun <T> gqlBodyHandler(request: HttpRequest, pathFromData: Array<out String>, clazz: Class<T>): HttpResponse.BodyHandler<T?> =
private fun <T> gqlBodyHandler(request: HttpRequest, pathFromData: Array<out String>, clazz: Class<T>): HttpResponse.BodyHandler<T?> =
object : StreamReadingBodyHandler<T?>(request) {
override fun read(bodyStream: InputStream): T? {

View File

@@ -14,8 +14,8 @@ import java.util.zip.GZIPInputStream
object HttpClientUtil {
const val CONTENT_ENCODING_HEADER = "Content-Encoding"
const val CONTENT_ENCODING_GZIP = "gzip"
private const val CONTENT_ENCODING_HEADER = "Content-Encoding"
private const val CONTENT_ENCODING_GZIP = "gzip"
const val CONTENT_TYPE_HEADER = "Content-Type"
const val CONTENT_TYPE_JSON = "application/json"

View File

@@ -325,7 +325,7 @@ class CombinedDiffViewer(private val context: DiffContext) : DiffViewer, DataPro
return getCurrentDataProvider()?.let(DiffDataKeys.PREV_NEXT_DIFFERENCE_ITERABLE::getData)
}
internal fun getBlocksIterable(): PrevNextDifferenceIterable = scrollSupport.blockIterable
private fun getBlocksIterable(): PrevNextDifferenceIterable = scrollSupport.blockIterable
internal fun getCurrentDiffViewer(): DiffViewer? = getDiffViewer(scrollSupport.blockIterable.index)

View File

@@ -393,14 +393,14 @@ class SimpleAlignedDiffModel(private val viewer: SimpleDiffViewer) {
return softWrapModel.getSoftWrapsForRange(startOffset, endOffset).size
}
fun Document.getLineEndOffsetSafe(line: Int): Int {
private fun Document.getLineEndOffsetSafe(line: Int): Int {
if (line < 0) return 0
if (line >= DiffUtil.getLineCount(this)) return textLength
return getLineEndOffset(line)
}
fun Document.getLineStartOffsetSafe(line: Int): Int {
private fun Document.getLineStartOffsetSafe(line: Int): Int {
if (line < 0) return 0
if (line >= DiffUtil.getLineCount(this)) return textLength

View File

@@ -15,7 +15,7 @@ abstract class FileEditorBase : UserDataHolderBase(), FileEditor, CheckedDisposa
override fun isDisposed(): Boolean = isDisposed
protected val propertyChangeSupport = PropertyChangeSupport(this)
private val propertyChangeSupport = PropertyChangeSupport(this)
override fun dispose() {
isDisposed = true

View File

@@ -25,19 +25,19 @@ class RunConfigurationOptionUsagesCollector: CounterUsagesCollector() {
"Dump_file_path", "Exe_path", "Program_arguments", "Working_directory", "Environment_variables", "Runtime_arguments", "Use_Mono_runtime", "Use_external_console", "Project", "Target_framework", "Launch_profile", "Open_browser", "Application_URL", "Launch_URL", "IIS_Express_Certificate", "Hosting_model", "Generate_applicationhost.config", "Show_IIS_Express_output", "Send_debug_request", "Additional_IIS_Express_arguments", "Static_method", "URL", "Session_name", "Arguments", "Solution_Configuration", "Executable_file", "Default_arguments", "Optional_arguments", "browser.option.after.launch", "browser.option.with.javascript.debugger", "browser.option.target.browser", "Use_Hot_Reload", // Rider
"external.system.vm.parameters.fragment", "Runtime"
)) // maven
val projectSettingsAvailableField = EventFields.Boolean("projectSettingsAvailable")
val useProjectSettingsField = EventFields.Boolean("useProjectSettings")
val modifyOption = GROUP.registerVarargEvent("modify.run.option", optionId, projectSettingsAvailableField, useProjectSettingsField, ID_FIELD, EventFields.InputEvent)
val navigateOption = GROUP.registerVarargEvent("option.navigate", optionId, ID_FIELD, EventFields.InputEvent)
val removeOption = GROUP.registerEvent("remove.run.option", optionId, ID_FIELD, EventFields.InputEvent)
val addNew = GROUP.registerEvent("add", ID_FIELD, EventFields.ActionPlace)
private val projectSettingsAvailableField = EventFields.Boolean("projectSettingsAvailable")
private val useProjectSettingsField = EventFields.Boolean("useProjectSettings")
private val modifyOption = GROUP.registerVarargEvent("modify.run.option", optionId, projectSettingsAvailableField, useProjectSettingsField, ID_FIELD, EventFields.InputEvent)
private val navigateOption = GROUP.registerVarargEvent("option.navigate", optionId, ID_FIELD, EventFields.InputEvent)
private val removeOption = GROUP.registerEvent("remove.run.option", optionId, ID_FIELD, EventFields.InputEvent)
private val addNew = GROUP.registerEvent("add", ID_FIELD, EventFields.ActionPlace)
val copy = GROUP.registerEvent("copy", ID_FIELD, EventFields.ActionPlace)
val remove = GROUP.registerEvent("remove", ID_FIELD, EventFields.ActionPlace)
val hintsShown = GROUP.registerEvent("hints.shown", ID_FIELD, EventFields.Int("hint_number"), EventFields.DurationMs)
private val hintsShown = GROUP.registerEvent("hints.shown", ID_FIELD, EventFields.Int("hint_number"), EventFields.DurationMs)
val addBeforeRunTask = GROUP.registerEvent("before.run.task.add", ID_FIELD, EventFields.Class("providerClass"))
val editBeforeRunTask = GROUP.registerEvent("before.run.task.edit", ID_FIELD, EventFields.Class("providerClass"))
val removeBeforeRunTask = GROUP.registerEvent("before.run.task.remove", ID_FIELD, EventFields.Class("providerClass"))
private val addBeforeRunTask = GROUP.registerEvent("before.run.task.add", ID_FIELD, EventFields.Class("providerClass"))
private val editBeforeRunTask = GROUP.registerEvent("before.run.task.edit", ID_FIELD, EventFields.Class("providerClass"))
private val removeBeforeRunTask = GROUP.registerEvent("before.run.task.remove", ID_FIELD, EventFields.Class("providerClass"))
@JvmStatic
fun logAddBeforeRunTask(project: Project?, configurationTypeId: String?, providerClass: Class<*>) {

View File

@@ -8,7 +8,7 @@ import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.Presentation
internal class RunToolbarAdditionAction(val executorGroup: ExecutorGroup<*>,
internal class RunToolbarAdditionAction(private val executorGroup: ExecutorGroup<*>,
val process: RunToolbarProcess, val selectedAction: () -> AnAction?) : AnAction() {
init {

View File

@@ -5,7 +5,7 @@ import com.intellij.execution.executors.ExecutorGroup
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
internal class RunToolbarAdditionActionsHolder(val executorGroup: ExecutorGroup<*>, val process: RunToolbarProcess) {
internal class RunToolbarAdditionActionsHolder(private val executorGroup: ExecutorGroup<*>, val process: RunToolbarProcess) {
companion object {
@JvmStatic
fun getAdditionActionId(process: RunToolbarProcess) = "${process.moreActionSubGroupName}_additionAction"

View File

@@ -7,7 +7,7 @@ import com.intellij.execution.executors.ExecutorGroup
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
internal class RunToolbarChooserAdditionGroup(val executorGroup: ExecutorGroup<*>, process: RunToolbarProcess,
internal class RunToolbarChooserAdditionGroup(private val executorGroup: ExecutorGroup<*>, process: RunToolbarProcess,
childConverter: (Executor) -> AnAction) : ExecutorGroupActionGroup(executorGroup,
childConverter) {
var myProcess: RunToolbarProcess? = null

View File

@@ -29,7 +29,7 @@ import javax.swing.SwingUtilities
class RunToolbarExtraSlotPane(val project: Project, val baseWidth: () -> Int?): RWActiveListener {
private val manager = RunToolbarSlotManager.getInstance(project)
val slotPane = JPanel(VerticalLayout(JBUI.scale(3))).apply {
private val slotPane = JPanel(VerticalLayout(JBUI.scale(3))).apply {
isOpaque = false
border = JBUI.Borders.empty()
}
@@ -72,7 +72,7 @@ class RunToolbarExtraSlotPane(val project: Project, val baseWidth: () -> Int?):
}
private var added = false
val newSlotDetails = object : JLabel(LangBundle.message("run.toolbar.add.slot.details")){
private val newSlotDetails = object : JLabel(LangBundle.message("run.toolbar.add.slot.details")){
override fun getFont(): Font {
return JBUI.Fonts.toolbarFont()
}

View File

@@ -510,7 +510,7 @@ class RunToolbarSlotManager(private val project: Project) {
return slotOrder.associateWith { slotsData[it]?.configuration }
}
fun getConfigurationMap(): Map<String, RunnerAndConfigurationSettings?> {
private fun getConfigurationMap(): Map<String, RunnerAndConfigurationSettings?> {
return getConfigurationMap(getSlotOrder())
}

View File

@@ -68,7 +68,7 @@ abstract class TargetEnvironmentWizardStepKt(@NlsContexts.DialogTitle title: Str
return result
}
protected fun createTopPanel(): JComponent {
private fun createTopPanel(): JComponent {
return JPanel(HorizontalLayout(ICON_GAP)).also {
val insets = TargetEnvironmentWizard.defaultDialogInsets()
it.border = JBUI.Borders.merge(JBUI.Borders.emptyTop(LARGE_VGAP),

View File

@@ -37,7 +37,7 @@ class JavaTargetParameter private constructor(
}
class Builder(
val targetPaths: TargetPaths
private val targetPaths: TargetPaths
) {
constructor(uploadPaths: Set<String> = setOf(),

View File

@@ -8,7 +8,7 @@ data class BuildScriptEntryMetadata constructor(
val rawText: String
) {
val linesCount: Int = endLine - startLine + 1
private val linesCount: Int = endLine - startLine + 1
init {
require(startLine >= 1) { "The startLine value is 1-based, and must be [1, +inf), but was $startLine" }

View File

@@ -124,7 +124,7 @@ abstract class MavenizedNewProjectWizardStep<Data : Any, ParentStep>(val parentS
return parent.version
}
protected fun suggestPathByParent(): String {
private fun suggestPathByParent(): String {
return if (parent.isPresent) parent.location else context.projectFileDirectory
}

View File

@@ -225,7 +225,7 @@ abstract class MavenizedStructureWizardStep<Data : Any>(val context: WizardConte
}
protected open fun ValidationInfoBuilder.validateVersion() = superValidateVersion()
protected fun ValidationInfoBuilder.superValidateVersion(): ValidationInfo? {
private fun ValidationInfoBuilder.superValidateVersion(): ValidationInfo? {
if (version.isEmpty()) {
val propertyPresentation = ExternalSystemBundle.message("external.system.mavenized.structure.wizard.version.presentation")
val message = ExternalSystemBundle.message("external.system.mavenized.structure.wizard.missing.error",
@@ -253,7 +253,7 @@ abstract class MavenizedStructureWizardStep<Data : Any>(val context: WizardConte
}
protected open fun ValidationInfoBuilder.validateLocation() = superValidateLocation()
protected fun ValidationInfoBuilder.superValidateLocation(): ValidationInfo? {
private fun ValidationInfoBuilder.superValidateLocation(): ValidationInfo? {
val location = location
if (location.isEmpty()) {
val propertyPresentation = ExternalSystemBundle.message("external.system.mavenized.structure.wizard.location.presentation")

View File

@@ -42,7 +42,7 @@ class CommandLineDialog(
}
}
fun clearSelectionWhenSelected(tableToUpdate: JTable, tableToListen: JTable) {
private fun clearSelectionWhenSelected(tableToUpdate: JTable, tableToListen: JTable) {
tableToListen.selectionModel.addListSelectionListener {
selectRecursionGuard.doPreventingRecursion(this, false) {
tableToUpdate.clearSelection()

View File

@@ -21,7 +21,7 @@ open class TextCompletionComboBox<T>(
val collectionModel = CollectionComboBoxModel<T>()
val selectedItemProperty = AtomicProperty(converter.getItem(""))
private val selectedItemProperty = AtomicProperty(converter.getItem(""))
var selectedItem by selectedItemProperty
override fun getCompletionVariants(): List<T> {

View File

@@ -36,22 +36,22 @@ class ExternalSystemSyncActionsCollector : CounterUsagesCollector() {
companion object {
val GROUP = EventLogGroup("build.gradle.import", 5)
val activityIdField = EventFields.Long("ide_activity_id")
val importPhaseField = EventFields.Enum<Phase>("phase")
private val activityIdField = EventFields.Long("ide_activity_id")
private val importPhaseField = EventFields.Enum<Phase>("phase")
val syncStartedEvent = GROUP.registerEvent("gradle.sync.started", activityIdField)
val syncFinishedEvent = GROUP.registerEvent("gradle.sync.finished", activityIdField, Boolean("sync_successful"))
val phaseStartedEvent = GROUP.registerEvent("phase.started", activityIdField, importPhaseField)
private val phaseStartedEvent = GROUP.registerEvent("phase.started", activityIdField, importPhaseField)
val phaseFinishedEvent = GROUP.registerVarargEvent("phase.finished",
activityIdField,
importPhaseField,
DurationMs,
Int("error_count"))
val errorField = StringValidatedByCustomRule("error", ClassNameRuleValidator::class.java)
val severityField = EventFields.String("severity", listOf("fatal", "warning"))
val errorHashField = Int("error_hash")
val tooManyErrorsField = Boolean("too_many_errors")
private val errorField = StringValidatedByCustomRule("error", ClassNameRuleValidator::class.java)
private val severityField = EventFields.String("severity", listOf("fatal", "warning"))
private val errorHashField = Int("error_hash")
private val tooManyErrorsField = Boolean("too_many_errors")
private val errorEvent = GROUP.registerVarargEvent("error",
activityIdField,

View File

@@ -42,8 +42,8 @@ open class SpinningProgressIcon: AnimatedIcon() {
private var iconColor: Color = JBColor.namedColor("ProgressIcon.color", JBColor(0x767A8A, 0xCED0D6))
fun getCacheKey() = ColorUtil.toHex(iconColor)
val iconCache = arrayOfNulls<Icon>(paths.size)
var iconCacheKey = ""
private val iconCache = arrayOfNulls<Icon>(paths.size)
private var iconCacheKey = ""
override fun createFrames() = Array(paths.size) { createFrame(it) }
fun setIconColor(color: Color) {

View File

@@ -90,6 +90,8 @@ class CodeVisionSettings : PersistentStateComponent<CodeVisionSettings.State> {
listener.providerAvailabilityChanged(id, isEnabled)
}
// used externally
@Suppress("MemberVisibilityCanBePrivate")
fun getAnchorLimit(position: CodeVisionAnchorKind): Int {
return when (position) {
CodeVisionAnchorKind.Top -> visibleMetricsAboveDeclarationCount
@@ -99,6 +101,8 @@ class CodeVisionSettings : PersistentStateComponent<CodeVisionSettings.State> {
}
}
// used externally
@Suppress("MemberVisibilityCanBePrivate")
fun setAnchorLimit(defaultPosition: CodeVisionAnchorKind, i: Int) {
when (defaultPosition) {
CodeVisionAnchorKind.Top -> visibleMetricsAboveDeclarationCount = i

View File

@@ -179,7 +179,7 @@ class PartiallyKnownString(val segments: List<StringEntry>) {
*
* NOTE: currently supports only single-segment [rangeInPks]
*/
fun mapRangeToHostRange(host: PsiElement, rangeInHost: TextRange, rangeInPks: TextRange): TextRange? {
private fun mapRangeToHostRange(host: PsiElement, rangeInHost: TextRange, rangeInPks: TextRange): TextRange? {
fun getHostRangeEscapeAware(segmentRange: TextRange, inSegmentStart: Int, inSegmentEnd: Int): TextRange {
if (host is PsiLanguageInjectionHost) {

View File

@@ -133,7 +133,7 @@ abstract class SuggestedRefactoringStateChanges(protected val refactoringSupport
return Signature.create(signature.name, signature.type, newParameters, signature.additionalData)!!
}
protected fun guessParameterIdByName(parameter: SuggestedRefactoringSupport.Parameter, prevState: SuggestedRefactoringState): Any? {
private fun guessParameterIdByName(parameter: SuggestedRefactoringSupport.Parameter, prevState: SuggestedRefactoringState): Any? {
prevState.newSignature.parameterByName(parameter.name)
?.let { return it.id }

View File

@@ -20,8 +20,8 @@ class BuildViewProblemsService(override val project: Project) : ProblemsProvider
workingDirToBuildId.clear()
}
val workingDirToBuildId: MutableMap<String, Any> = mutableMapOf()
val buildIdToFileProblems: MutableMap<Any, MutableSet<FileBuildProblem>> = mutableMapOf()
private val workingDirToBuildId: MutableMap<String, Any> = mutableMapOf()
private val buildIdToFileProblems: MutableMap<Any, MutableSet<FileBuildProblem>> = mutableMapOf()
fun listenToBuildView(buildProgressObservable: BuildProgressObservable) {
val collector = project.service<ProblemsCollector>()

View File

@@ -125,7 +125,7 @@ internal class ReaderModeConfigurable(private val project: Project) : BoundSearc
project.messageBus.syncPublisher(ReaderModeSettingsListener.TOPIC).modeChanged(project)
}
fun goToGlobalSettings(configurableID: String) {
private fun goToGlobalSettings(configurableID: String) {
DataManager.getInstance().dataContextFromFocusAsync.onSuccess { context ->
context?.let { dataContext ->
Settings.KEY.getData(dataContext)?.let { settings ->

View File

@@ -34,7 +34,6 @@ import com.intellij.openapi.progress.util.ProgressIndicatorUtils
import com.intellij.openapi.project.Project
import com.intellij.openapi.rd.createLifetime
import com.intellij.openapi.rd.createNestedDisposable
import com.intellij.openapi.roots.ProjectRootManager
import com.intellij.openapi.roots.impl.DirectoryIndex
import com.intellij.openapi.util.Key
import com.intellij.openapi.util.TextRange
@@ -82,7 +81,9 @@ open class CodeVisionHost(val project: Project) {
}
}
protected val codeVisionLifetime: Lifetime = project.createLifetime()
// used externally
@Suppress("MemberVisibilityCanBePrivate")
val codeVisionLifetime: Lifetime = project.createLifetime()
/**
* Pass empty list to update ALL providers in editor
@@ -273,8 +274,9 @@ open class CodeVisionHost(val project: Project) {
logger.trace { "No provider found with id ${entry.providerId}" }
}
protected fun CodeVisionAnchorKind?.nullIfDefault(): CodeVisionAnchorKind? = if (this === CodeVisionAnchorKind.Default) null else this
// used externally
@Suppress("MemberVisibilityCanBePrivate")
fun CodeVisionAnchorKind?.nullIfDefault(): CodeVisionAnchorKind? = if (this === CodeVisionAnchorKind.Default) null else this
open fun getAnchorForEntry(entry: CodeVisionEntry): CodeVisionAnchorKind {
val provider = getProviderById(entry.providerId) ?: return lifeSettingModel.defaultPosition.value

View File

@@ -15,7 +15,6 @@ import com.intellij.openapi.util.TextRange
import com.intellij.util.application
import com.jetbrains.rd.util.first
import com.jetbrains.rd.util.lifetime.SequentialLifetimes
import com.jetbrains.rd.util.lifetime.onTermination
import java.awt.event.MouseEvent
val editorLensContextKey: Key<EditorCodeVisionContext> = Key<EditorCodeVisionContext>("EditorCodeLensContext")
@@ -81,8 +80,9 @@ open class EditorCodeVisionContext(
hasPendingLenses = false
}
protected fun resubmitThings() {
// used externally
@Suppress("MemberVisibilityCanBePrivate")
fun resubmitThings() {
val viewService = ServiceManager.getService(
editor.project!!,
CodeVisionView::class.java

View File

@@ -180,7 +180,7 @@ class CodeVisionView(val project: Project) {
updateSubscription()
}
var subscriptionDef: LifetimeDefinition? = null
private var subscriptionDef: LifetimeDefinition? = null
fun setPerAnchorLimits(limits: Map<CodeVisionAnchorKind, Int>) {
limits.forEach { _ -> projectModel.maxVisibleLensCount.putAll(limits) }

View File

@@ -16,7 +16,7 @@ class CodeVisionListData(
val projectModel: ProjectCodeVisionModel,
val rangeCodeVisionModel: RangeCodeVisionModel,
val inlay: Inlay<*>,
val anchoredLens: List<CodeVisionEntry>,
private val anchoredLens: List<CodeVisionEntry>,
val anchor: CodeVisionAnchorKind
) {
companion object {

View File

@@ -14,7 +14,7 @@ class RangeCodeVisionModel(
val project: Project,
val editor: Editor,
lensMap: Map<CodeVisionAnchorKind, List<CodeVisionEntry>>,
val anchoringRange: TextRange,
private val anchoringRange: TextRange,
@NlsSafe
val name: String = "Code Vision"
) {
@@ -45,7 +45,7 @@ class RangeCodeVisionModel(
projectModel.handleLensExtraAction(editor, anchoringRange, selectedValue, actionId)
}
fun sortedLenses(): List<CodeVisionEntry> {
private fun sortedLenses(): List<CodeVisionEntry> {
return lensForRange.sortedBy { projectModel.getLensIndex(it) }
}

View File

@@ -22,8 +22,8 @@ class CodeVisionPopupWrapper(
val mainLTD: LifetimeDefinition,
val editor: Editor,
val popupFactory: (Lifetime) -> AbstractPopup,
val popupLayouter: DockingLayouter,
val lensPopupActive: IProperty<Boolean>
private val popupLayouter: DockingLayouter,
private val lensPopupActive: IProperty<Boolean>
) {
private val logger = getLogger<CodeVisionPopupWrapper>()

View File

@@ -39,7 +39,7 @@ class EditorAnchoringRect(
it.horizontalSmartClip(visibleArea)
}
fun smartClipDelegate(editor: Editor): (Rectangle) -> Rectangle? = {
private fun smartClipDelegate(editor: Editor): (Rectangle) -> Rectangle? = {
val visibleArea = editor.scrollingModel.visibleArea
it.smartClip(visibleArea)
}

View File

@@ -20,7 +20,7 @@ class CodeVisionListPainter(
val theme: CodeVisionTheme = theme ?: CodeVisionTheme()
var loadingPainter: CodeVisionStringPainter = CodeVisionStringPainter("Loading...")
private var loadingPainter: CodeVisionStringPainter = CodeVisionStringPainter("Loading...")
private fun getRelativeBounds(
editor: Editor,

View File

@@ -9,7 +9,7 @@ import java.awt.Point
import javax.swing.Icon
import kotlin.math.roundToInt
class CodeVisionScaledIconPainter(val yShiftIconMultiplier: Double = 0.865, val scaleMultiplier: Double = 0.8) : ICodeVisionPainter {
class CodeVisionScaledIconPainter(private val yShiftIconMultiplier: Double = 0.865, private val scaleMultiplier: Double = 0.8) : ICodeVisionPainter {
fun paint(editor: Editor, g: Graphics, icon: Icon, point: Point, scaleFactor: Float) {
val scaledIcon = IconUtil.scale(icon, editor.component, scaleFactor)

View File

@@ -16,7 +16,7 @@ import kotlin.math.log10
import kotlin.math.pow
class DaemonFusReporter(private val project: Project) : DaemonCodeAnalyzer.DaemonListener {
var daemonStartTime = -1L
private var daemonStartTime = -1L
override fun daemonStarting(fileEditors: Collection<FileEditor>) {
daemonStartTime = System.currentTimeMillis()

View File

@@ -25,12 +25,12 @@ class InlayTextMetricsStorage(val editor: EditorImpl) {
private var smallTextMetrics : InlayTextMetrics? = null
private var normalTextMetrics : InlayTextMetrics? = null
val smallTextSize: Float
private val smallTextSize: Float
@RequiresEdt
get() = max(1f, editor.colorsScheme.editorFontSize2D - 1f)
val normalTextSize: Float
private val normalTextSize: Float
@RequiresEdt
get() = editor.colorsScheme.editorFontSize2D

View File

@@ -24,7 +24,7 @@ class VerticalListInlayPresentation(
override var height: Int = 0
private set
var presentationUnderCursor: InlayPresentation? = null
private var presentationUnderCursor: InlayPresentation? = null
init {
calcDimensions()

View File

@@ -14,7 +14,7 @@ import kotlin.math.abs
internal class IncorrectFormattingInspectionHelper(
val formattingChanges: FormattingChanges,
private val formattingChanges: FormattingChanges,
val file: PsiFile,
val document: Document,
val manager: InspectionManager,

View File

@@ -82,7 +82,7 @@ class JComboboxAction(val project: Project, val onChanged: () -> Unit) : AnActio
ActionToolbar.NAVBAR_MINIMUM_BUTTON_SIZE.height + insets.top + insets.bottom - JBUI.scale(
1))
fun getNormalizedText(): String? {
private fun getNormalizedText(): String? {
val editorField = editor.editorComponent as JTextField
return if (editorField.text == emptyText || editorField.text.isBlank()) null else editorField.text
}

View File

@@ -10,12 +10,12 @@ import java.nio.charset.Charset
private val LOG = Logger.getInstance(CodeStyleProcessorBuilder::class.java)
class CodeStyleProcessorBuilder(val messageOutput: MessageOutput) {
var isDryRun = false
class CodeStyleProcessorBuilder(private val messageOutput: MessageOutput) {
private var isDryRun = false
var isRecursive = false
var primaryCodeStyle: CodeStyleSettings? = null
var defaultCodeStyle: CodeStyleSettings? = null
var fileMasks = emptyList<Regex>()
private var primaryCodeStyle: CodeStyleSettings? = null
private var defaultCodeStyle: CodeStyleSettings? = null
private var fileMasks = emptyList<Regex>()
val entries = arrayListOf<File>()
var charset: Charset? = null

View File

@@ -181,7 +181,7 @@ abstract class FileSetCodeStyleProcessor(
messageOutput: MessageOutput,
isRecursive: Boolean,
charset: Charset? = null,
val primaryCodeStyle: CodeStyleSettings? = null,
private val primaryCodeStyle: CodeStyleSettings? = null,
val defaultCodeStyle: CodeStyleSettings? = null
) : FileSetProcessor(messageOutput, isRecursive, charset), Closeable {

View File

@@ -18,7 +18,7 @@ package com.intellij.formatting.commandLine
import java.io.PrintWriter
open class MessageOutput(val infoOut: PrintWriter, val errorOut: PrintWriter) {
open class MessageOutput(private val infoOut: PrintWriter, private val errorOut: PrintWriter) {
fun info(message: String) = infoOut.printAndFlush(message)

View File

@@ -22,7 +22,7 @@ class VisualFormattingLayerHighlightingPass(editor: Editor, file: PsiFile) : Edi
val service: VisualFormattingLayerService by lazy { VisualFormattingLayerService.getInstance() }
var myVisualFormattingLayerElements: List<VisualFormattingLayerElement>? = null
private var myVisualFormattingLayerElements: List<VisualFormattingLayerElement>? = null
override fun doCollectInformation(progress: ProgressIndicator) {
//progress.start()

View File

@@ -5,7 +5,7 @@ import com.intellij.pom.Navigatable
import com.intellij.pom.NavigatableWithText
import com.intellij.util.containers.map2Array
class NavigatableInterceptor(val baseNavigatable: Navigatable, val callback: (Navigatable, Boolean) -> Unit) : NavigatableWithText {
class NavigatableInterceptor(private val baseNavigatable: Navigatable, val callback: (Navigatable, Boolean) -> Unit) : NavigatableWithText {
override fun navigate(requestFocus: Boolean) {
callback(baseNavigatable, requestFocus)
baseNavigatable.navigate(requestFocus)

View File

@@ -245,7 +245,7 @@ class LineBookmarkProvider(private val project: Project) : BookmarkProvider, Edi
fun readLineText(bookmark: LineBookmark?) = bookmark?.let { readLineText(it.file, it.line) }
fun readLineText(file: VirtualFile, line: Int): String? {
private fun readLineText(file: VirtualFile, line: Int): String? {
val document = FileDocumentManager.getInstance().getDocument(file) ?: return null
if (line < 0 || document.lineCount <= line) return null
val start = document.getLineStartOffset(line)

View File

@@ -24,7 +24,7 @@ abstract class BookmarkNode<B : Bookmark>(project: Project, bookmark: B)
val bookmarksView
get() = parentRootNode?.value
val bookmarkType
private val bookmarkType
get() = bookmarksManager?.getType(value)
val bookmarkDescription

View File

@@ -93,7 +93,7 @@ abstract class StructureAwareNavBarModelExtension : AbstractNavBarModelExtension
return null
}
protected fun buildStructureViewModel(file: PsiFile, editor: Editor? = null): StructureViewModel? {
private fun buildStructureViewModel(file: PsiFile, editor: Editor? = null): StructureViewModel? {
if (currentFile?.get() == file && currentFileModCount == file.modificationStamp) {
if (editor == null) {
currentFileStructure?.get()?.let { return it }

View File

@@ -34,7 +34,7 @@ class JdkVersionItem(
/* we should prefer the default selected item from the JDKs.json feed,
* the list below is sorted by vendor, and default item is not necessarily first
*/
val defaultSelectedItem: JdkVersionVendorItem,
private val defaultSelectedItem: JdkVersionVendorItem,
val includedItems: List<JdkVersionVendorItem>,
val excludedItems: List<JdkVersionVendorItem>
) {
@@ -224,7 +224,7 @@ internal class JdkDownloadDialog(
val project: Project?,
val parentComponent: Component?,
val sdkType: SdkTypeId,
val mergedModel: JdkDownloaderMergedModel,
private val mergedModel: JdkDownloaderMergedModel,
) : DialogWrapper(project, parentComponent, false, IdeModalityType.PROJECT) {
private val panel: JComponent
private val versionComboBox : ComboBox<JdkVersionItem>

View File

@@ -115,7 +115,7 @@ class JdkInstaller : JdkInstallerBase() {
return defaultInstallDir()
}
fun defaultInstallDir(wslDistribution: WSLDistribution?) : Path {
private fun defaultInstallDir(wslDistribution: WSLDistribution?) : Path {
wslDistribution?.let { dist ->
dist.userHome?.let { home ->
return Paths.get(dist.getWindowsPath("$home/.jdks"))
@@ -373,7 +373,7 @@ abstract class JdkInstallerBase {
}
}
fun findJdkItemForInstalledJdk(jdkPath: Path?): JdkItem? {
private fun findJdkItemForInstalledJdk(jdkPath: Path?): JdkItem? {
try {
if (jdkPath == null) return null
if (!jdkPath.isDirectory()) return null
@@ -524,7 +524,7 @@ class JdkInstallerStateEntry : BaseState() {
var url by string()
var sha256 by string()
var installDir by string()
var javaHomeDir by string()
private var javaHomeDir by string()
fun copyForm(item: JdkItem, targetPath: Path) {
fullText = item.fullPresentationText

View File

@@ -130,7 +130,7 @@ data class JdkItem(
return installDir.resolve(packageToBinJavaPrefix)
}
val vendorPrefix
private val vendorPrefix
get() = suggestedSdkName.split("-").dropLast(1).joinToString("-")
fun matchesVendor(predicate: String) : Boolean {

View File

@@ -34,7 +34,7 @@ class DistributionComboBox(
var noDistributionText: String = ProjectBundle.message("sdk.missing.item")
var specifyLocationActionName: String = ProjectBundle.message("sdk.specify.location")
var defaultDistributionLocation: String? = null
private var defaultDistributionLocation: String? = null
private val collectionModel: CollectionComboBoxModel<Item>
get() = model as CollectionComboBoxModel

View File

@@ -205,9 +205,9 @@ open class CommonInjectedFileChangesHandler(
protected fun failAndReport(@NonNls message: String, e: DocumentEvent? = null, exception: Exception? = null): Nothing =
throw getReportException(message, e, exception)
protected fun getReportException(@NonNls message: String,
e: DocumentEvent?,
exception: Exception?): RuntimeExceptionWithAttachments =
private fun getReportException(@NonNls message: String,
e: DocumentEvent?,
exception: Exception?): RuntimeExceptionWithAttachments =
RuntimeExceptionWithAttachments("${this.javaClass.simpleName}: $message (event = $e)," +
" myInjectedFile.isValid = ${myInjectedFile.isValid}, isValid = $isValid",
*listOfNotNull(
@@ -221,7 +221,7 @@ open class CommonInjectedFileChangesHandler(
protected fun String.esclbr(): String = StringUtil.escapeLineBreak(this)
protected val RangeMarker.debugText: String
private val RangeMarker.debugText: String
get() = "$range'${
try {
document.getText(range)
@@ -240,9 +240,9 @@ open class CommonInjectedFileChangesHandler(
return "${hostMarker.debugText}\t<-\t${fragmentMarker.debugText}"
}
protected fun Iterable<MarkersMapping>.logMarkersRanges(): String = joinToString("\n", transform = ::markerString)
private fun Iterable<MarkersMapping>.logMarkersRanges(): String = joinToString("\n", transform = ::markerString)
protected fun String.substringVerbose(start: Int, cursor: Int): String = try {
private fun String.substringVerbose(start: Int, cursor: Int): String = try {
substring(start, cursor)
}
catch (e: StringIndexOutOfBoundsException) {

View File

@@ -73,7 +73,7 @@ class DeferredIconRepaintScheduler {
val x: Int,
val y: Int,
val target: Component?,
val paintingParent: Component?,
private val paintingParent: Component?,
val paintingParentRec: Rectangle?
) {
fun getActualTarget(): Component? {

View File

@@ -14,9 +14,9 @@ import com.intellij.util.indexing.SubstitutedFileType
object IndexedFilePaths {
const val TOO_LARGE_FILE = "<TOO LARGE>"
private const val TOO_LARGE_FILE = "<TOO LARGE>"
const val FAILED_TO_LOAD = "<FAILED TO LOAD: %s>"
private const val FAILED_TO_LOAD = "<FAILED TO LOAD: %s>"
fun createIndexedFilePath(fileOrDir: VirtualFile, project: Project): IndexedFilePath {
val fileId = FileBasedIndex.getFileId(fileOrDir)

View File

@@ -202,7 +202,7 @@ class IntLog @Throws(IOException::class) constructor(private val baseStorageFile
return dataFile.resolveSibling(dataFile.fileName.toString() + ".require.compaction")
}
fun getDataFile(): Path {
private fun getDataFile(): Path {
return baseStorageFile.resolveSibling(baseStorageFile.fileName.toString() + ".project")
}

View File

@@ -29,7 +29,7 @@ class NonProportionalOnePixelSplitter(
private val minSize get() = if (orientation) minimumSize.height else minimumSize.width
// hack
var maxRetryCount = 100
private var maxRetryCount = 100
private var addNotifyTimestamp: Long = 0

View File

@@ -25,7 +25,7 @@ class PersistentThreeComponentSplitter(
}
// hack
var maxRetryCount = 100
private var maxRetryCount = 100
@NonNls private val firstProportionKey = "${proportionKey}_PTCS_FirstProportionKey"
@NonNls private val lastProportionKey = "${proportionKey}_PTCS_LastProportionKey"

View File

@@ -56,7 +56,7 @@ fun JBCefBrowser.executeJavaScriptAsync(@Language("JavaScript") javaScriptExpres
*
* @see [executeJavaScriptAsync]
*/
class JBCefBrowserJsCall(val javaScriptExpression: JsExpression, val browser: JBCefBrowser) {
class JBCefBrowserJsCall(private val javaScriptExpression: JsExpression, val browser: JBCefBrowser) {
// TODO: Ensure the related JBCefClient has a sufficient number of slots in the pool

View File

@@ -106,7 +106,7 @@ class EditorTabTheme : TabTheme {
override val inactiveColoredTabBackground: Color
get() = JBUI.CurrentTheme.EditorTabs.inactiveColoredFileBackground()
fun <T> newUIAware(newUI: T, oldUI:T):T = if (ExperimentalUI.isNewUI()) newUI else oldUI
private fun <T> newUIAware(newUI: T, oldUI:T):T = if (ExperimentalUI.isNewUI()) newUI else oldUI
}
internal class ToolWindowTabTheme : DefaultTabTheme() {

View File

@@ -40,7 +40,7 @@ interface EditorCodePreview: Disposable {
return codePreview
}
fun getActivePreview(editor: Editor): EditorCodePreview? {
private fun getActivePreview(editor: Editor): EditorCodePreview? {
return editor.getUserData(EDITOR_PREVIEW_KEY)
}
}

View File

@@ -31,7 +31,7 @@ import java.util.*
internal class GCRootPathsTree(
val analysisContext: AnalysisContext,
val treeDisplayOptions: AnalysisConfig.TreeDisplayOptions,
private val treeDisplayOptions: AnalysisConfig.TreeDisplayOptions,
allObjectsOfClass: ClassDefinition?
) {
private val topNode = RootNode(analysisContext.classStore)

View File

@@ -70,7 +70,7 @@ class HProfAnalysis(private val hprofFileChannel: FileChannel,
return tempChannel
}
val fileBackedListProvider = object: ListProvider {
private val fileBackedListProvider = object: ListProvider {
override fun createUByteList(name: String, size: Long) = FileBackedUByteList.createEmpty(openTempEmptyFileChannel(name), size)
override fun createUShortList(name: String, size: Long) = FileBackedUShortList.createEmpty(openTempEmptyFileChannel(name), size)
override fun createIntList(name: String, size: Long) = FileBackedIntList.createEmpty(openTempEmptyFileChannel(name), size)

View File

@@ -42,7 +42,7 @@ open class HProfVisitor {
return myHeapDumpVisits[type.value]
}
fun enableAll() {
private fun enableAll() {
for (recordType in RecordType.values()) {
myTopLevelVisits[recordType.value] = true
}

View File

@@ -22,7 +22,7 @@ object HeapReportUtils {
private val SI_PREFIXES = charArrayOf('K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y') // Kilo, Mega, Giga, Peta, etc.
const val STRING_PADDING_FOR_COUNT = 5
const val STRING_PADDING_FOR_SIZE = STRING_PADDING_FOR_COUNT + 1
const val SECTION_HEADER_SIZE = 50
private const val SECTION_HEADER_SIZE = 50
fun toShortStringAsCount(count: Long): String {
return toShortString(count)

View File

@@ -17,7 +17,7 @@ val visualFormattingElementKey = Key.create<Boolean>("visual.formatting.element"
abstract class VisualFormattingLayerService {
private val EDITOR_VISUAL_FORMATTING_LAYER_CODE_STYLE_SETTINGS = Key.create<CodeStyleSettings>("visual.formatting.layer.info")
val Editor.visualFormattingLayerEnabled: Boolean
private val Editor.visualFormattingLayerEnabled: Boolean
get() = visualFormattingLayerCodeStyleSettings != null
var Editor.visualFormattingLayerCodeStyleSettings: CodeStyleSettings?
get() = getUserData(EDITOR_VISUAL_FORMATTING_LAYER_CODE_STYLE_SETTINGS)

View File

@@ -12,8 +12,8 @@ import kotlin.math.sqrt
* @author Konstantin Bulenkov
*/
class UIMouseTracker : IdeEventQueue.EventDispatcher {
var mouseCoordinates = MouseInfo.getPointerInfo().location ?: Point(0,0)
var totalMouseTrack = 0f
private var mouseCoordinates = MouseInfo.getPointerInfo().location ?: Point(0, 0)
private var totalMouseTrack = 0f
override fun dispatch(e: AWTEvent): Boolean {
if (e is MouseEvent) {

View File

@@ -25,7 +25,7 @@ import com.intellij.util.ui.UIUtil
import java.awt.Component
class MaximizeEditorInSplitAction : DumbAwareAction() {
val myActiveAnimators = SmartList<JBAnimator>()
private val myActiveAnimators = SmartList<JBAnimator>()
init {
templatePresentation.text = IdeBundle.message("action.maximize.editor") + "/" +IdeBundle.message("action.normalize.splits")
}

View File

@@ -50,7 +50,7 @@ internal abstract class BaseSwitcherAction(val forward: Boolean?) : DumbAwareAct
internal class ShowRecentFilesAction : LightEditCompatible, BaseRecentFilesAction(false)
internal class ShowRecentlyEditedFilesAction : BaseRecentFilesAction(true)
internal abstract class BaseRecentFilesAction(val onlyEditedFiles: Boolean) : DumbAwareAction() {
internal abstract class BaseRecentFilesAction(private val onlyEditedFiles: Boolean) : DumbAwareAction() {
override fun update(event: AnActionEvent) {
event.presentation.isEnabledAndVisible = event.project != null
}
@@ -191,7 +191,7 @@ internal class SwitcherKeyReleaseListener(event: InputEvent?, val consumer: Cons
private val wasMetaDown = true == event?.isMetaDown
val isEnabled = wasAltDown || wasAltGraphDown || wasControlDown || wasMetaDown
val initialModifiers = if (!isEnabled) null
private val initialModifiers = if (!isEnabled) null
else StringBuilder().apply {
if (wasAltDown) append("alt ")
if (wasAltGraphDown) append("altGraph ")

View File

@@ -10,9 +10,9 @@ import java.util.*
import java.util.stream.Collectors
class TransferSettingsDataProvider(private val providers: List<TransferSettingsProvider>) {
val baseIdeVersions = mutableListOf<BaseIdeVersion>()
val ideVersions = mutableListOf<IdeVersion>()
val failedIdeVersions = mutableListOf<FailedIdeVersion>()
private val baseIdeVersions = mutableListOf<BaseIdeVersion>()
private val ideVersions = mutableListOf<IdeVersion>()
private val failedIdeVersions = mutableListOf<FailedIdeVersion>()
val orderedIdeVersions get() = ideVersions + failedIdeVersions

View File

@@ -66,7 +66,7 @@ class SimpleActionDescriptor(
val defaultShortcut: Any // KeyboardShortcut or DummyKeyboardShortcut
) {
companion object {
fun fromKeymap(keymap: Keymap, actionIds: List<String>): List<SimpleActionDescriptor> {
private fun fromKeymap(keymap: Keymap, actionIds: List<String>): List<SimpleActionDescriptor> {
return actionIds.map {
SimpleActionDescriptor(
it,

Some files were not shown because too many files have changed in this diff Show More