Skip to content

Fix recently opened workspaces not being saved #337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 7, 2023
Merged
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
Use delegated properties with recent connections
From what I understand when you use BaseState you are supposed to use
delegation.  Something must have changed because this code used to work
just as it was, but now it seems without delegation the properties are
ignored and we were getting recent entries that were blank (looked like
this: `<RecentWorkspaceConnection />`).
  • Loading branch information
code-asher committed Dec 7, 2023
commit 12df535ebe4e3b19fc89ff3ace8d5e6444aa9a53
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,51 @@ import com.intellij.openapi.components.BaseState
import com.intellij.util.xmlb.annotations.Attribute

class RecentWorkspaceConnection(
coderWorkspaceHostname: String? = null,
projectPath: String? = null,
lastOpened: String? = null,
ideProductCode: String? = null,
ideBuildNumber: String? = null,
downloadSource: String? = null,
idePathOnHost: String? = null,
webTerminalLink: String? = null,
configDirectory: String? = null,
name: String? = null,
) : BaseState(), Comparable<RecentWorkspaceConnection> {
@get:Attribute
var coderWorkspaceHostname: String? = null,
var coderWorkspaceHostname by string()
@get:Attribute
var projectPath: String? = null,
var projectPath by string()
@get:Attribute
var lastOpened: String? = null,
var lastOpened by string()
@get:Attribute
var ideProductCode: String? = null,
var ideProductCode by string()
@get:Attribute
var ideBuildNumber: String? = null,
var ideBuildNumber by string()
@get:Attribute
var downloadSource: String? = null,
var downloadSource by string()
@get:Attribute
var idePathOnHost: String? = null,
var idePathOnHost by string()
@get:Attribute
var webTerminalLink: String? = null,
var webTerminalLink by string()
@get:Attribute
var configDirectory: String? = null,
var configDirectory by string()
@get:Attribute
var name: String? = null,
) : BaseState(), Comparable<RecentWorkspaceConnection> {
var name by string()

init {
this.coderWorkspaceHostname = coderWorkspaceHostname
this.projectPath = projectPath
this.lastOpened = lastOpened
this.ideProductCode = ideProductCode
this.ideBuildNumber = ideBuildNumber
this.downloadSource = downloadSource
this.idePathOnHost = idePathOnHost
this.webTerminalLink = webTerminalLink
this.configDirectory = configDirectory
this.name = name
}

override fun equals(other: Any?): Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false
Expand Down