Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions third_party/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

### Added

- Support in the "Invalidate Caches..." dialog to remove ~/.dartServer cache

### Removed

- "Scope analysis to the current package" feature from the Dart problem view
Expand All @@ -10,8 +12,8 @@

### Changed

- Vendor change from "JetBrains" to "Google"
- Build system change from Basel to Gradle
- Vendor change from "JetBrains" to "Google"
- Build system change from Basel to Gradle


## 251.27812.12
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.jetbrains.lang.dart.analyzer

import com.intellij.ide.caches.CachesInvalidator
import com.intellij.openapi.project.ProjectManager
import com.intellij.openapi.util.SystemInfoRt
import com.jetbrains.lang.dart.DartBundle
import java.io.File

/**
* A CachesInvalidator for the Dart IntelliJ plugin, on the execution of this invalidator,
* the `~./dartServer/` directory (or equivalent on Windows machines), is deleted.
*/
private class DASSCacheInvalidator : CachesInvalidator() {

override fun getComment(): String = DartBundle.message("analysis.server.cache.invalidate.comment")

override fun getDescription(): String = DartBundle.message("analysis.server.cache.invalidate.description")

override fun optionalCheckboxDefaultValue(): Boolean = false

override fun invalidateCaches() {
val projects = ProjectManager.getInstance().openProjects
for (project in projects) {
val serverService = DartAnalysisServerService.getInstance(project)
serverService.stopServer()
}
val dartServerCacheDirectory = getDartServerCacheDirectory()
if (dartServerCacheDirectory != null && dartServerCacheDirectory.exists()) {
dartServerCacheDirectory.deleteRecursively()
}
}

private fun getDartServerCacheDirectory(): File? {
return if (SystemInfoRt.isWindows) {
val appData = System.getenv("LOCALAPPDATA")
if (appData != null) File(appData, ".dartServer") else null
} else {
val userHome = System.getProperty("user.home")
if (userHome != null) File(userHome, ".dartServer") else null
}
}
}
1 change: 1 addition & 0 deletions third_party/src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@
<intentionAction> <className>com.jetbrains.lang.dart.assists.DartQuickAssistIntention$DartQuickAssistIntention14</className> <language/> <bundleName>messages.DartBundle</bundleName> <categoryKey>inspections.group.name</categoryKey> <descriptionDirectoryName>DartQuickAssistIntention</descriptionDirectoryName></intentionAction>

<projectService serviceImplementation="com.jetbrains.lang.dart.analyzer.DartAnalysisServerService"/>
<cachesInvalidator implementation="com.jetbrains.lang.dart.analyzer.DASSCacheInvalidator"/>

<toolWindow id="Dart Analysis" anchor="bottom" icon="DartIcons.Dart_13" doNotActivateOnStart="true" canCloseContents="false"
factoryClass="com.jetbrains.lang.dart.ide.errorTreeView.DartAnalysisToolWindowFactory"/>
Expand Down
2 changes: 2 additions & 0 deletions third_party/src/main/resources/messages/DartBundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ analysis.server.snapshot.file.does.not.exist.at.0=the Dart Analysis Server snaps
dart.vm.file.is.not.executable.at.0=the Dart VM file is not executable at location: {0}
analysis.server.snapshot.file.is.not.readable.at.0=the Dart Analysis Server snapshot file is not readable at location: {0}
issue.occurred.with.analysis.server=an issue occurred with the analysis server
analysis.server.cache.invalidate.description=Delete the local Dart analysis server cache directory
analysis.server.cache.invalidate.comment=Recursively deletes .dartServer/ from the local disk

action.Dart.DartSortMembers.text=Sort Members in Dart File
action.Dart.DartSortMembers.description=Sort members in your Dart code
Expand Down
Loading