Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Tab completion defects

オープン
#21,176 コメント 1 件 リアクション 2 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@devajithvs がすでに取り組んでいます。

2026年2月6日 から。

評価

この issue はまだ評価されていません。

説明

bug improvement in:Core Libraries JIRA

Currently, tab-completion has a few issues.

  • Prompt autocomplete should treat smart pointers as pointers, not as generic classes (was #22019)
  • Autocompletion of typedef
  • Autocompletion of templates
  • Tab completion "leaks" private members
  • Tab Completion includes entities from namespaces due to GMI
  • Cannot tab-complete extern "C" functions
  • Tab completion and TClass::GetListOfAllPublicMethods include hidden methods from base-classes

Prompt autocomplete should treat smart pointers as pointers, not as generic classes (was #22019)

In the ROOT interactive prompt, if you have a smart pointer foo, type foo-> and hit Tab, the autocomplete function will change the -> into a . and say:

"foo" is not of pointer type. Use this operator: .

This is almost always an undesirable behavior when dealing with smart pointers, as it's far more common to want to autocomplete with the inner object's methods/fields rather than the smart pointer's own ones.

Proposed change: change the prompt behavior to treat specially unique_ptr, shared_ptr and weak_ptr (or perhaps in general all classes that define operator->?) so that it autocompletes the referenced object's methods and fields.

Autocompletion of typedefs

The ROOT prompt doesn't consider typedef/using for the tab completion. It would be nice if it did.

Reproduce in the prompt with

root [0] using FooBar = TObject;
root [1] Foo<Tab>

Forum post: https://root-forum.cern.ch/t/cling-discover-typedef-and-using-instructions/64634

Autocompletion of templates

root [0] gROOT->GetListOfFunctionTemplates()->Add(new TNamed("foobar", "foobar()"))
root [13] foob<TAB>

(was https://its.cern.ch/jira/browse/ROOT-10141)

Tab completion "leaks" private members

For the following class definition

class A {
public:
   int x; 
};
class B : public A {
private:
   using A::x;
};

the tab completion of b. of an object B b; shows x. Normally, private data members are not shown though.
(was #10535)

Tab Completion includes entities from namespaces due to GMI

TH1DModel, TProfile1DModel, TProfile2DModel, TObjectHolder, TObjectItem are in namespaces and should not be completed unless using namespace is specified.
(was https://its.cern.ch/jira/browse/ROOT-10989)

Cannot tab-complete extern "C" functions

root [1] extern "C" int funcToTestAutoComp();
root [2] int funcToTestAutoCompB(int);
root [3] funcToTestAutoCompB(

Note how funcToTestAutoComp is not seen as an option.

Tab completion and TClass::GetListOfAllPublicMethods include hidden methods from base-classes

This might be (somewhat) related to ROOT-5660.
Consider a class "CBTRefArray" inheriting from the well-known TRefArray.
In this class, I re-define GetPID:

TProcessID *CBTRefArray::GetPID(Int_t at) const { ... };

The number of arguments is different (TRefArray::GetPID has none), so the function from baseclass is hidden.

Now, I do:

root [0] CBTRefArray foo;
root [1] foo.GetPID( <TAB pressed>
TProcessID* GetPID() const
TProcessID* GetPID(Int_t at) const

So the hidden function is listed here (which I think should not be the case).
Let's try to be naïve and just call it:

root [1] foo.GetPID()
ROOT_prompt_1:1:12: error: too few arguments to function call, single argument 'at' was not specified
foo.GetPID()
~~~~~~~~~~ ^
/somepath/to/sources/CBTRefArray.h:29:2: note: 'GetPID' declared here
        TProcessID *GetPID(Int_t at) const;
        ^
root [2]

Nice error output with wonderful markup, as expected.

I actually found this issue in compiled code, where I iterate over the GetListOfAllPublicMethods() from CBTRefArray::Class() which contains both GetPID() and GetPID(Int_t) which is the same issue.
(was https://its.cern.ch/jira/browse/ROOT-6436)

主要言語
C++
スター
3.3k
フォーク
1.6k
平均マージ
2日 16時間
マージ済み PR(30日)
194

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

root-project/root のほかの issue

root-project/root の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。