Skip to content

Commit

Permalink
more work on cpp completion manager
Browse files Browse the repository at this point in the history
  • Loading branch information
jjallaire committed Nov 16, 2012
1 parent 6af7278 commit 8f3d674
Show file tree
Hide file tree
Showing 5 changed files with 284 additions and 25 deletions.
@@ -1,5 +1,5 @@
/*
* HistoryPopupPanel.java
* CompletionListPopupPanel.java
*
* Copyright (C) 2009-12 by RStudio, Inc.
*
Expand All @@ -18,10 +18,10 @@
import org.rstudio.core.client.events.SelectionCommitHandler;
import org.rstudio.core.client.widget.ThemedPopupPanel;

public class HistoryPopupPanel extends ThemedPopupPanel
public class CompletionListPopupPanel extends ThemedPopupPanel
implements HasSelectionCommitHandlers<String>
{
public HistoryPopupPanel(String[] entries)
public CompletionListPopupPanel(String[] entries)
{
super(true);
list_ = new CompletionList<String>(entries, 10, false, true);
Expand Down
@@ -0,0 +1,19 @@
/*
* CompletionUtils.java
*
* Copyright (C) 2009-12 by RStudio, Inc.
*
* This program is licensed to you under the terms of version 3 of the
* GNU Affero General Public License. This program is distributed WITHOUT
* ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT,
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the
* AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details.
*
*/

package org.rstudio.studio.client.workbench.views.console.shell.assist;

public class CompletionUtils
{

}
Expand Up @@ -135,15 +135,15 @@ public void onResponseReceived(RpcObjectList<HistoryEntry> resp)

if (resp.length() == 0)
{
popup_ = new HistoryPopupPanel(new String[0]);
popup_ = new CompletionListPopupPanel(new String[0]);
popup_.setText("(No matching commands)");
}
else
{
String[] entries = new String[resp.length()];
for (int i = 0; i < entries.length; i++)
entries[i] = resp.get(entries.length - i - 1).getCommand();
popup_ = new HistoryPopupPanel(entries);
popup_ = new CompletionListPopupPanel(entries);
}

popup_.setMaxWidth(input_.getBounds().getWidth());
Expand Down Expand Up @@ -189,7 +189,7 @@ public boolean previewKeyPress(char charCode)
return false;
}

private HistoryPopupPanel popup_;
private CompletionListPopupPanel popup_;
private final InputEditorDisplay input_;
private final HistoryServerOperations server_;
private final Invalidation historyRequestInvalidation_ = new Invalidation();
Expand Down
Expand Up @@ -389,14 +389,14 @@ private void updateLanguage(boolean suppressCompletion)
new Filter(),
fileType_.canExecuteChunks() ? rnwContext_ : null);
}
/*
else if (fileType_.isCpp())
{
completionManager = new CppCompletionManager(
this,
this,
new CompletionPopupPanel(),
new Filter());
completionManager = new CppCompletionManager(this,
this,
new Filter());
}
*/
else
completionManager = new NullCompletionManager();
}
Expand Down

0 comments on commit 8f3d674

Please sign in to comment.