IDEA-59783 Properties files: code completion list does not open after dot character

This commit is contained in:
peter
2012-01-12 20:32:10 +01:00
parent 670f731649
commit d59e90e8ce
3 changed files with 39 additions and 0 deletions

View File

@@ -1159,6 +1159,10 @@ class Foo {{
assert myFixture.lookupElementStrings.size() >= 2
type '.'
assert lookup
edt { myFixture.editor.caretModel.moveToOffset(myFixture.editor.document.text.indexOf('lang')) }
assert !lookup
type 'i'
assert 'io' in myFixture.lookupElementStrings
}

View File

@@ -0,0 +1,34 @@
/*
* Copyright 2000-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 com.intellij.lang.properties;
import com.intellij.codeInsight.completion.CompletionContributor;
import com.intellij.codeInsight.completion.CompletionInitializationContext;
import com.intellij.codeInsight.completion.CompletionUtil;
import com.intellij.lang.properties.psi.PropertiesFile;
import org.jetbrains.annotations.NotNull;
/**
* @author peter
*/
public class PropertiesCompletionContributor extends CompletionContributor {
@Override
public void beforeCompletion(@NotNull CompletionInitializationContext context) {
if (context.getFile() instanceof PropertiesFile) {
context.setDummyIdentifier(CompletionUtil.DUMMY_IDENTIFIER_TRIMMED);
}
}
}

View File

@@ -11,6 +11,7 @@
<applicationService serviceInterface="com.intellij.lang.properties.LastSelectedPropertiesFileStore"
serviceImplementation="com.intellij.lang.properties.LastSelectedPropertiesFileStore"/>
<annotator language="Properties" implementationClass="com.intellij.lang.properties.PropertiesAnnotator"/>
<completion.contributor language="Properties" implementationClass="com.intellij.lang.properties.PropertiesCompletionContributor"/>
<lang.refactoringSupport language="Properties" implementationClass="com.intellij.lang.properties.refactoring.PropertiesRefactoringSupportProvider"/>
<lang.documentationProvider language="Properties" implementationClass="com.intellij.lang.properties.PropertiesDocumentationProvider"/>
<lang.findUsagesProvider language="Properties"