mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-04 23:39:07 +07:00
create only required app starter
GitOrigin-RevId: 93315895b254dffbcd33fc22a5201d187d9c1def
This commit is contained in:
committed by
intellij-monorepo-bot
parent
bf1ece6d91
commit
f26faf545d
@@ -1,4 +1,4 @@
|
||||
// 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.
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.diff.applications;
|
||||
|
||||
import com.intellij.diff.DiffDialogHints;
|
||||
@@ -32,7 +32,12 @@ import java.util.concurrent.Future;
|
||||
|
||||
final class DiffApplication extends DiffApplicationBase {
|
||||
DiffApplication() {
|
||||
super("diff", 2, 3);
|
||||
super(2, 3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return "diff";
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.diff.applications;
|
||||
|
||||
import com.intellij.openapi.application.ApplicationStarterBase;
|
||||
@@ -31,7 +17,6 @@ import com.intellij.openapi.wm.IdeFrame;
|
||||
import com.intellij.openapi.wm.ex.WindowManagerEx;
|
||||
import com.intellij.testFramework.LightVirtualFile;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -48,8 +33,8 @@ public abstract class DiffApplicationBase extends ApplicationStarterBase {
|
||||
|
||||
protected static final Logger LOG = Logger.getInstance(DiffApplicationBase.class);
|
||||
|
||||
protected DiffApplicationBase(@NotNull @NonNls String commandName, int... possibleArgumentsCount) {
|
||||
super(commandName, possibleArgumentsCount);
|
||||
protected DiffApplicationBase(int... possibleArgumentsCount) {
|
||||
super(possibleArgumentsCount);
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// 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.
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.diff.applications;
|
||||
|
||||
import com.intellij.diff.DiffDialogHints;
|
||||
@@ -32,9 +32,14 @@ import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
class MergeApplication extends DiffApplicationBase {
|
||||
final class MergeApplication extends DiffApplicationBase {
|
||||
MergeApplication() {
|
||||
super("merge", 3, 4);
|
||||
super(3, 4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return "merge";
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.openapi.extensions.impl;
|
||||
|
||||
import com.intellij.diagnostic.ActivityCategory;
|
||||
@@ -325,10 +325,10 @@ public abstract class ExtensionPointImpl<@NotNull T> implements ExtensionPoint<T
|
||||
}
|
||||
|
||||
// null id means that instance was created and extension element cleared
|
||||
public final void processIdentifiableImplementations(@NotNull BiConsumer<? super @NotNull Supplier<@Nullable T>, ? super @Nullable String> consumer) {
|
||||
public final void processIdentifiableImplementations(@NotNull BiConsumer<@NotNull Supplier<@Nullable T>, @Nullable String> consumer) {
|
||||
// do not use getThreadSafeAdapterList - no need to check that no listeners, because processImplementations is not a generic-purpose method
|
||||
for (ExtensionComponentAdapter adapter : getSortedAdapters()) {
|
||||
consumer.accept((Supplier<T>)() -> adapter.createInstance(componentManager), adapter.getOrderId());
|
||||
consumer.accept(() -> adapter.createInstance(componentManager), adapter.getOrderId());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -396,7 +396,7 @@ public abstract class ExtensionPointImpl<@NotNull T> implements ExtensionPoint<T
|
||||
return cache == null ? adapters.size() : cache.size();
|
||||
}
|
||||
|
||||
private @NotNull List<ExtensionComponentAdapter> getSortedAdapters() {
|
||||
public final @NotNull List<ExtensionComponentAdapter> getSortedAdapters() {
|
||||
if (adaptersAreSorted) {
|
||||
return adapters;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.formatting.commandLine
|
||||
|
||||
import com.intellij.formatting.commandLine.CodeStyleProcessorBuildException.ArgumentsException
|
||||
@@ -17,20 +17,15 @@ import java.io.IOException
|
||||
import java.nio.charset.Charset
|
||||
import kotlin.system.exitProcess
|
||||
|
||||
|
||||
const val FORMAT_COMMAND_NAME = "format"
|
||||
|
||||
private val LOG = Logger.getInstance(FormatterStarter::class.java)
|
||||
|
||||
|
||||
/**
|
||||
* A launcher class for command-line formatter.
|
||||
*/
|
||||
class FormatterStarter : ApplicationStarter {
|
||||
|
||||
internal class FormatterStarter : ApplicationStarter {
|
||||
val messageOutput = StdIoMessageOutput
|
||||
|
||||
override fun getCommandName() = FORMAT_COMMAND_NAME
|
||||
override fun getCommandName() = "format"
|
||||
|
||||
override fun main(args: Array<String>) {
|
||||
messageOutput.info("$appInfo Formatter\n")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 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.
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.ide.script;
|
||||
|
||||
import com.intellij.ide.CliResult;
|
||||
@@ -30,12 +30,12 @@ import java.util.concurrent.Future;
|
||||
/**
|
||||
* @author gregsh
|
||||
*/
|
||||
public class IdeScriptStarter extends ApplicationStarterBase {
|
||||
|
||||
final class IdeScriptStarter extends ApplicationStarterBase {
|
||||
private static final Logger LOG = Logger.getInstance(IdeScriptStarter.class);
|
||||
|
||||
protected IdeScriptStarter() {
|
||||
super("ideScript");
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return "ideScript";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2019 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.
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.help.impl;
|
||||
|
||||
import com.intellij.openapi.application.ApplicationStarter;
|
||||
@@ -8,7 +8,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
/**
|
||||
* @author Konstantin Bulenkov
|
||||
*/
|
||||
public class ShowProductVersion implements ApplicationStarter {
|
||||
final class ShowProductVersion implements ApplicationStarter {
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return "-version";
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.intellij.openapi.application.impl.ApplicationImpl
|
||||
import com.intellij.openapi.components.stateStore
|
||||
import com.intellij.openapi.diagnostic.Logger
|
||||
import com.intellij.openapi.extensions.PluginDescriptor
|
||||
import com.intellij.openapi.extensions.impl.ExtensionPointImpl
|
||||
import com.intellij.openapi.progress.EmptyProgressIndicator
|
||||
import com.intellij.openapi.progress.ProcessCanceledException
|
||||
import com.intellij.openapi.progress.ProgressManager
|
||||
@@ -28,6 +29,7 @@ import com.intellij.openapi.ui.DialogEarthquakeShaker
|
||||
import com.intellij.openapi.util.Disposer
|
||||
import com.intellij.openapi.util.IconLoader
|
||||
import com.intellij.openapi.util.SystemPropertyBean
|
||||
import com.intellij.openapi.util.io.OSAgnosticPathUtil
|
||||
import com.intellij.openapi.wm.WeakFocusStackManager
|
||||
import com.intellij.openapi.wm.WindowManager
|
||||
import com.intellij.serviceContainer.ComponentManagerImpl
|
||||
@@ -61,21 +63,25 @@ private val LOG = Logger.getInstance("#com.intellij.idea.ApplicationLoader")
|
||||
|
||||
// for non-technical reasons this method cannot return CompletableFuture
|
||||
fun initApplication(rawArgs: List<String>, prepareUiFuture: CompletionStage<Any>) {
|
||||
val args = processProgramArguments(rawArgs)
|
||||
|
||||
val initAppActivity = StartupUtil.startupStart.endAndStart(Activities.INIT_APP)
|
||||
|
||||
val isInternal = java.lang.Boolean.getBoolean(ApplicationManagerEx.IS_INTERNAL_PROPERTY)
|
||||
if (isInternal) {
|
||||
prepareUiFuture.thenRunAsync {
|
||||
BundleBase.assertOnMissedKeys(true)
|
||||
ForkJoinPool.commonPool().execute {
|
||||
initAppActivity.runChild("assert on missed keys enabling") {
|
||||
BundleBase.assertOnMissedKeys(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isInternal || Disposer.isDebugDisposerOn()) {
|
||||
Disposer.setDebugMode(true)
|
||||
initAppActivity.runChild("disposer debug mode enabling if needed") {
|
||||
if (isInternal || Disposer.isDebugDisposerOn()) {
|
||||
Disposer.setDebugMode(true)
|
||||
}
|
||||
}
|
||||
|
||||
val args = processProgramArguments(rawArgs)
|
||||
|
||||
// event queue is replaced as part of "prepareUiFuture" task - application must be created only after that
|
||||
val prepareUiFutureWaitActivity = initAppActivity.startChild("prepare ui waiting")
|
||||
val block = (prepareUiFuture as CompletableFuture<Any>).thenComposeAsync(
|
||||
@@ -94,8 +100,10 @@ fun initApplication(rawArgs: List<String>, prepareUiFuture: CompletionStage<Any>
|
||||
}
|
||||
}
|
||||
|
||||
val app = ApplicationImpl(isInternal, Main.isHeadless(), Main.isCommandLine(), EDT.getEventDispatchThread())
|
||||
ApplicationImpl.preventAwtAutoShutdown(app)
|
||||
initAppActivity.runChild("app instantiation") {
|
||||
val app = ApplicationImpl(isInternal, Main.isHeadless(), Main.isCommandLine(), EDT.getEventDispatchThread())
|
||||
ApplicationImpl.preventAwtAutoShutdown(app)
|
||||
}
|
||||
|
||||
val pluginSetFutureWaitActivity = initAppActivity.startChild("plugin descriptor init waiting")
|
||||
PluginManagerCore.getInitPluginFuture().thenApply {
|
||||
@@ -104,23 +112,19 @@ fun initApplication(rawArgs: List<String>, prepareUiFuture: CompletionStage<Any>
|
||||
}
|
||||
}, Executor {
|
||||
if (EDT.isCurrentThreadEdt()) ForkJoinPool.commonPool().execute(it) else it.run()
|
||||
}
|
||||
}
|
||||
)
|
||||
.thenCompose { pluginSet ->
|
||||
val app = ApplicationManager.getApplication() as ApplicationImpl
|
||||
runActivity("app component registration") {
|
||||
initAppActivity.runChild("app component registration") {
|
||||
app.registerComponents(modules = pluginSet.getEnabledModules(),
|
||||
app = app,
|
||||
precomputedExtensionModel = null,
|
||||
listenerCallbacks = null)
|
||||
}
|
||||
|
||||
val starter = if (args.isEmpty()) {
|
||||
IdeStarter()
|
||||
}
|
||||
else {
|
||||
// `ApplicationStarter` is an extension, so to find a starter, extensions must be registered first
|
||||
findCustomAppStarterAndStart(args)
|
||||
val starter = initAppActivity.runChild("app starter creation") {
|
||||
findAppStarter(args)
|
||||
}
|
||||
|
||||
// initSystemProperties or RegistryKeyBean.addKeysFromPlugins maybe not yet performed,
|
||||
@@ -234,14 +238,34 @@ private fun prepareStart(app: ApplicationImpl,
|
||||
Executor {
|
||||
// if `loadComponentInEdtFuture` is completed after `preloadSyncServiceFuture`,
|
||||
// then this task will be executed in EDT, so force execution out of EDT
|
||||
if (app.isDispatchThread) ForkJoinPool.commonPool().execute(it) else it.run()
|
||||
if (EDT.isCurrentThreadEdt()) ForkJoinPool.commonPool().execute(it) else it.run()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
private fun findCustomAppStarterAndStart(args: List<String>): ApplicationStarter {
|
||||
val starter = findStarter(args.first())
|
||||
?: if (PlatformUtils.getPlatformPrefix() == "LightEdit") IdeStarter.StandaloneLightEditStarter() else IdeStarter()
|
||||
private fun findAppStarter(args: List<String>): ApplicationStarter {
|
||||
val first = args.firstOrNull()
|
||||
// first argument maybe a project path
|
||||
if (first == null) {
|
||||
return IdeStarter()
|
||||
}
|
||||
else if (args.size == 1 && OSAgnosticPathUtil.isAbsolute(first)) {
|
||||
return createDefaultAppStarter()
|
||||
}
|
||||
|
||||
var starter: ApplicationStarter? = null
|
||||
val point = ApplicationStarter.EP_NAME.point as ExtensionPointImpl<ApplicationStarter>
|
||||
for (adapter in point.sortedAdapters) {
|
||||
if (adapter.orderId == first) {
|
||||
starter = adapter.createInstance(point.componentManager)
|
||||
}
|
||||
}
|
||||
|
||||
if (starter == null) {
|
||||
// `ApplicationStarter` is an extension, so to find a starter, extensions must be registered first
|
||||
starter = point.find { it == null || it.commandName == first } ?: createDefaultAppStarter()
|
||||
}
|
||||
|
||||
if (Main.isHeadless() && !starter.isHeadless) {
|
||||
val commandName = starter.commandName
|
||||
val message = IdeBundle.message(
|
||||
@@ -264,6 +288,10 @@ private fun findCustomAppStarterAndStart(args: List<String>): ApplicationStarter
|
||||
return starter
|
||||
}
|
||||
|
||||
private fun createDefaultAppStarter(): ApplicationStarter {
|
||||
return if (PlatformUtils.getPlatformPrefix() == "LightEdit") IdeStarter.StandaloneLightEditStarter() else IdeStarter()
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
internal fun createAppLocatorFile() {
|
||||
val locatorFile = Path.of(PathManager.getSystemPath(), ApplicationEx.LOCATOR_FILE_NAME)
|
||||
@@ -292,7 +320,7 @@ fun preloadServices(modules: Sequence<IdeaPluginDescriptorImpl>,
|
||||
}
|
||||
|
||||
logError(result.async)
|
||||
return logError(result.sync)
|
||||
return result.sync
|
||||
}
|
||||
|
||||
private fun addActivateAndWindowsCliListeners() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// 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.
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.openapi.application;
|
||||
|
||||
import com.intellij.ide.CliResult;
|
||||
@@ -8,7 +8,6 @@ import com.intellij.openapi.fileEditor.FileDocumentManager;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -21,19 +20,12 @@ import java.util.concurrent.Future;
|
||||
*/
|
||||
@SuppressWarnings({"UseOfSystemOutOrSystemErr", "CallToPrintStackTrace"})
|
||||
public abstract class ApplicationStarterBase implements ApplicationStarter {
|
||||
private final String myCommandName;
|
||||
private final int[] myArgsCount;
|
||||
|
||||
protected ApplicationStarterBase(@NotNull @NonNls String commandName, int... possibleArgumentsCount) {
|
||||
myCommandName = commandName;
|
||||
protected ApplicationStarterBase(int... possibleArgumentsCount) {
|
||||
myArgsCount = possibleArgumentsCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return myCommandName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHeadless() {
|
||||
return false;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// 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.
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.openapi.application;
|
||||
|
||||
import com.intellij.ide.CliResult;
|
||||
@@ -14,11 +14,17 @@ import java.util.concurrent.Future;
|
||||
final class ExitStarter extends ApplicationStarterBase {
|
||||
private ExitStarter() {
|
||||
// extra argument count (2) to allow for usage of remote-dev-server.sh exit /path/to/project --restart
|
||||
super("exit", 0, 1, 2);
|
||||
super(0, 1, 2);
|
||||
}
|
||||
|
||||
private static final String ourRestartParameter = "--restart";
|
||||
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return "exit";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUsageMessage() {
|
||||
return IdeBundle.message("wrong.number.of.arguments.usage.ide.executable.exit");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// 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.
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.openapi.application;
|
||||
|
||||
import com.intellij.ide.CliResult;
|
||||
@@ -12,7 +12,12 @@ import java.util.concurrent.Future;
|
||||
|
||||
final class SaveStarter extends ApplicationStarterBase {
|
||||
private SaveStarter() {
|
||||
super("save", 0);
|
||||
super(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return "save";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.ui.win;
|
||||
|
||||
import com.intellij.ide.CliResult;
|
||||
@@ -15,7 +15,12 @@ import java.util.concurrent.Future;
|
||||
|
||||
final class RecentProjectApplication extends ApplicationStarterBase {
|
||||
RecentProjectApplication() {
|
||||
super("reopen", 1);
|
||||
super(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return "reopen";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
<projectService serviceInterface="com.intellij.openapi.roots.ProjectRootManager"
|
||||
serviceImplementation="com.intellij.workspaceModel.ide.impl.legacyBridge.project.ProjectRootManagerBridge" preload="await"/>
|
||||
|
||||
<appStarter implementation="com.intellij.ide.ui.search.TraverseUIStarter"/>
|
||||
<appStarter implementation="com.intellij.formatting.commandLine.FormatterStarter"/>
|
||||
<appStarter implementation="com.intellij.ide.script.IdeScriptStarter"/>
|
||||
<appStarter id="traverseUI" implementation="com.intellij.ide.ui.search.TraverseUIStarter"/>
|
||||
<appStarter id="format" implementation="com.intellij.formatting.commandLine.FormatterStarter"/>
|
||||
<appStarter id="ideScript" implementation="com.intellij.ide.script.IdeScriptStarter"/>
|
||||
|
||||
<applicationService serviceInterface="com.intellij.util.Queries"
|
||||
serviceImplementation="com.intellij.util.QueriesImpl"/>
|
||||
|
||||
@@ -4,21 +4,21 @@
|
||||
<startupActivity id="performanceReporter" implementation="com.intellij.diagnostic.startUpPerformanceReporter.StartUpPerformanceReporter" order="first"/>
|
||||
|
||||
<errorHandler implementation="com.intellij.diagnostic.ITNReporter"/>
|
||||
<appStarter implementation="com.intellij.openapi.application.SaveStarter"/>
|
||||
<appStarter implementation="com.intellij.openapi.application.ExitStarter"/>
|
||||
<appStarter implementation="com.intellij.diff.applications.DiffApplication"/>
|
||||
<appStarter implementation="com.intellij.diff.applications.MergeApplication"/>
|
||||
<appStarter implementation="com.intellij.ui.win.RecentProjectApplication"/>
|
||||
<appStarter implementation="com.intellij.openapi.command.impl.UpdatePluginsApp"/>
|
||||
<appStarter implementation="com.intellij.help.impl.KeymapGenerator"/>
|
||||
<appStarter implementation="com.intellij.help.impl.IntentionDump"/>
|
||||
<appStarter implementation="com.intellij.help.impl.InspectionDump"/>
|
||||
<appStarter implementation="com.intellij.help.impl.ShowProductVersion"/>
|
||||
<appStarter implementation="com.intellij.ide.plugins.BundledPluginsLister"/>
|
||||
<appStarter implementation="com.intellij.ide.plugins.HeadlessPluginsInstaller"/>
|
||||
<appStarter implementation="com.intellij.warmup.ProjectIndexesWarmup"/>
|
||||
<appStarter implementation="com.intellij.internal.statistic.eventLog.events.EventsSchemeBuilderAppStarter"/>
|
||||
<appStarter implementation="com.intellij.internal.statistic.utils.DumpActionsAppStarter"/>
|
||||
<appStarter id="save" implementation="com.intellij.openapi.application.SaveStarter"/>
|
||||
<appStarter id="exit" implementation="com.intellij.openapi.application.ExitStarter"/>
|
||||
<appStarter id="diff" implementation="com.intellij.diff.applications.DiffApplication"/>
|
||||
<appStarter id="merge" implementation="com.intellij.diff.applications.MergeApplication"/>
|
||||
<appStarter id="reopen" implementation="com.intellij.ui.win.RecentProjectApplication"/>
|
||||
<appStarter id="update" implementation="com.intellij.openapi.command.impl.UpdatePluginsApp"/>
|
||||
<appStarter id="keymap" implementation="com.intellij.help.impl.KeymapGenerator"/>
|
||||
<appStarter id="intentions" implementation="com.intellij.help.impl.IntentionDump"/>
|
||||
<appStarter id="inspections" implementation="com.intellij.help.impl.InspectionDump"/>
|
||||
<appStarter id="-version" implementation="com.intellij.help.impl.ShowProductVersion"/>
|
||||
<appStarter id="listBundledPlugins" implementation="com.intellij.ide.plugins.BundledPluginsLister"/>
|
||||
<appStarter id="installPlugins" implementation="com.intellij.ide.plugins.HeadlessPluginsInstaller"/>
|
||||
<appStarter id="warmup" implementation="com.intellij.warmup.ProjectIndexesWarmup"/>
|
||||
<appStarter id="buildEventsScheme" implementation="com.intellij.internal.statistic.eventLog.events.EventsSchemeBuilderAppStarter"/>
|
||||
<appStarter id="dumpActions" implementation="com.intellij.internal.statistic.utils.DumpActionsAppStarter"/>
|
||||
<protocolHandler implementation="com.intellij.openapi.application.JBProtocolHandler"/>
|
||||
|
||||
<groupConfigurable id="appearance" weight="70"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.internal.statistic.eventLog.events
|
||||
|
||||
import com.google.gson.GsonBuilder
|
||||
@@ -12,7 +12,7 @@ import java.io.File
|
||||
import java.lang.reflect.Type
|
||||
import kotlin.system.exitProcess
|
||||
|
||||
class EventsSchemeBuilderAppStarter : ApplicationStarter {
|
||||
internal class EventsSchemeBuilderAppStarter : ApplicationStarter {
|
||||
override fun getCommandName(): String = "buildEventsScheme"
|
||||
|
||||
override fun main(args: List<String>) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 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.
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.internal.statistic.utils
|
||||
|
||||
import com.intellij.openapi.actionSystem.*
|
||||
@@ -7,7 +7,7 @@ import com.intellij.openapi.util.io.FileUtil
|
||||
import java.io.File
|
||||
import kotlin.system.exitProcess
|
||||
|
||||
class DumpActionsAppStarter : ApplicationStarter {
|
||||
internal class DumpActionsAppStarter : ApplicationStarter {
|
||||
override fun getCommandName(): String {
|
||||
return "dumpActions"
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// 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.
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.openapi.util.io;
|
||||
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -30,7 +30,7 @@ public final class OSAgnosticPathUtil {
|
||||
|
||||
int length1 = path1.length();
|
||||
int length2 = path2.length();
|
||||
boolean ignoreCase = !SystemInfo.isFileSystemCaseSensitive;
|
||||
boolean ignoreCase = !SystemInfoRt.isFileSystemCaseSensitive;
|
||||
|
||||
for (int pos = 0; pos < length1 && pos < length2; pos++) {
|
||||
char ch1 = path1.charAt(pos);
|
||||
@@ -61,7 +61,7 @@ public final class OSAgnosticPathUtil {
|
||||
* @see OSAgnosticPathUtil applicability warning
|
||||
*/
|
||||
public static boolean isAbsolute(@NotNull String path) {
|
||||
return isAbsoluteDosPath(path) || isUncPath(path) || path.startsWith("/");
|
||||
return path.startsWith("/") || isAbsoluteDosPath(path) || isUncPath(path);
|
||||
}
|
||||
|
||||
public static boolean isAbsoluteDosPath(@NotNull String path) {
|
||||
@@ -76,7 +76,7 @@ public final class OSAgnosticPathUtil {
|
||||
int pathLength = path.length(), prefixLength = prefix.length();
|
||||
if (prefixLength == 0) return true;
|
||||
if (prefixLength > pathLength) return false;
|
||||
boolean ignoreCase = !SystemInfo.isFileSystemCaseSensitive;
|
||||
boolean ignoreCase = !SystemInfoRt.isFileSystemCaseSensitive;
|
||||
for (int pos = 0; pos < pathLength && pos < prefixLength; pos++) {
|
||||
char ch1 = path.charAt(pos);
|
||||
char ch2 = prefix.charAt(pos);
|
||||
@@ -92,7 +92,9 @@ public final class OSAgnosticPathUtil {
|
||||
else if (ch2 == '/' || ch2 == '\\') {
|
||||
return false;
|
||||
}
|
||||
if (StringUtil.compare(ch1, ch2, ignoreCase) != 0) return false;
|
||||
if (StringUtil.compare(ch1, ch2, ignoreCase) != 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (pathLength == prefixLength) {
|
||||
return true;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.warmup
|
||||
|
||||
import com.intellij.indexing.shared.ultimate.project.waitIndexInitialization
|
||||
@@ -11,7 +12,7 @@ import com.intellij.warmup.util.withLoggingProgresses
|
||||
import kotlin.math.max
|
||||
import kotlin.system.exitProcess
|
||||
|
||||
class ProjectIndexesWarmup : ApplicationStarter {
|
||||
internal class ProjectIndexesWarmup : ApplicationStarter {
|
||||
override fun getCommandName(): String {
|
||||
return "warmup"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user