ChooseByNameContributor and current Module

in ChooseByNameContributor#getNames(Project project, boolean b) the following code


sometimes

a) returns

b) or crashes with StackOverflow

Is there a better way to determine the current module?

Thanks,
Yann

3 comments

Hello Yann,

YC> in ChooseByNameContributor#getNames(Project project, boolean b) the
YC> following code
YC>
YC>

 DataManager.getInstance().getDataContext().getData(DataConstants.MOD
YC> ULE); ]]>

YC>
YC> sometimes
YC>
YC> a) returns

YC> b) or crashes with StackOverflow
YC> Is there a better way to determine the current module?

Why do you need that? The choose by name lists work on project level, not
module level, so there is not clear which module should be "current" for
them.

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"


0

Hi,

I need to find out the module of the current file, i.e. the editor where GoToSymbol was invoked.

It works the first time, but not on subsequent invocations (typing again, so IDEA queries again).

Helped myself by caching the module on first run and ignoring it later on.

Cheers,
Yann

0

Yann Cebron wrote:

Hi,

I need to find out the module of the current file, i.e. the editor where GoToSymbol was invoked.

It works the first time, but not on subsequent invocations (typing again, so IDEA queries again).

Helped myself by caching the module on first run and ignoring it later on.

Cheers,
Yann


It sounds like a better idea would be to query the editor manager for the
currently open editor(s) and use their modules.

0

Please sign in to leave a comment.