parent
80ae80dc54
commit
6c5f06f461
@ -3,6 +3,10 @@
|
|||||||
# easy-i18n Changelog
|
# easy-i18n Changelog
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
### Fixed
|
||||||
|
- NullPointerException on key completion
|
||||||
|
|
||||||
|
## [1.6.0]
|
||||||
### Added
|
### Added
|
||||||
- The search function now supports full-text-search
|
- The search function now supports full-text-search
|
||||||
- Automatically reload translation data on file system change
|
- Automatically reload translation data on file system change
|
||||||
|
@ -38,10 +38,6 @@ public class KeyCompletionProvider extends CompletionProvider<CompletionParamete
|
|||||||
|
|
||||||
String path = result.getPrefixMatcher().getPrefix();
|
String path = result.getPrefixMatcher().getPrefix();
|
||||||
|
|
||||||
if(pathPrefix == null) {
|
|
||||||
pathPrefix = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
if(path.startsWith(pathPrefix)) {
|
if(path.startsWith(pathPrefix)) {
|
||||||
path = path.substring(pathPrefix.length());
|
path = path.substring(pathPrefix.length());
|
||||||
|
|
||||||
@ -77,12 +73,15 @@ public class KeyCompletionProvider extends CompletionProvider<CompletionParamete
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
Translation translation = store.getData().getTranslation(key);
|
Translation translation = store.getData().getTranslation(key);
|
||||||
String content = translation.get(previewLocale);
|
|
||||||
|
|
||||||
result.addElement(LookupElementBuilder.create(pathPrefix + key)
|
if(translation != null) {
|
||||||
.withIcon(AllIcons.Actions.PreserveCaseHover)
|
String content = translation.get(previewLocale);
|
||||||
.appendTailText(" I18n(" + previewLocale + ": " + content + ")", true)
|
|
||||||
);
|
result.addElement(LookupElementBuilder.create(pathPrefix + key)
|
||||||
|
.withIcon(AllIcons.Actions.PreserveCaseHover)
|
||||||
|
.appendTailText(" I18n(" + previewLocale + ": " + content + ")", true)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user