Skip to content

Commit 7731655

Browse files
committed
Merge branch 'net193' into net193-eap7-rtm-2019.3.0-rtm-2019.3.1
2 parents c549562 + c8cb69b commit 7731655

13 files changed

+278
-112
lines changed

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0).
77
This plugin has functionality that is common to both ReSharper and Rider. It also contains a plugin for the Unity editor that is used to communicate with Rider. Changes marked with a "Rider:" prefix are specific to Rider, while changes for the Unity editor plugin are marked with a "Unity editor:" prefix. No prefix means that the change is common to both Rider and ReSharper.
88

99
## 2019.3.1
10-
* [Commits](https://github.com/JetBrains/resharper-unity/compare/net193-eap7-rtm-2019.3.0...net193)
10+
* [Commits](https://github.com/JetBrains/resharper-unity/compare/net193-eap7-rtm-2019.3.0...net193-eap7-rtm-2019.3.0-rtm-2019.3.1)
1111
* [Milestone](https://github.com/JetBrains/resharper-unity/milestone/33?closed=1)
1212

1313
### Added
@@ -17,10 +17,19 @@ This plugin has functionality that is common to both ReSharper and Rider. It als
1717
### Changed
1818

1919
- Rider: Entire plugin is no longer disabled if the CSS plugin is disabled ([RIDER-36523](https://youtrack.jetbrains.com/issue/RIDER-36523), [#1443](https://github.com/JetBrains/resharper-unity/pull/1443))
20+
- Rider: Make Attach to Unity Process dialog resizable ([#1446](https://github.com/JetBrains/resharper-unity/issues/1446), [#1450](https://github.com/JetBrains/resharper-unity/pull/1450))
21+
- Rider: Identify child processes by role in Attach to Unity Process dialog ([#1328](https://github.com/JetBrains/resharper-unity/issues/1328), [#1450](https://github.com/JetBrains/resharper-unity/pull/1450))
2022

2123
### Fixed
2224

2325
- Fix usage count for custom event based event handlers in Unity 2018.4+ ([#1448](https://github.com/JetBrains/resharper-unity/issues/1448), [#1449](https://github.com/JetBrains/resharper-unity/pull/1449))
26+
- Rider: Show correct project name when Unity started with certain command line on Windows ([#1450](https://github.com/JetBrains/resharper-unity/pull/1450))
27+
- Rider: Show correct project name when multiple Unity processes listed in Attach to Process popup list ([#1456](https://github.com/JetBrains/resharper-unity/issues/1456), [#1450](https://github.com/JetBrains/resharper-unity/pull/1450))
28+
- Rider: Fix exception in Attach to Unity Process dialog causing list to be empty ([#1454](https://github.com/JetBrains/resharper-unity/issues/1454), [#1450](https://github.com/JetBrains/resharper-unity/pull/1450))
29+
- Rider: Show run configuration dialog for Unity class library projects ([#1445](https://github.com/JetBrains/resharper-unity/issues/1445), [#1450](https://github.com/JetBrains/resharper-unity/pull/1450))
30+
- Rider: Fix finding existing Unity instance to debug ([RIDER-36256](https://youtrack.jetbrains.com/issue/RIDER-36256), [#1450](https://github.com/JetBrains/resharper-unity/pull/1450))
31+
- Rider: Fix `EditorInstance.json` being locked by Rider ([#1450](https://github.com/JetBrains/resharper-unity/pull/1450))
32+
2433

2534

2635
## 2019.3

rider/src/main/kotlin/com/jetbrains/rider/UnityProjectDiscoverer.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.jetbrains.rider
22

33
import com.intellij.openapi.project.Project
4+
import com.jetbrains.rd.util.reactive.valueOrDefault
45
import com.jetbrains.rdclient.util.idea.LifetimedProjectComponent
56
import com.jetbrains.rider.model.RdExistingSolution
67
import com.jetbrains.rider.plugins.unity.UnityHost
@@ -21,6 +22,13 @@ class UnityProjectDiscoverer(project: Project, unityHost: UnityHost) : Lifetimed
2122
val isUnityGeneratedProject = isUnityProject && solutionNameMatchesUnityProjectName(project)
2223
val isUnitySidecarProject = isUnityProject && !solutionNameMatchesUnityProjectName(project)
2324

25+
// Note that this will only return a sensible value once the solution + backend have finished loading
26+
val isUnityClassLibraryProject: Boolean?
27+
get() {
28+
val hasReference = hasUnityReference.valueOrNull ?: return null
29+
return hasReference && isCorrectlyLoadedSolution(project)
30+
}
31+
2432
companion object {
2533
fun getInstance(project: Project) = project.getComponent<UnityProjectDiscoverer>()
2634

@@ -58,5 +66,6 @@ class UnityProjectDiscoverer(project: Project, unityHost: UnityHost) : Lifetimed
5866
}
5967

6068
fun Project.isUnityGeneratedProject() = UnityProjectDiscoverer.getInstance(this).isUnityGeneratedProject
69+
fun Project.isUnityClassLibraryProject() = UnityProjectDiscoverer.getInstance(this).isUnityClassLibraryProject
6170
fun Project.isUnityProject()= UnityProjectDiscoverer.getInstance(this).isUnityProject
6271
fun Project.isUnityProjectFolder()= UnityProjectDiscoverer.getInstance(this).isUnityProjectFolder

rider/src/main/kotlin/com/jetbrains/rider/plugins/unity/run/UnityPlayer.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ package com.jetbrains.rider.plugins.unity.run
33
data class UnityPlayer(val host: String, val port: Int, val debuggerPort: Int,
44
val flags: Long, val guid: Long, val editorId: Long, val version: Int,
55
val id: String, val allowDebugging: Boolean, val packageName: String? = null,
6-
val projectName: String? = null, val pid: Int? = null, val isEditor: Boolean = false) {
6+
val projectName: String? = null, val pid: Int? = null, val roleName: String? = null,
7+
val isEditor: Boolean = false) {
78
companion object {
8-
fun createEditorPlayer(host: String, port: Int, id: String, pid: Int, projectName: String?): UnityPlayer {
9+
fun createEditorPlayer(host: String, port: Int, id: String, pid: Int, projectName: String?, roleName: String?): UnityPlayer {
910
return UnityPlayer(host, port, port, flags = 0, guid = port.toLong(), editorId = port.toLong(), version = 0,
10-
id = id, allowDebugging = true, pid = pid, projectName = projectName, isEditor = true)
11+
id = id, allowDebugging = true, pid = pid, projectName = projectName, isEditor = true, roleName = roleName)
1112
}
1213

1314
fun createRemotePlayer(host: String, port: Int): UnityPlayer {

rider/src/main/kotlin/com/jetbrains/rider/plugins/unity/run/UnityPlayerListener.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,12 @@ class UnityPlayerListener(private val project: Project,
102102

103103
private fun addLocalProcesses() {
104104
val unityProcesses = OSProcessUtil.getProcessList().filter { UnityRunUtil.isUnityEditorProcess(it) }
105-
val projectNames = UnityRunUtil.getUnityProcessProjectNames(unityProcesses, project)
105+
val unityProcessInfoMap = UnityRunUtil.getAllUnityProcessInfo(unityProcesses, project)
106106
unityProcesses.map { processInfo ->
107-
val projectName = projectNames[processInfo.pid]
107+
val unityProcessInfo = unityProcessInfoMap[processInfo.pid]
108108
val port = convertPidToDebuggerPort(processInfo.pid)
109-
UnityPlayer.createEditorPlayer("127.0.0.1", port, processInfo.executableName, processInfo.pid, projectName)
109+
UnityPlayer.createEditorPlayer("127.0.0.1", port, processInfo.executableName, processInfo.pid,
110+
unityProcessInfo?.projectName, unityProcessInfo?.roleName)
110111
}.forEach {
111112
onPlayerAdded(it)
112113
}

rider/src/main/kotlin/com/jetbrains/rider/plugins/unity/run/UnityProcessPickerDialog.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ class UnityProcessPickerDialog(private val project: Project) : DialogWrapper(pro
6262
}
6363
commentRow("Please ensure both the <i>Development Build</i> and <i>Script Debugging</i> options are checked in Unity's <i>Build Settings</i> dialog. " +
6464
"Standalone players must be visible to the current network.")
65-
}.apply { minimumSize = Dimension(650, 300) }
65+
}.apply { preferredSize = Dimension(650, 450) }
6666

6767
isOKActionEnabled = false
6868
cancelAction.putValue(FOCUSED_ACTION, true)
6969
init()
70-
setResizable(false)
70+
setResizable(true)
7171
}
7272

7373
// DialogWrapper only lets the Mac set the preferred component via FOCUSED_ACTION because reasons
@@ -159,6 +159,9 @@ class UnityProcessPickerDialog(private val project: Project) : DialogWrapper(pro
159159
val debug = player.allowDebugging && !UnityRunUtil.isDebuggerAttached(player.host, player.port, project)
160160
val attributes = if (debug) SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES else SimpleTextAttributes.GRAYED_BOLD_ATTRIBUTES
161161
append(player.id, attributes)
162+
if (player.roleName != null) {
163+
append(" ${player.roleName}", attributes)
164+
}
162165
if (player.projectName != null) {
163166
append(" - ${player.projectName}", attributes)
164167
}

0 commit comments

Comments
 (0)