Git Product home page Git Product logo

Comments (6)

BigBahss avatar BigBahss commented on August 25, 2024

I like this, but I can't think of a good way to implement it. Since there's no requirement that members be initialized in the initializer list, it would be difficult to know when the user added a new member and forgot to add it to an initializer list. I wouldn't want the light-bulb to pop up for every member that doesn't appear in every initializer list (which also seems like it would be a lot of unnecessary background analysis).

Also, I'm just curious if you've been following recent commits to master, because the next version is going to have a 'Generate Constructor' feature which will generate the boiler-plate for the initializer list. Just wondering if these suggestions are coincidences or in response to that feature.

from vscode-cmantic.

Wastus avatar Wastus commented on August 25, 2024

I haven't looked at the commits, it's just that I'm coming from VS2019 + Resharper Ultimate and I'm looking for some features I often used in Resharper. So far your extension is the most active one moving in the direction to become Resharper for VS Code. So I'm throwing my things at you :-)

I liked this because (not very often but it happens) sometimes the standard initializer is not what I intended and then I have a silly bug because my initial value was wrong. So for me, it is a helping hand not to forget these things.

from vscode-cmantic.

BigBahss avatar BigBahss commented on August 25, 2024

I've never heard of Resharper, I'll have to look into that (lately I've been looking at CLion for inspiration). I'm glad you've found my extension to be useful!

I'll have to think about a good way to implement this. I'm also wondering if this is something that could caught by compiler warnings or a static analysis tool like clang-tidy. While those things might not be able to auto-fix the issue, they might be better suited for this problem. I'll look into Resharper to get some idea on how it might be done.

from vscode-cmantic.

Wastus avatar Wastus commented on August 25, 2024

Resharper is also from Jetbrains. I don't think it offers features over CLion, but I haven't used CLion myself, so just an educated guess. It's origin is for C# but later C++ features were added. So it really could be, that I'm seeing a clangd or clang-tidy message here. I'll have to research which module emits those messages.
I can have a look tomorrow, maybe I should try and set-up clang-tidy as well, I've just spotted an extension for that as well...

The compilers we are using (embedded stuff) don't complain about missing initializers on any setting, so those won't help in my case.

from vscode-cmantic.

Wastus avatar Wastus commented on August 25, 2024

Okay I just checked with my Resharper installation, it is indeed a clang-tidy rule which covers this. So if there is an extension that covers this, there isn't really a need to reinvent the wheel.

from vscode-cmantic.

BigBahss avatar BigBahss commented on August 25, 2024

I just got done researching this myself, not realizing you already found it haha. It looks like this is the rule, and apparently it can auto-fix. I really ought to learn clang-tidy, it seems very useful. I'll close this.

from vscode-cmantic.

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.