diff --git a/Dart/resources/messages/DartBundle.properties b/Dart/resources/messages/DartBundle.properties
index bf2c593b03b..ed5557095b3 100644
--- a/Dart/resources/messages/DartBundle.properties
+++ b/Dart/resources/messages/DartBundle.properties
@@ -109,7 +109,6 @@ runner.web.app.configuration.name=Dart Web App
command.line.run.config.label.dart.file=Dart &file:
command.line.run.config.label.vm.options=&VM options:
command.line.run.config.checkbox.enable.asserts=E&nable asserts
-command.line.run.config.checkbox.checked.mode=Checked mode
command.line.run.config.label.program.arguments=Program a&rguments:
command.line.run.config.label.working.directory=&Working directory:
@@ -125,7 +124,6 @@ webdev.debug.configuration.description=Start Dart web application using the webd
web.run.config.label.html.file=HTML &file:
web.run.config.label.webdev.port=Webdev &port:
choose.html.main.file=Choose HTML File
-old.dart.sdk.for.webdev=Dart SDK {0}+ is required for debugging a Dart web app using webdev, current version: {1}
dart.project.description=Create project for use with the Dart programming language
project.template.not.selected=Project template is not selected
@@ -144,7 +142,6 @@ working.dir.0=Working dir: {0}
dart.pub.get.title=Pub Get
dart.pub.upgrade.title=Pub Upgrade
dart.pub.outdated.title=Pub Outdated
-dart.pub.build.title=Pub Build
dart.webdev.build.title=Webdev Build
dart.pub.cache.repair.title=Pub Repair Cache
dart.pub.cache.repair.message=The pub cache repair command performs a clean reinstall
of all hosted and git packages in the system cache.
Start cache repair?
@@ -347,8 +344,6 @@ action.Dart.stop.dart.webdev.server.description=Stop Dart Webdev Server
action.DartCopyDtdUriAction.text=Dart: Copy DTD URI to Clipboard
action.DartCopyDtdUriAction.description=Copy Dart Tooling Daemon URI to clipboard
-action.description.run.pub.build=Run 'pub build'
-action.text.pub.build=Pub Build\u2026
action.text.webdev.build=Webdev Build\u2026
action.description.run.webdev.build=Run 'webdev build'
border.breaking.policy=Breaking Policy
@@ -396,7 +391,6 @@ filetype.dart.description=Dart
validation.info.input.and.output.folders.must.be.different=Input and output folders must be different
validation.info.output.folder.not.specified=Output folder not specified
validation.info.input.folder.not.specified=Input folder not specified
-validation.info.build.mode.not.specified=Build mode not specified
button.browse.dialog.title.output.folder=Output Folder
button.text.build2=Build
action.title.dart.rename.refactoring=Dart Rename Refactoring
diff --git a/Dart/src/com/jetbrains/lang/dart/DartFileListener.java b/Dart/src/com/jetbrains/lang/dart/DartFileListener.java
index 5df3e29e461..c15c5f7ae18 100644
--- a/Dart/src/com/jetbrains/lang/dart/DartFileListener.java
+++ b/Dart/src/com/jetbrains/lang/dart/DartFileListener.java
@@ -38,7 +38,7 @@
import com.jetbrains.lang.dart.sdk.DartPackagesLibraryType;
import com.jetbrains.lang.dart.sdk.DartSdk;
import com.jetbrains.lang.dart.sdk.DartSdkLibUtil;
-import com.jetbrains.lang.dart.util.DotPackagesFileUtil;
+import com.jetbrains.lang.dart.util.PackageConfigFileUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -68,10 +68,8 @@ public final class DartFileListener implements AsyncFileListener {
if (event instanceof VFilePropertyChangeEvent) {
if (((VFilePropertyChangeEvent)event).isRename()) {
- if (DotPackagesFileUtil.PACKAGE_CONFIG_JSON.equals(((VFilePropertyChangeEvent)event).getOldValue()) ||
- DotPackagesFileUtil.PACKAGE_CONFIG_JSON.equals(((VFilePropertyChangeEvent)event).getNewValue()) ||
- DotPackagesFileUtil.DOT_PACKAGES.equals(((VFilePropertyChangeEvent)event).getOldValue()) ||
- DotPackagesFileUtil.DOT_PACKAGES.equals(((VFilePropertyChangeEvent)event).getNewValue())) {
+ if (PackageConfigFileUtil.PACKAGE_CONFIG_JSON.equals(((VFilePropertyChangeEvent)event).getOldValue()) ||
+ PackageConfigFileUtil.PACKAGE_CONFIG_JSON.equals(((VFilePropertyChangeEvent)event).getNewValue())) {
packagesFileEvents.add(event);
}
@@ -82,8 +80,7 @@ public final class DartFileListener implements AsyncFileListener {
}
}
else {
- if (DotPackagesFileUtil.PACKAGE_CONFIG_JSON.equals(PathUtil.getFileName(event.getPath())) ||
- DotPackagesFileUtil.DOT_PACKAGES.equals(PathUtil.getFileName(event.getPath()))) {
+ if (PackageConfigFileUtil.PACKAGE_CONFIG_JSON.equals(PathUtil.getFileName(event.getPath()))) {
packagesFileEvents.add(event);
}
@@ -137,15 +134,9 @@ public static void scheduleDartPackageRootsUpdate(final @NotNull Project project
if (module == null || !DartSdkLibUtil.isDartSdkEnabled(module)) continue;
Map packagesMap = null;
- VirtualFile packagesFile = DotPackagesFileUtil.findPackageConfigJsonFile(pubspecFile.getParent());
+ VirtualFile packagesFile = PackageConfigFileUtil.findPackageConfigJsonFile(pubspecFile.getParent());
if (packagesFile != null) {
- packagesMap = DotPackagesFileUtil.getPackagesMapFromPackageConfigJsonFile(packagesFile);
- }
- else {
- packagesFile = DotPackagesFileUtil.findDotPackagesFile(pubspecFile.getParent());
- if (packagesFile != null) {
- packagesMap = DotPackagesFileUtil.getPackagesMap(packagesFile);
- }
+ packagesMap = PackageConfigFileUtil.getPackagesMapFromPackageConfigJsonFile(packagesFile);
}
if (packagesMap != null) {
@@ -358,7 +349,7 @@ public void afterVfsChange() {
if (file == null) continue;
VirtualFile dartRoot = file.getParent();
- if (dartRoot != null && file.getName().equals(DotPackagesFileUtil.PACKAGE_CONFIG_JSON)) {
+ if (dartRoot != null && file.getName().equals(PackageConfigFileUtil.PACKAGE_CONFIG_JSON)) {
dartRoot = dartRoot.getParent();
}
VirtualFile pubspec = dartRoot == null ? null : dartRoot.findChild(PUBSPEC_YAML);
diff --git a/Dart/src/com/jetbrains/lang/dart/analyzer/DartAnalysisServerService.java b/Dart/src/com/jetbrains/lang/dart/analyzer/DartAnalysisServerService.java
index 96eaee37c47..b5038180a15 100644
--- a/Dart/src/com/jetbrains/lang/dart/analyzer/DartAnalysisServerService.java
+++ b/Dart/src/com/jetbrains/lang/dart/analyzer/DartAnalysisServerService.java
@@ -82,19 +82,9 @@
import java.util.concurrent.TimeUnit;
public final class DartAnalysisServerService implements Disposable {
- public static final String MIN_SDK_VERSION = "1.12";
- private static final String MIN_MOVE_FILE_SDK_VERSION = "2.3.2";
+ public static final String MIN_SDK_VERSION = "2.12";
private static final String COMPLETION_2_SERVER_VERSION = "1.33";
- // Webdev works going back to 2.6.0, future minimum version listed in the pubspec.yaml, link below, won't mean that 2.6.0 aren't
- // supported.
- // https://github.com/dart-lang/webdev/blob/master/webdev/pubspec.yaml#L11
- public static final String MIN_WEBDEV_SDK_VERSION = "2.6.0";
-
- // As of the Dart SDK version 2.8.0, the file .dart_tool/package_config.json is preferred over the .packages file.
- // https://github.com/dart-lang/sdk/issues/48272
- public static final String MIN_PACKAGE_CONFIG_JSON_SDK_VERSION = "2.8.0";
-
// The dart cli command provides a language server command, `dart language-server`, which
// should be used going forward instead of `dart .../analysis_server.dart.snapshot`.
public static final String MIN_DART_LANG_SERVER_SDK_VERSION = "2.16.0";
@@ -489,18 +479,6 @@ public static boolean isDartSdkVersionSufficient(final @NotNull DartSdk sdk) {
return StringUtil.compareVersionNumbers(sdk.getVersion(), MIN_SDK_VERSION) >= 0;
}
- public static boolean isDartSdkVersionSufficientForMoveFileRefactoring(final @NotNull DartSdk sdk) {
- return StringUtil.compareVersionNumbers(sdk.getVersion(), MIN_MOVE_FILE_SDK_VERSION) >= 0;
- }
-
- public static boolean isDartSdkVersionSufficientForWebdev(final @NotNull DartSdk sdk) {
- return StringUtil.compareVersionNumbers(sdk.getVersion(), MIN_WEBDEV_SDK_VERSION) >= 0;
- }
-
- public static boolean isDartSdkVersionSufficientForPackageConfigJson(final @NotNull DartSdk sdk) {
- return StringUtil.compareVersionNumbers(sdk.getVersion(), MIN_PACKAGE_CONFIG_JSON_SDK_VERSION) >= 0;
- }
-
public static boolean isDartSdkVersionSufficientForDartLangServer(final @NotNull DartSdk sdk) {
return StringUtil.compareVersionNumbers(sdk.getVersion(), MIN_DART_LANG_SERVER_SDK_VERSION) >= 0;
}
@@ -1243,10 +1221,6 @@ public void isPostfixCompletionApplicable(Boolean value) {
return null;
}
- if (StringUtil.compareVersionNumbers(mySdkVersion, "1.25") < 0) {
- return PostfixTemplateDescriptor.EMPTY_ARRAY;
- }
-
final Ref resultRef = Ref.create();
final CountDownLatch latch = new CountDownLatch(1);
server.edit_listPostfixCompletionTemplates(new ListPostfixCompletionTemplatesConsumer() {
@@ -1734,7 +1708,7 @@ public void onError(final RequestError error) {
final int _selectionOffset,
final int _selectionLength) {
final AnalysisServer server = myServer;
- if (server == null || StringUtil.compareVersionNumbers(mySdkVersion, "1.25") < 0) {
+ if (server == null) {
return null;
}
@@ -1773,7 +1747,7 @@ public void onError(final RequestError error) {
final @NotNull List importedElements,
final int _offset) {
final AnalysisServer server = myServer;
- if (server == null || StringUtil.compareVersionNumbers(mySdkVersion, "1.25") < 0) {
+ if (server == null) {
return null;
}
@@ -1938,12 +1912,8 @@ private void analysis_setSubscriptions() {
subscriptions.put(AnalysisService.NAVIGATION, myVisibleFileUris);
subscriptions.put(AnalysisService.OVERRIDES, myVisibleFileUris);
subscriptions.put(AnalysisService.OUTLINE, myVisibleFileUris);
- if (StringUtil.compareVersionNumbers(mySdkVersion, "1.13") >= 0) {
- subscriptions.put(AnalysisService.IMPLEMENTED, myVisibleFileUris);
- }
- if (StringUtil.compareVersionNumbers(mySdkVersion, "1.25.0") >= 0) {
- subscriptions.put(AnalysisService.CLOSING_LABELS, myVisibleFileUris);
- }
+ subscriptions.put(AnalysisService.IMPLEMENTED, myVisibleFileUris);
+ subscriptions.put(AnalysisService.CLOSING_LABELS, myVisibleFileUris);
if (LOG.isDebugEnabled()) {
LOG.debug("analysis_setSubscriptions, subscriptions:\n" + subscriptions);
@@ -2199,15 +2169,7 @@ else if (!useDartLangServerCall && !dasSnapshotFile.canRead()) {
vmArgsRaw = "";
}
- @NonNls String serverArgsRaw;
- if (useDartLangServerCall) {
- serverArgsRaw = "--protocol=analyzer";
- }
- else {
- // Note that as of Dart 2.12.0 the '--useAnalysisHighlight2' flag is ignored (and is the
- // default highlighting mode). We still want to pass it in for earlier SDKs.
- serverArgsRaw = "--useAnalysisHighlight2";
- }
+ @NonNls String serverArgsRaw = useDartLangServerCall ? "--protocol=analyzer" : "";
try {
serverArgsRaw += " " + Registry.stringValue("dart.server.additional.arguments");
diff --git a/Dart/src/com/jetbrains/lang/dart/ide/actions/DartEditorNotificationsProvider.java b/Dart/src/com/jetbrains/lang/dart/ide/actions/DartEditorNotificationsProvider.java
index 7bd7f9d46fe..859d90fb36f 100644
--- a/Dart/src/com/jetbrains/lang/dart/ide/actions/DartEditorNotificationsProvider.java
+++ b/Dart/src/com/jetbrains/lang/dart/ide/actions/DartEditorNotificationsProvider.java
@@ -14,7 +14,6 @@
import com.intellij.openapi.module.ModuleUtilCore;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.NlsContexts;
-import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiManager;
@@ -53,7 +52,7 @@ public final class DartEditorNotificationsProvider implements EditorNotification
final DartSdk sdk = DartSdk.getDartSdk(project);
if (sdk != null && DartSdkLibUtil.isDartSdkEnabled(module)) {
- return fileEditor -> new PubActionsPanel(fileEditor, sdk);
+ return fileEditor -> new PubActionsPanel(fileEditor);
}
}
@@ -116,14 +115,11 @@ public final class DartEditorNotificationsProvider implements EditorNotification
}
private static final class PubActionsPanel extends EditorNotificationPanel {
- private PubActionsPanel(@NotNull FileEditor fileEditor, @NotNull DartSdk sdk) {
+ private PubActionsPanel(@NotNull FileEditor fileEditor) {
super(fileEditor, null, EditorColors.GUTTER_BACKGROUND, Status.Info);
createActionLabel(DartBundle.message("pub.get"), "Dart.pub.get");
createActionLabel(DartBundle.message("pub.upgrade"), "Dart.pub.upgrade");
-
- if (StringUtil.compareVersionNumbers(sdk.getVersion(), DartPubOutdatedAction.MIN_SDK_VERSION) >= 0) {
- createActionLabel(DartBundle.message("pub.outdated"), "Dart.pub.outdated");
- }
+ createActionLabel(DartBundle.message("pub.outdated"), "Dart.pub.outdated");
myLinksPanel.add(new JSeparator(SwingConstants.VERTICAL));
createActionLabel(DartBundle.message("webdev.build"), "Dart.build");
diff --git a/Dart/src/com/jetbrains/lang/dart/ide/actions/DartPubActionBase.kt b/Dart/src/com/jetbrains/lang/dart/ide/actions/DartPubActionBase.kt
index 7311e68b520..dae6eff60d6 100644
--- a/Dart/src/com/jetbrains/lang/dart/ide/actions/DartPubActionBase.kt
+++ b/Dart/src/com/jetbrains/lang/dart/ide/actions/DartPubActionBase.kt
@@ -36,7 +36,6 @@ import com.intellij.openapi.util.Disposer
import com.intellij.openapi.util.Key
import com.intellij.openapi.util.NlsContexts
import com.intellij.openapi.util.io.FileUtil
-import com.intellij.openapi.util.text.StringUtil
import com.intellij.openapi.vfs.VfsUtil
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.openapi.wm.ToolWindowId
@@ -105,8 +104,7 @@ abstract class DartPubActionBase : AnAction(), DumbAware {
if (sdk == null) return
- val useDartPub = StringUtil.compareVersionNumbers(sdk.version, DART_PUB_MIN_SDK_VERSION) >= 0
- val exeFile = if (useDartPub) File(DartSdkUtil.getDartExePath(sdk)) else File(DartSdkUtil.getPubPath(sdk))
+ val exeFile = File(DartSdkUtil.getDartExePath(sdk))
if (!exeFile.isFile) {
if (allowModalDialogs) {
@@ -186,25 +184,12 @@ abstract class DartPubActionBase : AnAction(), DumbAware {
private const val GROUP_DISPLAY_ID: @NonNls String = "Dart Pub Tool"
private val PUB_TOOL_WINDOW_CONTENT_INFO_KEY = Key.create("PUB_TOOL_WINDOW_CONTENT_INFO_KEY")
- private const val DART_PUB_MIN_SDK_VERSION = "2.10"
- private const val DART_RUN_TEST_MIN_SDK_VERSION = "2.11"
-
private val ourInProgress = AtomicBoolean(false)
- @JvmStatic
- fun isUseDartRunTestInsteadOfPubRunTest(dartSdk: DartSdk): Boolean =
- StringUtil.compareVersionNumbers(dartSdk.version, DART_RUN_TEST_MIN_SDK_VERSION) >= 0
-
@JvmStatic
fun setupPubExePath(commandLine: GeneralCommandLine, dartSdk: DartSdk) {
- val useDartPub = StringUtil.compareVersionNumbers(dartSdk.version, DART_PUB_MIN_SDK_VERSION) >= 0
- if (useDartPub) {
- commandLine.withExePath(FileUtil.toSystemDependentName(DartSdkUtil.getDartExePath(dartSdk)))
- commandLine.addParameter("pub")
- }
- else {
- commandLine.withExePath(FileUtil.toSystemDependentName(DartSdkUtil.getPubPath(dartSdk)))
- }
+ commandLine.withExePath(FileUtil.toSystemDependentName(DartSdkUtil.getDartExePath(dartSdk)))
+ commandLine.addParameter("pub")
}
@JvmStatic
diff --git a/Dart/src/com/jetbrains/lang/dart/ide/actions/DartPubBuildAction.java b/Dart/src/com/jetbrains/lang/dart/ide/actions/DartPubBuildAction.java
index 55dd43de767..1d8e076f331 100644
--- a/Dart/src/com/jetbrains/lang/dart/ide/actions/DartPubBuildAction.java
+++ b/Dart/src/com/jetbrains/lang/dart/ide/actions/DartPubBuildAction.java
@@ -17,23 +17,15 @@ public class DartPubBuildAction extends DartPubActionBase {
@Override
public void update(@NotNull AnActionEvent e) {
super.update(e);
- final Project project = e.getProject();
- if (project != null && DartWebdev.INSTANCE.useWebdev(DartSdk.getDartSdk(project))) {
- e.getPresentation().setText(DartBundle.message("action.text.webdev.build"));
- e.getPresentation().setDescription(DartBundle.message("action.description.run.webdev.build"));
- }
- else {
- e.getPresentation().setText(DartBundle.message("action.text.pub.build"));
- e.getPresentation().setDescription(DartBundle.message("action.description.run.pub.build"));
- }
+ e.getPresentation().setText(DartBundle.message("action.text.webdev.build"));
+ e.getPresentation().setDescription(DartBundle.message("action.description.run.webdev.build"));
}
@Override
protected @NotNull @NlsContexts.DialogTitle String getTitle(final @NotNull Project project, final @NotNull VirtualFile pubspecYamlFile) {
final String projectName = PubspecYamlUtil.getDartProjectName(pubspecYamlFile);
final String prefix = projectName == null ? "" : ("[" + projectName + "] ");
- return prefix + DartBundle
- .message(DartWebdev.INSTANCE.useWebdev(DartSdk.getDartSdk(project)) ? "dart.webdev.build.title" : "dart.pub.build.title");
+ return prefix + DartBundle.message("dart.webdev.build.title");
}
@Override
@@ -47,12 +39,8 @@ public void update(@NotNull AnActionEvent e) {
final DartSdk sdk = DartSdk.getDartSdk(project);
if (sdk == null) return null; // can't happen, already checked
- if (DartWebdev.INSTANCE.useWebdev(sdk)) {
- if (!DartWebdev.INSTANCE.ensureWebdevActivated(project)) return null;
-
- return new String[]{"global", "run", "webdev", "build", "--output=" + dialog.getInputFolder() + ":" + dialog.getOutputFolder()};
- }
+ if (!DartWebdev.INSTANCE.ensureWebdevActivated(project)) return null;
- return new String[]{"build", "--mode=" + dialog.getPubBuildMode(), "--output=" + dialog.getOutputFolder()};
+ return new String[]{"global", "run", "webdev", "build", "--output=" + dialog.getInputFolder() + ":" + dialog.getOutputFolder()};
}
}
diff --git a/Dart/src/com/jetbrains/lang/dart/ide/actions/DartPubBuildDialog.form b/Dart/src/com/jetbrains/lang/dart/ide/actions/DartPubBuildDialog.form
index 69cf7ee48b9..9b551f78f31 100644
--- a/Dart/src/com/jetbrains/lang/dart/ide/actions/DartPubBuildDialog.form
+++ b/Dart/src/com/jetbrains/lang/dart/ide/actions/DartPubBuildDialog.form
@@ -1,21 +1,21 @@