Resharper-unity: Sort System.Collections.Generic above Boo.Lang

Created on 29 May 2018  路  19Comments  路  Source: JetBrains/resharper-unity

image

Generally I'd imagine Generic.List<> should be prioritised, and in this case it's extremely frustrating to always get references to the former.

enhancement

Most helpful comment

image

This should probably be solved in a way that is more automated for the end user still, but it can be solved now at least

All 19 comments

Oh man, that annoyed me too many times.

I though this integration was removing references to Boo, but just read the code again and it seems it doesn't. Now that Boo and UnityScript are deprecated, it would be nice to strip those references out of the generated projects.

I guess we can't simply strip them, consider if some project has a dll compiled with Boo.Lang reference.
It might be a solution to check dependencies of all referenced assemblies and if none of them requires Boo.Lang, UnityScript, UnityScript.Lang it is safe to strip them. At least references from Assets and Packages should be checked. Does it sound good?

Any solution ya'll think of that gets rid of this particular instance sounds good to me - stripping would be ideal, but the problem for me at least is purely this UI/UX issue.

Checking ReferencedAssemblies via reflection takes significant time. Looking into alternatives.

We can just lower the priority of all completion items coming from the Boo namespace. This is an easy fix - they鈥檙e still in the list, but less likely to be picked first. I鈥檒l take this.

@vertxxyz what is your Unity version?

@citizenmatt if you are taking it, consider all this 3 assemblies {"UnityScript", "UnityScript.Lang", "Boo.Lang"};

@van800 currently using 2018.2.0b4
(on-and-off with the Incremental Compiler)

Just putting this on hold for a couple of days, until a bug in Rider's own sorting of completion items is fixed.

Any chance this will get prioritized? Since Boo.Lang.List offers a very similar API as System.Collection.Generics.List, I keep introducing references to the Boo version by mistake, and not catching it before way later.

Yeah, happens every time with me too. I had to get used to force a mental delay to actually read the choices and select the second one instead of the first (default) one.

I did not find any solutions to this problem in Rider. There is a fancy script that uses SyntaxTree.VisualStudio.Unity.Bridge but that is only for visual studio I guess.
Please help with that

Considering that Rider sorts using statements with System.* at the top, then other things alphabetically - wouldn't it just make sense to use the same sorting rules for these import suggestions?

It probably would fix this particular issue but afaict the autocompletion is at least somewhat dependant on user preference. (What I mean with that is that it adjust based on what you pick.) By always involuntary importing boo one probably pushes boo to the top of the list. It would probably be more helpful to be able to manually influence this dynamic order. Idk e.g alt+arrowkey to move entries up or down in the menu. This could potentially always have side effects on ordering in other queries which would probably make this quite difficult.

I've been called out on a few PR's recently because I accidentally used Boo.Lang.List. I'm looking forward to this fix too.

I moved dll from unity fodler and removed references from .csproj files in project root, but getting error
and can not compile code
image

But good news - in rider no Boo and unityscript anymore, and List import without selection

I guess to fix the error - need to make empty dll for instead original

It seems find solution, I created fake dll:
replace Boo.Lang.dll in unity folder
"\Unity\2019.1.10f1\Editor\Data\MonoBleedingEdge\lib\mono\unityscript"
with https://mega.nz/#!hY1hEKbR!BxakZKdkz4rMYhuITqEGLLWF3GexMklSowhZKHHL-ls

image

This should probably be solved in a way that is more automated for the end user still, but it can be solved now at least

Yes, see #1252 - you might also want to add UnityScript.*. Unfortunately, Rider 2019.2 doesn't allow _merging_ settings for auto import, so the plugin can't automatically set this. Hopefully this will be addressed in Rider 2019.3

Was this page helpful?
0 / 5 - 0 ratings

Related issues

justinlueders picture justinlueders  路  5Comments

aaronhoogstraten picture aaronhoogstraten  路  4Comments

oxysoft picture oxysoft  路  5Comments

real-mikhail picture real-mikhail  路  5Comments

Strepto picture Strepto  路  4Comments