mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix for bug#55764
This commit is contained in:
parent
0f799bb0a8
commit
d49160f8ff
2 changed files with 21 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
||||||
2004-04-16 Hoda Amer
|
2004-04-16 Hoda Amer
|
||||||
Fix for bug#58563 : [RenameRefactoring] renaming #include statements
|
Fix for bug#58563 : [RenameRefactoring] renaming #include statements
|
||||||
|
Fix for bug#55764 : [Content Assist] trigger needs more then one character per trigger
|
||||||
|
|
||||||
2004-04-15 Alain Magloire
|
2004-04-15 Alain Magloire
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ import org.eclipse.cdt.ui.IWorkingCopyManager;
|
||||||
import org.eclipse.cdt.ui.text.ICCompletionProposal;
|
import org.eclipse.cdt.ui.text.ICCompletionProposal;
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
import org.eclipse.jface.preference.IPreferenceStore;
|
import org.eclipse.jface.preference.IPreferenceStore;
|
||||||
|
import org.eclipse.jface.text.BadLocationException;
|
||||||
import org.eclipse.jface.text.IDocument;
|
import org.eclipse.jface.text.IDocument;
|
||||||
import org.eclipse.jface.text.ITextViewer;
|
import org.eclipse.jface.text.ITextViewer;
|
||||||
import org.eclipse.jface.text.contentassist.ContextInformation;
|
import org.eclipse.jface.text.contentassist.ContextInformation;
|
||||||
|
@ -228,7 +229,7 @@ public class CCompletionProcessor implements IContentAssistProcessor {
|
||||||
public String getErrorMessage() {
|
public String getErrorMessage() {
|
||||||
if (fNumberOfComputedResults == 0) {
|
if (fNumberOfComputedResults == 0) {
|
||||||
String errorMsg= resultCollector.getErrorMessage();
|
String errorMsg= resultCollector.getErrorMessage();
|
||||||
if (errorMsg == null || errorMsg.trim().length() == 0)
|
if (errorMsg == null || errorMsg.length() == 0)
|
||||||
errorMsg= CUIMessages.getString("CEditor.contentassist.noCompletions"); //$NON-NLS-1$
|
errorMsg= CUIMessages.getString("CEditor.contentassist.noCompletions"); //$NON-NLS-1$
|
||||||
return errorMsg;
|
return errorMsg;
|
||||||
}
|
}
|
||||||
|
@ -325,6 +326,24 @@ public class CCompletionProcessor implements IContentAssistProcessor {
|
||||||
IWorkingCopy unit = fManager.getWorkingCopy(fEditor.getEditorInput());
|
IWorkingCopy unit = fManager.getWorkingCopy(fEditor.getEditorInput());
|
||||||
|
|
||||||
IDocument document = viewer.getDocument();
|
IDocument document = viewer.getDocument();
|
||||||
|
// check for :: and ->
|
||||||
|
int pos = offset -1;
|
||||||
|
try{
|
||||||
|
//While we aren't on a space, then go back and look for :: or a ->
|
||||||
|
while(document.getChar(pos) == ' ') {
|
||||||
|
pos--;
|
||||||
|
}
|
||||||
|
if ((document.getChar(pos) == ':') && (document.getChar(pos -1) != ':')) {
|
||||||
|
// ignore this request
|
||||||
|
return null;
|
||||||
|
} else if ((document.getChar(pos) == '>') && (document.getChar(pos - 1) != '-')) {
|
||||||
|
// ignore this request
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} catch ( BadLocationException ex ){
|
||||||
|
// ignore this request
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
ICCompletionProposal[] results = null;
|
ICCompletionProposal[] results = null;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue