Is there a better cpp ide support?


#1

To the developers no offense but this package is quite terrible ide-cpp

As I have posted an issue on Github let me quote.

```
#include

using namespace std;

int main()
{
_ std::cout << “/* message */” << ‘\n’;_
}

```

Here is my code.

As soon as I start typing out cout I would get a suggestion to autofill, when I do this is what I get

std::cout << "/* message */" << '\n';

Seriously, if I am already using the namespace std, why does it insist on autofilling this out std::

Here is another issue. If I am creating the main function, when I type this int main I get a “helpful” suggestion for it to autofill when I allow it to this is what I get.

_ _int int main(int argc, char const *argv[]) {_ _ /* code */_ _ return 0;_ _}_ _

Notice how there are two int keywords and it randomly has this bit of information int argc, char const *argv[] inside the parenthesis.

All I am saying is that I wish that this was a little smarter. If I have already typed int keyword once, it does not have to create it again and the same thing goes for cout. It should realise if I have declared the std namespace above or not.

So, is there another package that is supposed to do a better job compared to this package?

Plus it looks abandoned so I need something new.


#2

Are you absolutely sure this is an autocomplete suggestion from ide-cpp? Because it looks exactly like this snippet in language-c. Autocomplete suggestions are usually limited to function signatures and keywords.

Seriously, if I am already using the namespace std, why does it insist on autofilling this out std::

Because that’s what’s hard-coded in the snippet. Snippets are not smart, by design. They’re just blocks of code that get dropped into your document in place of short words.

Here is another issue. If I am creating the main function, when I type this int main I get a “helpful” suggestion for it to autofill when I allow it to this is what I get.

_ _int int main(int argc, char const *argv[]) {_ _ /* code */_ _ return 0;_ _}_ _

Notice how there are two int keywords and it randomly has this bit of information int argc, char const *argv[] inside the parenthesis.

And that’s this snippet.

All I am saying is that I wish that this was a little smarter. If I have already typed int keyword once, it does not have to create it again and the same thing goes for cout. It should realise if I have declared the std namespace above or not.

As you can see in the file I’ve linked to, the second snippet triggers on a prefix of main(). You don’t have to type int at all, just main(), since it’s typical for the main function to return an integer.

Plus it looks abandoned so I need something new.

As mentioned in the ide-cpp readme, that package is merely an interface between Atom and clangd, which is what actually does any completions and diagnostics and is actively being developed. ide-cpp doesn’t need to change frequently in order to act as a bridge.


#3

Unfortunately this is what auto fills out for me.

How is Visual Studio (not Visual Studio Code) smarter than? Is it possible to use something different.

I understand what you mean, however what I am suggesting is that I wish it was smarter like Visual Studio if it is possible?


#4

The tab key is used for both snippets and autocomplete-plus, by default. If you want to check out what suggestions are available with no interference from the installed snippets, you can disable the snippets package (or just its keybindings) through the Settings -> Packages view.

How is Visual Studio (not Visual Studio Code) smarter than?

How is proprietary software developed by one of the market share leaders in personal computing smarter than open-source software developed as a side project by a version control SAAS provider? Resources.

Is it possible to use something different.

Well, we haven’t verified that ide-cpp doesn’t do what you want, because you’ve only been using snippets so far. But you could also try autocomplete-clang.

I understand what you mean, however what I am suggesting is that I wish it was smarter like Visual Studio if it is possible?

It is not possible for snippets to be smarter. The autocomplete functionality is the smart code suggestion. Snippets are just blocks of code that get dropped in. You shouldn’t continue to use the snippets if you don’t want what snippets offer (which is to predictably drop in a bunch of boilerplate code).


#5

Note that autocomplete relies on the snippets package for the expansions where you can set cursor position and such. Better would be to disable the keybindings instead.

Having said that, I believe @joe023 is talking about the autocomplete popup anyway, in which case they are being displayed via autocomplete-snippets. So there are several “issues” here that require more time to properly explain and understand. The short answer would be to just use VS Code though, if it does everything you want anyway.


#6

Good to know. I hadn’t run into that.

Having said that, I believe @joe023 is talking about the autocomplete popup anyway, in which case they are being displayed via autocomplete-snippets.

Sure, but they’ll be activated the same way in the same context, even if they aren’t being displayed.