Giter Site home page Giter Site logo

Comments (3)

fdinardo avatar fdinardo commented on July 18, 2024

I have figured it out.
Inside this file declarationInfo.ts the method getProperties uses a RegExp to split the property line definition by fields. This RegExp doesn't matches two common scenarios:

a. public virtual Person _Person
b. public int? Size

Since the item.type and item.name are initialized to results[1] and results[2] respectively, the scenario a makes to match Virtual as type and Person as name.
For the scenario b is different: the ? is a special char so the regexp doesn't match at all.

The fix is easy:
we could replace this line:

let propRegExp = /public\s(\w*<?\w+>?)\s(\w+)/g;

to

let propRegExp = /public\s(?:virtual\s)?(\w*<?\w+>?\??)\s(\w+)/g;

here we can test the regexp: newRegExp

For the scenario b the new regExp works great because it shows the ? as well, which notify the developer that this field is <Nullable>
I'm really sorry to not be able to make this change by myself. I tried to clone the project and run it in debug mode, but I'm not able to achieve this.
I'm so sorry.

p.s. If someone can help me to get it done I will appreciate. I really love this plugin, I think it's a shame for Microsoft to not fully support Razors and tag-helpers with visual studio code. I have a lot of problem formatting razor file as well.

from aspnet-helper.

fdinardo avatar fdinardo commented on July 18, 2024

Finally, I made a pull request #12
I hope this will be merged.

from aspnet-helper.

schneiderpat avatar schneiderpat commented on July 18, 2024

Hey :)
I merged the pull request.

from aspnet-helper.

Related Issues (17)

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.