Skip to content
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

Update ReSharper integration to support v6.1 RTM #297

Merged
merged 6 commits into from
Jan 22, 2012
Merged

Update ReSharper integration to support v6.1 RTM #297

merged 6 commits into from
Jan 22, 2012

Conversation

petemounce
Copy link
Contributor

per discussion at http://groups.google.com/group/openwrap-devel/browse_thread/thread/9ba81705260e1645 + what seemed necessary code-change-wise.

  • Add same DLLs (v6.1.37.86) as v6
  • Introduce new v610 project which defines v610 compile-constant
  • Adjust existing v600 checks to include v610 case

There's a compilation error with ResharperTests5.cs relating to turning on
solution-wide analysis; that property no-longer exists in the 6.1 API I guess.

Peter Mounce added 2 commits January 10, 2012 13:42
per discussion at http://groups.google.com/group/openwrap-devel/browse_thread/thread/9ba81705260e1645
* Add same DLLs (v6.1.37.86) as v6
* Introduce new v610 project which defines v610 compile-constant
* Adjust existing v600 checks to include v610 case

There's a compilation error with ResharperTests5.cs relating to turning on
solution-wide analysis; that property no-longer exists in the 6.1 API I guess.
@serialseb
Copy link
Member

The issue probably comes from a missing compilation variable check on Resharper5Tests.cs line 63 that's missing from this.

@petemounce
Copy link
Contributor Author

As in, a new one that should be added? I noticed that right after I pushed, and pushed again. It isn't that.

@serialseb
Copy link
Member

No, look at the file, there's already one that checks for v600 and doesnt have a check for v610

@petemounce
Copy link
Contributor Author

Ping. Adding the check for v610 did not yield green.

Peter Mounce added 2 commits January 13, 2012 10:34
This gives us compilation, and passing 'Tests', but various failures in 'Tests.VisualStudio'
@nesteruk
Copy link

Regarding ResharperTests5.cs: what you need to do is set the AnalysisEnabled property of the HighlightingSettings instead.

@nesteruk
Copy link

Just to clarify a little bit, what this implies is that before doing a time measurement on SWA you would have to enable it with code similar to the following:

Shell.Instance.Invocator.ReentrancyGuard.Execute("SWEA", () =>
  {
    Shell.Instance.GetComponent<SettingsStore>().SetValue(mySolution.ToDataContext(), HighlightingSettingsAccessor.AnalysisEnabled, AnalysisScope.SOLUTION);
  });

@petemounce
Copy link
Contributor Author

SetValue throws a warning about being deprecated and I should use BindToContextLive or BindToContextTransient instead - but I don't know enough about what the code is trying to do to know which one to pick, or where to get the parameters from.

Would you mind also fully-qualifying the types? OpenWrap has a set of redirects so that the same code can service multiple ReSharper versions. Thanks!

@nesteruk
Copy link

Please ignore the deprecation warning for now.

As for the types mentioned above, they are:

JetBrains.Application.Shell
JetBrains.Application.Settings.Store.Implementation.SettingsStore
JetBrains.ReSharper.Daemon.HighlightingSettingsAccessor
JetBrains.ReSharper.Daemon.AnalysisScope

The ToDataContext() method is an extension method stored in the JetBrains.ProjectModel.DataContext.DataContextsEx class.

@petemounce
Copy link
Contributor Author

In JetBrains.Platform.ReSharper.Shell.dll v6.1.x there is no type JetBrains.Application.Shell - which assembly should I reference? Using ReSharper's own ctrl+n to find type doesn't find it in the assemblies I've referenced (see
ee334b3 for list).

Oh - note the assembly namespace-alias going on in the reference - JB R# assemblies are referenced via resharper::.

@nesteruk
Copy link

The assembly you're looking for is JetBrains.ReSharper.Resources.

@petemounce
Copy link
Contributor Author

JetBrains.ReSharper.Daemon.Impl.AnalysisScope exists in v6, but I haven't found it in v6.1 (with or without the .Impl).

I also couldn't find HighlightingSettingsAccessor in v6.1, or the ToDataContext extension method.

@petemounce
Copy link
Contributor Author

@nesteruk in your tweet you say SWA but in the code-snippet above you say SWEA - which is correct? And what is it?

Apologies for random nature of questions; I'm kinda fumbling around in the guts of something I don't understand yet.

@nesteruk
Copy link

I suggest you make an empty plug-in project using the SDK and then use Ctrl+T or Ctrl+Shift+T to locate the types and references that are needed. The best practice for writing R# plugins is to reference every single assembly that R# comes with. This is precisely what the SDK does with its .Targets files.

@petemounce
Copy link
Contributor Author

Ah, yes - that makes it easier. When I'm done I can analyse references and remove unused ones, too. Thanks :-)

@nesteruk
Copy link

Yep, that should help as well. Just keep in mind that removing unused references for SDK projects doesn't actually do anything :)

@petemounce
Copy link
Contributor Author

So Shell.Instance.GetComponent<resharper::JetBrains.Application.Settings.Store.Implementation.SettingsStore>() returns me a instance that doesn't have a SetValue instance method, now :-(

Also, Shell.Instance.Invocator is marked deprecated; the message says to import IThreading (or IShellLocks, which will apparently do) (but I don't really know what that means in this context).

…teruk (thanks!)

* figure out which assemblies the required types live in, and reference them.
* copy and paste example from @dnesteruk into #if v610 block.

Compilation achieved; now for tests...
@petemounce
Copy link
Contributor Author

@serialseb At this point, I get:

  • green compile
  • green Tests project (1090 passed, 0 failed, 6 skipped)
  • red Tests.VisualStudio (11 passed, 14 failed, 0 skipped)

This is the same as when I checkout 19d2843 (the revision that I forked from), when running with ReSharper 6.1 (I haven't run these with ReSharper 6.0). How to proceed...?

@serialseb
Copy link
Member

Just issue the pull requests. The VS tests are notirously unreliable and slow, until I automate them we can live with them breaking for now.

Seb


From: Peter Mounce [reply@reply.github.com]
Sent: 18 January 2012 12:19
To: Sebastien Lambla
Subject: Re: [openwrap] Update ReSharper integration to support v6.1 RTM (#297)

@serialseb At this point, I get:

  • green compile
  • green Tests project (1090 passed, 0 failed, 6 skipped)
  • red Tests.VisualStudio (11 passed, 14 failed, 0 skipped)

This is the same as when I checkout 19d2843 (the revision that I forked from), when running with ReSharper 6.1 (I haven't run these with ReSharper 6.0). How to proceed...?


Reply to this email directly or view it on GitHub:
#297 (comment)

(so it has a different Guid; it started life as a copy of .600)
add similar references as v600 integration, but for v610.
Now compilation fails again, saying `SiteManager` class is defined in multiple assemblies, which
I don't know how to debug.
@petemounce
Copy link
Contributor Author

And now, compilation. The VS tests still fail (the output window pane is null during WaitForMessage) in most of the failures.

How do I test this in anger, in a solution that isn't OpenWrap?

@petemounce
Copy link
Contributor Author

@serialseb From tweet:

cd <path to my OpenWrap'd test solution>
o build-wrap -name OpenWrap -from <abs path to OpenWrap checkout root>
o update-wrap OpenWrap -from .
<open up Visual Studio solution>
<type the name of a type someplace where there isn't a using statement in the file and watch the R# integration happen>

It Works On My Machine!

@petemounce
Copy link
Contributor Author

I got a yellow line during the update-wrap call; here's the output:

That outputs:

--> o update-wrap openwrap -from .
# OpenWrap Shell 2.0.0.10
# Copyright c naughtyProd Limited 2009-2011
# Using c:\src\root.git\JustEat\components\JustEat.BootStrapper\wraps\_cache\openwrap-2.0.2.87978029\bin-net35\OpenWrap.dll (2.0.0.1)

Updating project packages...
Project repository: openwrap updated [2.0.2.87978029 -> 2.0.2.97970098].
Project repository: SharpZipLib up-to-date.
Project repository: tdnet-framework up-to-date.
Project repository: Mono.Cecil up-to-date.
Project repository: openfilesystem up-to-date.
Project repository: Package OpenWrap-2.0.2.97970098 could not be anchored.

@serialseb serialseb merged commit 53844fa into OpenWrap:master Jan 22, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants