Comments (6)
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.
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.
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.
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.
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.
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)
- Add case statements for enumeration in switch HOT 2
- Add Declaration doesn't including "static" keyword. HOT 2
- Move Implementations from Class header to source file HOT 1
- 'Add definition in this file' should not always add 'inline' when declaration is in CPP HOT 2
- Allow adding header guard relative to repo HOT 1
- Create matching header/source if not found
- Update function signature - option to keep parameter names in definition and declaration in sync
- [Feature] Extract code block to function/method HOT 1
- Weird double lines when using CRLF line endings
- C++ code is not detected. HOT 1
- [Feature] Create create no-args / required-args / all-args constructor
- "Add definition in xxx.cpp" doesn't work for template functions HOT 1
- Refactoring (Add Definition) began to work strangely. I can't find the reason HOT 7
- [Feature Request] CopyConstructor / assigment operator HOT 2
- [Bug] If I use the terminal after installing the extension, CPU usage increases abnormally.
- [Feature request] Please add UUID as a header guard component
- [Bug] Does not generate matching functions correctly HOT 9
- [BUG] Update function declaration doesn't follow `using` declarations.
- Getter/setter customization HOT 1
- Availability in gitpod - not registered at open-vsx.org
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-cmantic.