1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 17:26:01 +02:00

Content Assist fixes

This commit is contained in:
Hoda Amer 2004-04-21 20:23:34 +00:00
parent 688e94b21b
commit cf31f83443
2 changed files with 18 additions and 13 deletions

View file

@ -1,3 +1,6 @@
2004-04-21 Hoda Amer
Fix for bug#52823 : Content Assist: No completions available inside an empty document.
2004-04-21 Bogdan Gheorghe 2004-04-21 Bogdan Gheorghe
Fixed external markers not working with new Search UI problem. Fixed external markers not working with new Search UI problem.

View file

@ -326,25 +326,27 @@ 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 -> // check for :: and ->
int pos = offset -1; int pos = offset -1;
try{ if(pos >= 0){
//While we aren't on a space, then go back and look for :: or a -> try{
while(document.getChar(pos) == ' ') { //While we aren't on a space, then go back and look for :: or a ->
pos--; while ((pos >= 0) && (document.getChar(pos) == ' ')) {
} pos--;
if ((document.getChar(pos) == ':') && (document.getChar(pos -1) != ':')) { }
// ignore this request if ((document.getChar(pos) == ':') && (document.getChar(pos -1) != ':')) {
return null; // ignore this request
} else if ((document.getChar(pos) == '>') && (document.getChar(pos - 1) != '-')) { return null;
} else if ((document.getChar(pos) == '>') && (document.getChar(pos - 1) != '-')) {
// ignore this request
return null;
}
} catch ( BadLocationException ex ){
// ignore this request // ignore this request
return null; return null;
} }
} catch ( BadLocationException ex ){
// ignore this request
return null;
} }
ICCompletionProposal[] results = null; ICCompletionProposal[] results = null;
try { try {