<commit_before>package com.cedricziel.idea.typo3.codeInsight;

import com.cedricziel.idea.typo3.index.TranslationIndex;
import com.intellij.codeInsight.completion.*;
import com.intellij.codeInsight.lookup.LookupElementBuilder;
import com.intellij.openapi.project.Project;
import com.intellij.patterns.PlatformPatterns;
import com.intellij.psi.PsiElement;
import com.intellij.util.ProcessingContext;
import com.intellij.util.indexing.FileBasedIndex;
import com.jetbrains.php.lang.psi.elements.StringLiteralExpression;
import org.jetbrains.annotations.NotNull;

import java.util.Collection;

public class TranslationCompletionContributor extends CompletionContributor {
    public TranslationCompletionContributor() {
        extend(
                CompletionType.BASIC,
                PlatformPatterns.psiElement().withParent(PlatformPatterns.psiElement(StringLiteralExpression.class)),
                new CompletionProvider<CompletionParameters>() {
                    @Override
                    protected void addCompletions(@NotNull CompletionParameters parameters, ProcessingContext context, @NotNull CompletionResultSet result) {
                        PsiElement position = parameters.getPosition();
                        Project project = position.getProject();
                        PsiElement parent = position.getParent();

                        String currentText = parent.getText();
                        if (project.getBasePath() == null || !currentText.contains("LLL:")) {
                            return;
                        }

                        Collection<String> allKeys = FileBasedIndex.getInstance().getAllKeys(TranslationIndex.KEY, project);
                        allKeys
                                .parallelStream()
                                .forEach(id -> {
                            LookupElementBuilder element = LookupElementBuilder
                                    .create(id)
                                    .bold()
                                    .withPresentableText(id.split(":")[3])
                                    .withTailText(id.split(":")[2], true);
                            result.addElement(element);
                        });
                    }
                }
        );
    }
}<commit_msg>Give a little more space between translation id and resource path<commit_after>package com.cedricziel.idea.typo3.codeInsight;

import com.cedricziel.idea.typo3.index.TranslationIndex;
import com.intellij.codeInsight.completion.*;
import com.intellij.codeInsight.lookup.LookupElementBuilder;
import com.intellij.openapi.project.Project;
import com.intellij.patterns.PlatformPatterns;
import com.intellij.psi.PsiElement;
import com.intellij.util.ProcessingContext;
import com.intellij.util.indexing.FileBasedIndex;
import com.jetbrains.php.lang.psi.elements.StringLiteralExpression;
import org.jetbrains.annotations.NotNull;

import java.util.Collection;

public class TranslationCompletionContributor extends CompletionContributor {
    public TranslationCompletionContributor() {
        extend(
                CompletionType.BASIC,
                PlatformPatterns.psiElement().withParent(PlatformPatterns.psiElement(StringLiteralExpression.class)),
                new CompletionProvider<CompletionParameters>() {
                    @Override
                    protected void addCompletions(@NotNull CompletionParameters parameters, ProcessingContext context, @NotNull CompletionResultSet result) {
                        PsiElement position = parameters.getPosition();
                        Project project = position.getProject();
                        PsiElement parent = position.getParent();

                        String currentText = parent.getText();
                        if (project.getBasePath() == null || !currentText.contains("LLL:")) {
                            return;
                        }

                        Collection<String> allKeys = FileBasedIndex.getInstance().getAllKeys(TranslationIndex.KEY, project);
                        allKeys
                                .parallelStream()
                                .forEach(id -> {
                                    LookupElementBuilder element = LookupElementBuilder
                                            .create(id)
                                            .withPresentableText(id.split(":")[3])
                                            .withTypeText(id.split(":")[2], true);
                                    result.addElement(element);
                                });
                    }
                }
        );
    }
}
{'fraction_non_alphanumeric': 0.0832258064516129, 'fraction_numerical': 0.0017204301075268817, 'mean_word_length': 1.7635175282234106, 'pattern_counts': {'":': 4, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '144644', 'n_tokens_mistral': 1084, 'n_tokens_neox': 1007, 'n_words': 169}