i18n resources code completion does not work

Hi,
I have properties files,  resource bundles with localization. When I tried code completion in this case:

getResource("<caret>")

IDEA showed me possible localization resources from properties files and string in bracets was green. This was really helpful feature in IDEA.

But once while turn on code completion in this case I saw pop-up where IDEA suggest to choose type of file or something like this. I chosen "properties files" and since this moment code completion does not work and string in bracets is bold and dark blue like a keyword.

m_fastSelectPanel.add(new JLabel(MainFrame.getResource("digits")), m_gbc);


I don't know how to disable this.
Please help me because this was really cool for me. Thanks!
Leszek

Message was edited by: Leszek Gruchala

5 comments
Comment actions Permalink

But once while turn on code completion in this case I show pop-up when IDEA suggest to choose type of file. I chosen "properties files" and since this moment code completion does not work.

Sorry, I don't understand, what have you done?

0
Comment actions Permalink

I notice that, when I put two pair of commas code completion works:

getResource("""<caret>")

Maybe this is a bug? Even people from JetBrains don't know what happen?

0
Comment actions Permalink

Property key completion works fine for me. Could you describe your
situation in more details?

0
Comment actions Permalink

Ones when I pressed Ctrl+Space in this place:

getResources("<cursor>");

InteliJ showed me a dialog. My mistake, because I didn't read it carefully, but it was something about choosing type associated with a file. I think it was about my properties files where I have internationalization. The dialog showed me a few types of file, I choose "*.properties".

At this moment when I try to use code completion for strings in "getResources()" method it doesn't work for me. Earlier inscribed methods have blue strings:

MainFrame.getResource("lenght")


It looks like a keyword now, not string. I lost code completion for this method. Probably I set something with my properties files, but I don't know what...

When I write two pair of commas:

MainFrame.getResource("""<cursor>lenght")


code completion works and string is green.

Thank you for any help

PS. Sorry, I forgot mention that getResource method looks that:

public static String getResource(final String resourceName) { String resource = null; try { resource = MESSAGES.getString(resourceName); } catch (final MissingResourceException e) { System.out.println("Cannot get resource: " + resourceName); } return resource; }


This is really funny, because code completion works for MESSAGES.getString("<cursor>")...

0

Please sign in to leave a comment.