resharper

Assembly.GetType() fails to load List`1[[MyModel]] type from ReSharper Plugin only

梦想与她 提交于 2019-12-13 05:25:11
问题 I have a R# plugin and a test project (not a R# test project, but a simple, plain unit-test project). In the code of the plugin I do some type resolution from serialized type information. On such type is a list of object from one of my model classes. The serialization of the type looks like this: "System.Collections.Generic.List`1[[Model.Foo, Model]], mscorlib" I load this type (or, actually, Json.NET does) with the following calls: Assembly assembly = Assembly.LoadWithPartialName

ReSpeller is unexpectedly accepting “prefered” as correct spelling

白昼怎懂夜的黑 提交于 2019-12-13 01:36:22
问题 I'm generally very happy with ReSpeller, a $10 spellchecker for ReSharper. But I've just noticed that it is accepting "prefered", which I'd like it to consider to be a spelling mistake. I've looked in these three dictionary files: C:\Users\rp\AppData\Local\JetBrains\ReSharper\v7.1\Plugins\ReSpeller\dic\en_US.dic C:\Users\rp\AppData\Local\JetBrains\ReSharper\v7.1\Plugins\ReSpeller\dic\en_US_custom.dic C:\Users\rp\AppData\Roaming\ReSpeller\en_US.dic but I can't find "prefered" in any of them.

How to get rid of <reference path="

霸气de小男生 提交于 2019-12-12 20:25:39
问题 Sorry everyone, I've been struggling trying to understand why I need the /// <reference path="../typings/browser.d.ts" /> module App { angular.module("app", [""]); } I'm using typings and here is my tsconfig : { "compilerOptions": { "experimentalDecorators": true, "noImplicitAny": false, "noEmitOnError": true, "removeComments": false, "sourceMap": true, "target": "es5", "module": "commonjs" }, "files": [ ], "exclude": [ "node_modules", "wwwroot" ] } I found already several posts about, but

How to provide intellisense with the datacontext type in a resharper plugin?

廉价感情. 提交于 2019-12-12 19:53:56
问题 When writing a wpf prism app, I use the ViewModelLocator to automatically create the datacontext when needed. While this works great, there's no intellisense help unless I add a designtime datacontext ( d:DataContext="{d:DesignInstance viewModels:MyViewModel}" ), but that somewhat defeats the purpose of automatically discovering and connecting the viewmodel. I image something like this: a resharper plugin that looks for ViewModelLocator.AutowireViewModel="True" in the xaml, fetches the class

ReSharper Search and Replace with Pattern

拟墨画扇 提交于 2019-12-12 16:05:33
问题 I would like to re-factor various blocks of code throughout a project using ReSharper 7.1 Search / Replace with pattern. The code blocks are similar to the following simplified example: someControl.StatusProgressBar.IsIndeterminate = false; someControl.StatusProgressBar.Visibility = Visibility.Visible; someControl.StatusProgressBar.Minimum = 0; someControl.StatusProgressBar.Maximum = 100; someControl.StatusProgressBar.Value = percentage; And I would like to change them to: someControl

Resharper API for selected text and remote code generation

ⅰ亾dé卋堺 提交于 2019-12-12 13:55:30
问题 I'd like to write a Resharper plugin that lets me generate code in another class based on highlighted text, and the API isn't the most transparent. What methods should I look at to get access to selected text, and to code generation outside of the current class? 回答1: When you are writing context action or something like this (read here http://confluence.jetbrains.net/display/ReSharper/ReSharper+7+Plugin+Development about actions and context actions), you receive an instance of IDataContext.

Visual Studio Resharper with TypeScript and node_modules

a 夏天 提交于 2019-12-12 12:27:07
问题 I'm using Visual Studio 2015 Update 3. When I try to use Resharper to Refactor my TypeScript code, Resharper tries to refactor code in every folder, including node_modules . Obviously, I do not want Resharper to touch node_modules because those are 3rd party libraries (not my code) and it would probably take 6 hours to try to go through all of those folders I have in node_modules . How do I get Resharper to ignore node_modules in all instances, especially in the Refactor process? I have

When can a generic parameter never be null

心已入冬 提交于 2019-12-12 11:21:49
问题 In a generic GetHashCode(T foo) method, I check whether foo is null . However I just stumbled upon a strange Resharper warning. In the following code, can foo never be null ? private class FooComparer<T> : IEqualityComparer<T> where T: Foo { public int GetHashCode(T foo) { // resharper warning: "Expression is always false" if (Object.ReferenceEquals(null,foo)) return 0; // ... calculate hash } } However as far as I can tell, the following is perfectly legal: Foo foo = null; var fooComparer =

Resharpening from the command line

ⅰ亾dé卋堺 提交于 2019-12-12 10:53:49
问题 I would like to use the ReSharper Adjust Namespaces feature on a number of solutions. I would like to automate this process by creating a command line application that uses the ReSharper API. I looked at the ReSharper OpenAPI, but it seems to be geared towards using the ReSharper API from within an active Visual Studio session. I want to be able to use the ReSharper API from the command line. Is this possible? 回答1: You are right: the open API is generally geared towards use within VS. While

Do the SetUp and TearDown methods need [RequiresSTA] if tests have it?

不想你离开。 提交于 2019-12-12 10:49:30
问题 I can run my WatiN tests with ReSharper without issues. Each test has the RequiresSTA attribute and runs fine. When I try run all the tests in the class (TestFixture) I get the following error: One or more child tests had errors Exception doesn't have a stacktrace <testname> ignored: Invalid signature for SetUp or TearDown method: TestSetup <testname> ignored: Invalid signature for SetUp or TearDown method: TestSetup <testname> ignored: Invalid signature for SetUp or TearDown method: