JetBrains / JetBrains/resharper-unity

Update .asmdef files also when referencing precompiled .dlls

Open
#2,311 0 comments 6 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
1.2k
Forks
142
PR merge metrics
No merged PRs in 30d

Description

**Description:**
The new feature for referencing asmdefs when adding references in Rider is great! However, it doesn't currently handle referencing precompiled dlls. This should
* Ensure that the `overrideReferences` property in the asmdef file is set to `true`
* Add the referenced dll to `precompiledReferences` array in the asmdef

**Example reproduction:**
1. Add the `com.unity.test-framework` package (1.X version, 2.X preview contains a bug that changes behaviour here)
2. Write code that references NUnit, e.g. `Assert.That(null, Is.Null);`
3. Instruct rider to reference the NUnit assembly

**Expected result:**
The .asmdef contains
```
"overrideReferences": true,
"precompiledReferences": [
"nunit.framework.dll"
],
```

**Actual result:**
The .asmdef does not change.

**Notes:**
I also found a TODO comment in your code related to this, but thought I'd express my interest and let others know this is not a bug by writing an issue :)

Contributor guide

Open the contributing guide

Research direction

Start at the TODO comment related to precompiled assembly references and trace the Rider action that updates asmdef references. Reproduce the NUnit example with com.unity.test-framework, then verify that the asmdef sets overrideReferences to true and includes nunit.framework.dll in precompiledReferences.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, unity
Domain
devtools, game-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.