Giter VIP home page Giter VIP logo

Comments (5)

bchavez avatar bchavez commented on May 18, 2024

Hi @levipage,

Well, that's hella-annoying. Can you please file a connect bug with the people at Microsoft? Be sure to have them checkout Bogus v9.0.1. This indeed seems like an issue with Visual Studio's IntelliSense.

I suspect what's happening is Visual Studio can't figure out the type information yet when it's confronted with:

.RuleFor<TProperty>(Expression<Func<T, TProperty>> property, Func<Faker, T, TProperty> setter)
.RuleFor<TProperty>(Expression<Func<T, TProperty>> property, Func<Faker, TProperty> setter )
.RuleFor<TProperty>(Expression<Func<T, TProperty>> property, Func<TProperty> valueFunction)

Sooo, soon as you type , VS probably finally narrows down enough type information once the first argument to RuleFor is closed off with ,.

Who knows. I'm using Resharper's IntelliSense and Resharper does not have this problem. So it's most definitely Visual Studio.

I seem to have an API work around: Simply defining a dummy API call with only one Expression<Func<T,TProp>> seems kick Visual Studio IntelliSense into gear:

/// <summary>
/// Visual Studio IntelliSense Work Around. See Issue 54: https://github.com/bchavez/Bogus/issues/54
/// </summary>
[Obsolete("Visual Studio IntelliSense Work Around", true)]
public void RuleFor<TProperty>(Expression<Func<T, TProperty>> property)
{
    throw new NotImplementedException();
}

Releasing shortly. Thanks for bringing this to my attention and please don't forget to file this on Microsoft Connect. https://connect.microsoft.com/visualstudio

Thanks,
Brian


💨 🚶 "Bubbles of gas in my brain... Send me off balance, it's not enough"

from bogus.

bchavez avatar bchavez commented on May 18, 2024

@levipage , can you please give Bogus v9.0.2 a try and see if it resolves your issue?

Please feel free to re-open the issue if the problem persists.

Thanks,
Brian

from bogus.

levipage avatar levipage commented on May 18, 2024

Awesome support man. Impressive also that you were even able to make a workaround for the issue. It is working now!

from bogus.

pr185193 avatar pr185193 commented on May 18, 2024

why is this still not working? 2017? Why do I have to install some extra for VS Code to work?

from bogus.

pr185193 avatar pr185193 commented on May 18, 2024

Bogus is on version thirty something, do i just download the latest and restart VS Code?

from bogus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.