1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-08 08:45:44 +02:00

Revert "Bug 459186 - Index read locks are leaking"

This reverts commit dc08061cc6.
This commit is contained in:
Sergey Prigogin 2015-02-06 14:12:02 -08:00
parent a424fc6329
commit 9de6de9fd4
2 changed files with 8 additions and 18 deletions

View file

@ -272,15 +272,11 @@ public class SurroundWithTemplateMenuAction implements IWorkbenchWindowPulldownD
TemplateCompletionProposalComputer templateComputer = new TemplateCompletionProposalComputer();
CContentAssistInvocationContext context = new CContentAssistInvocationContext( editor.getViewer(), textSelection.getOffset(), editor, true, false );
try {
List<ICompletionProposal> proposals= templateComputer.computeCompletionProposals(context, null);
if (proposals == null || proposals.isEmpty())
return null;
return getActionsFromProposals(proposals, context.getInvocationOffset(), editor.getViewer());
} finally {
context.dispose();
}
}
private static ITextSelection getTextSelection(CEditor editor) {

View file

@ -358,19 +358,13 @@ public class ParameterGuessingProposal extends FunctionCompletionProposal {
}
/**
* Returns a list of functions and variables that are defined in the current context.
* Returns a list of functions and variables that are defined in current context.
* @return a list of assignable elements.
*/
private List<IBinding> getAssignableElements() {
int i = getStatementStartOffset(fContext.getDocument(), getStatementStartOffset());
CContentAssistInvocationContext context =
new CContentAssistInvocationContext(fTextViewer, i, getCEditor(), true, false);
IASTCompletionNode node;
try {
node = context.getCompletionNode();
} finally {
context.dispose();
}
CContentAssistInvocationContext c = new CContentAssistInvocationContext(fTextViewer, i, getCEditor(), true, false);
IASTCompletionNode node = c.getCompletionNode();
IASTName[] names = node.getNames();
List<IBinding> allBindings = new ArrayList<>();
for (IASTName name : names) {