Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 223555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:13:56+00:00 2026-05-11T19:13:56+00:00

I have a problem with a newly installed Visual Studio 2008 (new pc) and

  • 0

I have a problem with a newly installed Visual Studio 2008 (new pc) and ReSharper 4.5.

Edit: Issue opened at: http://youtrack.jetbrains.com/issue/RSRP-107956.


I have the following code:

public static TValue GetOrCreate<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key)
    where TValue: new()
{
    #region Parameter Validation

    if (ReferenceEquals(null, key))
        throw new ArgumentNullException("key");

    #endregion

    TValue result;
    if (dictionary.TryGetValue(key, out result))
        return result;

    result = new <-- problem here
    dictionary.Add(key, result);
    return result;
}

The line marked as the problem is where I’m having problems.

When I type this (| marks the point of my cursor):

result = new |

then I get an intellisense dropdown with TValue in it, and it is selected.

No matter what I type now, this is what I end up with:

result = new _  (|);

again, | marks the cursor position. There are a couple of problems here:

  1. Regardless of what I type, a tab-character is inserted after the underscore, not two spaces as I had to use above.
  2. I’ve turned off the addition of parenthesis and brackets on completion, but they’re still added for this particular construct
  3. It seems to be impossible to get ReSharper to insert the type selected, it just adds an underscore instead (no, the underscore is not my way of saying “type goes here”, it expands to exactly what I showed above, without the type, but with an underscore + Tab-character instead)

Keys I’ve tried hitting when the intellisense is up:

  • Space (difference: parenthesis looks like this: ( |), ie. a space added)
  • Tab
  • Enter
  • ( – that is, opening parenthesis
  • T+any of the above (ie. type out the first letter of TValue and hope that helps, which it doesn’t)

The only thing that “helps” is if I hit one of the keys that switches to the fuller intellisense dropdown, like the default Alt-Right, then it just adds lots more things I can select, still has TValue selected, but now if I hit Enter or Tab, the code is expanded correctly.

Does anyone know what I need to tweak?


Edit: Before I posted, I thought about the method and decided that the parameter validation there is probably not needed, so I took it away, and lo and behold, now it auto-completes correctly.

Is this just a(nother) bug in ReSharper?

Note that if I write the code correctly on that line, ie. write TValue instead of the underscore, the project builds.


Edit: Note, there are no live templates in ReSharper that are enabled, that was the first thing I disabled, just to test if there was a weird template that overrode my selection.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T19:13:56+00:00Added an answer on May 11, 2026 at 7:13 pm

    I can confirm this behaviour. I get exactly the same results.

    For me, it helps to enter two chars ‘TV’, then intellisence (Tab or Ctrl+Space) will expand to TValue(|).
    However it is not working when I type ‘new’ and straight on ‘TV’. Aftern ‘new’ I have to press Esc … a strange behaviour, indeed …

    UPDATE: it is the region that leads to this problem … removing the region (only the two #region keywords – not the if-clause) helps me.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 380k
  • Answers 381k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer YUI is a Javascript library. Spring is a Java application… May 14, 2026 at 10:01 pm
  • Editorial Team
    Editorial Team added an answer Ya that's rite! As Tom said, Obfuscation is the best… May 14, 2026 at 10:01 pm
  • Editorial Team
    Editorial Team added an answer I'd suggest you get rid of the NSTimer and use… May 14, 2026 at 10:01 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.