本文整理匯總了Java中com.intellij.codeInsight.completion.CompletionResultSet.stopHere方法的典型用法代碼示例。如果您正苦於以下問題:Java CompletionResultSet.stopHere方法的具體用法?Java CompletionResultSet.stopHere怎麽用?Java CompletionResultSet.stopHere使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.codeInsight.completion.CompletionResultSet
的用法示例。
在下文中一共展示了CompletionResultSet.stopHere方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addCompletions
import com.intellij.codeInsight.completion.CompletionResultSet; //導入方法依賴的package包/類
@Override
protected void addCompletions(@NotNull CompletionParameters completionParameters, ProcessingContext processingContext, @NotNull CompletionResultSet completionResultSet) {
final Project project = completionParameters.getOriginalFile().getProject();
final MuleElementDefinitionService instance = MuleElementDefinitionService.getInstance(project);
final List<MuleModuleDefinition> definitions = instance.getDefinitions();
for (MuleModuleDefinition definition : definitions) {
final List<MuleElementDefinition> elementDefinitions = definition.getElementDefinitions();
for (MuleElementDefinition elementDefinition : elementDefinitions) {
final LookupElementBuilder lookupElement =
LookupElementBuilder.create(elementDefinition.getName())
.withCaseSensitivity(false)
.withLookupString(definition.getName() + ":" + elementDefinition.getName())
.withTypeText("\t" + StringUtil.capitalizeWords(elementDefinition.getType().name().toLowerCase(), "_", true, false), true)
.withPresentableText(definition.getName() + ":" + elementDefinition.getName())
.withInsertHandler(new MuleElementInsertHandler(elementDefinition.getName(), definition.getName(), definition.getNamespace(), definition.getLocationLookup()));
completionResultSet.addElement(lookupElement);
}
}
completionResultSet.stopHere();
}
示例2: fillCompletionVariants
import com.intellij.codeInsight.completion.CompletionResultSet; //導入方法依賴的package包/類
@Override
public void fillCompletionVariants(@NotNull CompletionParameters parameters, @NotNull CompletionResultSet result) {
final boolean isMainOpenApiFile = openApiIndexService.isMainOpenApiFile(
parameters.getOriginalFile().getVirtualFile(),
parameters.getOriginalFile().getProject());
final boolean isPartialOpenApiFile = openApiIndexService.isPartialOpenApiFile(
parameters.getOriginalFile().getVirtualFile(),
parameters.getOriginalFile().getProject());
if (isMainOpenApiFile || isPartialOpenApiFile) {
final PsiElement psiElement = parameters.getPosition();
final OpenApiFileType openApiFileType = isMainOpenApiFile
? OpenApiFileType.MAIN
: openApiIndexService.getOpenApiFileType(
parameters.getOriginalFile().getVirtualFile(),
parameters.getOriginalFile().getProject());
final PathResolver pathResolver = PathResolverFactory.fromOpenApiFileType(openApiFileType);
final OpenApiCompletionHelper completionHelper = new OpenApiCompletionHelper(psiElement, yamlTraversal, pathResolver);
OpenApiFieldCompletionFactory.from(completionHelper, result)
.ifPresent(FieldCompletion::fill);
OpenApiValueCompletionFactory.from(completionHelper, getResultSetWithPrefixMatcher(parameters, result))
.ifPresent(ValueCompletion::fill);
result.stopHere();
}
}
示例3: fillCompletionVariants
import com.intellij.codeInsight.completion.CompletionResultSet; //導入方法依賴的package包/類
@Override
public void fillCompletionVariants(@NotNull CompletionParameters parameters, @NotNull CompletionResultSet result) {
final boolean isMainOpenApiFile = openApiIndexService.isMainOpenApiFile(
parameters.getOriginalFile().getVirtualFile(),
parameters.getOriginalFile().getProject());
final boolean isPartialOpenApiFile = openApiIndexService.isPartialOpenApiFile(
parameters.getOriginalFile().getVirtualFile(),
parameters.getOriginalFile().getProject());
if (isMainOpenApiFile || isPartialOpenApiFile) {
final PsiElement psiElement = parameters.getPosition();
final OpenApiFileType openApiFileType = isMainOpenApiFile
? OpenApiFileType.MAIN
: openApiIndexService.getOpenApiFileType(parameters.getOriginalFile().getVirtualFile(),
parameters.getOriginalFile().getProject());
final PathResolver pathResolver = PathResolverFactory.fromOpenApiFileType(openApiFileType);
final OpenApiCompletionHelper completionHelper = new OpenApiCompletionHelper(psiElement, jsonTraversal, pathResolver);
if (jsonTraversal.isKey(psiElement)) {
OpenApiFieldCompletionFactory.from(completionHelper, result)
.ifPresent(FieldCompletion::fill);
} else {
OpenApiValueCompletionFactory.from(completionHelper, getResultSetWithPrefixMatcher(parameters, result))
.ifPresent(ValueCompletion::fill);
}
result.stopHere();
}
}
示例4: fillCompletionVariants
import com.intellij.codeInsight.completion.CompletionResultSet; //導入方法依賴的package包/類
@Override
public void fillCompletionVariants(@NotNull CompletionParameters parameters, @NotNull CompletionResultSet result) {
final boolean isMainSwaggerFile = swaggerIndexService.isMainSwaggerFile(
parameters.getOriginalFile().getVirtualFile(),
parameters.getOriginalFile().getProject());
final boolean isPartialSwaggerFile = swaggerIndexService.isPartialSwaggerFile(
parameters.getOriginalFile().getVirtualFile(),
parameters.getOriginalFile().getProject());
if (isMainSwaggerFile || isPartialSwaggerFile) {
final PsiElement psiElement = parameters.getPosition();
final SwaggerFileType swaggerFileType = isMainSwaggerFile
? SwaggerFileType.MAIN
: swaggerIndexService.getSwaggerFileType(
parameters.getOriginalFile().getVirtualFile(),
parameters.getOriginalFile().getProject());
final PathResolver pathResolver = PathResolverFactory.fromSwaggerFileType(swaggerFileType);
final SwaggerCompletionHelper completionHelper = new SwaggerCompletionHelper(psiElement, yamlTraversal, pathResolver);
SwaggerFieldCompletionFactory.from(completionHelper, result)
.ifPresent(FieldCompletion::fill);
SwaggerValueCompletionFactory.from(completionHelper, getResultSetWithPrefixMatcher(parameters, result))
.ifPresent(ValueCompletion::fill);
result.stopHere();
}
}
示例5: fillCompletionVariants
import com.intellij.codeInsight.completion.CompletionResultSet; //導入方法依賴的package包/類
@Override
public void fillCompletionVariants(@NotNull CompletionParameters parameters, @NotNull CompletionResultSet result) {
final boolean isMainSwaggerFile = swaggerIndexService.isMainSwaggerFile(
parameters.getOriginalFile().getVirtualFile(),
parameters.getOriginalFile().getProject());
final boolean isPartialSwaggerFile = swaggerIndexService.isPartialSwaggerFile(
parameters.getOriginalFile().getVirtualFile(),
parameters.getOriginalFile().getProject());
if (isMainSwaggerFile || isPartialSwaggerFile) {
final PsiElement psiElement = parameters.getPosition();
final SwaggerFileType swaggerFileType = isMainSwaggerFile
? SwaggerFileType.MAIN
: swaggerIndexService.getSwaggerFileType(parameters.getOriginalFile().getVirtualFile(),
parameters.getOriginalFile().getProject());
final PathResolver pathResolver = PathResolverFactory.fromSwaggerFileType(swaggerFileType);
final SwaggerCompletionHelper completionHelper = new SwaggerCompletionHelper(psiElement, jsonTraversal, pathResolver);
if (jsonTraversal.isKey(psiElement)) {
SwaggerFieldCompletionFactory.from(completionHelper, result)
.ifPresent(FieldCompletion::fill);
} else {
SwaggerValueCompletionFactory.from(completionHelper, getResultSetWithPrefixMatcher(parameters, result))
.ifPresent(ValueCompletion::fill);
}
result.stopHere();
}
}
示例6: fillCompletionVariants
import com.intellij.codeInsight.completion.CompletionResultSet; //導入方法依賴的package包/類
@Override
public void fillCompletionVariants(@NotNull CompletionParameters parameters, @NotNull CompletionResultSet result) {
PsiFile file = parameters.getOriginalFile();
Document document = PsiDocumentManager.getInstance(file.getProject()).getDocument(file);
if (document != null) {
DataContext dataContext = document.getUserData(CommitMessage.DATA_CONTEXT_KEY);
if (dataContext != null) {
result.stopHere();
if (parameters.getInvocationCount() > 0) {
ChangeList[] lists = VcsDataKeys.CHANGE_LISTS.getData(dataContext);
if (lists != null) {
String prefix = TextFieldWithAutoCompletionListProvider.getCompletionPrefix(parameters);
CompletionResultSet insensitive = result.caseInsensitive().withPrefixMatcher(new CamelHumpMatcher(prefix));
for (ChangeList list : lists) {
for (Change change : list.getChanges()) {
ContentRevision revision = change.getAfterRevision() == null ? change.getBeforeRevision() : change.getAfterRevision();
if (revision != null) {
FilePath filePath = revision.getFile();
LookupElementBuilder element = LookupElementBuilder.create(filePath.getName()).
withIcon(filePath.getFileType().getIcon());
insensitive.addElement(element);
}
}
}
}
}
}
}
}
示例7: fillCompletionVariants
import com.intellij.codeInsight.completion.CompletionResultSet; //導入方法依賴的package包/類
@Override
public void fillCompletionVariants(@NotNull CompletionParameters parameters, @NotNull CompletionResultSet result) {
PsiFile file = parameters.getOriginalFile();
if (!(file instanceof PsiPlainTextFile)) return;
TextFieldCompletionProvider field = file.getUserData(TextFieldCompletionProvider.COMPLETING_TEXT_FIELD_KEY);
if (field == null) return;
if (!(field instanceof DumbAware) && DumbService.isDumb(file.getProject())) return;
String text = file.getText();
int offset = Math.min(text.length(), parameters.getOffset());
String prefix = field.getPrefix(text.substring(0, offset));
CompletionResultSet activeResult;
if (!result.getPrefixMatcher().getPrefix().equals(prefix)) {
activeResult = result.withPrefixMatcher(prefix);
}
else {
activeResult = result;
}
if (field.isCaseInsensitivity()) {
activeResult = activeResult.caseInsensitive();
}
field.addCompletionVariants(text, offset, prefix, activeResult);
activeResult.stopHere();
}
示例8: fillCompletionVariants
import com.intellij.codeInsight.completion.CompletionResultSet; //導入方法依賴的package包/類
@Override
public void fillCompletionVariants(@NotNull CompletionParameters parameters, @NotNull CompletionResultSet result) {
final Editor editor = parameters.getEditor();
final TemplateState state = TemplateManagerImpl.getTemplateState(editor);
if (state != null) {
if (editor.getUserData(InplaceRefactoring.INPLACE_RENAMER) != null && parameters.getInvocationCount() == 0) {
result.stopHere();
}
}
}