1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-05 08:46:02 +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
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());
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) != '-')) {
if(pos >= 0){
try{
//While we aren't on a space, then go back and look for :: or a ->
while ((pos >= 0) && (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;
}
} catch ( BadLocationException ex ){
// ignore this request
return null;
}
ICCompletionProposal[] results = null;
try {