Author Topic: CodeCompletion Token Replacements Config  (Read 8985 times)

Offline daniloz

  • Regular
  • ***
  • Posts: 268
CodeCompletion Token Replacements Config
« on: November 10, 2011, 12:10:59 pm »
Hi All,

I've just figured out that I cannot get rid of the default Token Replacements for the Code Completion plugin.
Even if I delete all of them, after a restart from C::B they're back. :o

Actually, I've traced the bug to a hard-coded addition of them all again in src/plugins/codecompletion/codecompletion.cpp, lines 500-526.

I think this addition should only be done in case token_replacements is not found in the config file in
Code
cfg->Read(_T("token_replacements"), &repl);


Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9699
Re: CodeCompletion Token Replacements Config
« Reply #1 on: November 10, 2011, 02:19:15 pm »
I've just figured out that I cannot get rid of the default Token Replacements for the Code Completion plugin.
Even if I delete all of them, after a restart from C::B they're back. :o
As a workaround you could replace something with the same. Then this does not happen.

Code
cfg->Read(_T("token_replacements"), &repl);
Yes, probably. But leaving the default token replacement is actually a good thing to do, because otherwise for certain compiler CC is broken. I guess that's why it's implemented that way.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline daniloz

  • Regular
  • ***
  • Posts: 268
Re: CodeCompletion Token Replacements Config
« Reply #2 on: November 10, 2011, 02:39:37 pm »
I've just figured out that I cannot get rid of the default Token Replacements for the Code Completion plugin.
Even if I delete all of them, after a restart from C::B they're back. :o
As a workaround you could replace something with the same. Then this does not happen.
Yeah, that's fine and no problem for me actually.
I just thing it's annoying for the user if he or she deletes an entry and it's there again the next time.

Code
cfg->Read(_T("token_replacements"), &repl);
Yes, probably. But leaving the default token replacement is actually a good thing to do, because otherwise for certain compiler CC is broken. I guess that's why it's implemented that way.
That's why I suggested a default value, in case the user has no tokens defined.
Or, if it's just essential to the CC, it should be done in the background, without the user knowledge, so it doesn't look like he or she could change it.

Anyway, just my 2 cents...