KT-2128 Code completion after number with dot - no tests for now
#KT-2128 In Progress
This commit is contained in:
@@ -144,6 +144,8 @@
|
||||
|
||||
<completion.skip implementation="org.jetbrains.jet.plugin.liveTemplates.JetLiveTemplateCompletionContributor$Skipper" id="skipLiveTemplate"/>
|
||||
|
||||
<lookup.charFilter implementation="org.jetbrains.jet.plugin.completion.JetReferenceCharFilter"/>
|
||||
|
||||
<psi.referenceContributor language="jet" order="after JetCompletionContributor" implementation="org.jetbrains.jet.plugin.references.JetReferenceContributor"/>
|
||||
|
||||
<renamePsiElementProcessor implementation="org.jetbrains.jet.plugin.refactoring.rename.RenameJetClassProcessor"/>
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright 2010-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.plugin.completion;
|
||||
|
||||
import com.intellij.codeInsight.completion.CompletionCharFilter;
|
||||
import com.intellij.codeInsight.lookup.CharFilter;
|
||||
import com.intellij.codeInsight.lookup.Lookup;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
|
||||
public class JetReferenceCharFilter extends CharFilter {
|
||||
private final static CharFilter delegate = new CompletionCharFilter();
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Result acceptChar(char c, int prefixLength, Lookup lookup) {
|
||||
final PsiFile psiFile = lookup.getPsiFile();
|
||||
if (!(psiFile instanceof JetFile)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (c == '.') {
|
||||
return Result.HIDE_LOOKUP;
|
||||
}
|
||||
|
||||
return delegate.acceptChar(c, prefixLength, lookup);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user