mirror of https://github.com/buggins/dlangide.git
Insert completion suggestion. issue #20
This commit is contained in:
parent
0b01ca2b86
commit
ec9b0a2147
|
@ -13,8 +13,11 @@ class DCDInterface {
|
||||||
ProtectedTextStorage stdoutTarget = new ProtectedTextStorage();
|
ProtectedTextStorage stdoutTarget = new ProtectedTextStorage();
|
||||||
ExternalProcess dcdProcess = new ExternalProcess();
|
ExternalProcess dcdProcess = new ExternalProcess();
|
||||||
//TODO: Working Directory, where is that?
|
//TODO: Working Directory, where is that?
|
||||||
|
//TODO: Inform user when dcd-client is not available.
|
||||||
dcdProcess.run("dcd-client".dup, arguments, "/usr/bin".dup, stdoutTarget);
|
dcdProcess.run("dcd-client".dup, arguments, "/usr/bin".dup, stdoutTarget);
|
||||||
|
|
||||||
while(dcdProcess.poll() == ExternalProcessState.Running){ }
|
while(dcdProcess.poll() == ExternalProcessState.Running){ }
|
||||||
|
|
||||||
output = stdoutTarget.readText();
|
output = stdoutTarget.readText();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,7 @@ enum IDEActions : int {
|
||||||
ProjectFolderRenameItem,
|
ProjectFolderRenameItem,
|
||||||
GoToDefinition,
|
GoToDefinition,
|
||||||
GetCompletionSuggestions,
|
GetCompletionSuggestions,
|
||||||
|
InsertCompletion,
|
||||||
}
|
}
|
||||||
|
|
||||||
const Action ACTION_PROJECT_FOLDER_ADD_ITEM = new Action(IDEActions.ProjectFolderAddItem, "MENU_PROJECT_FOLDER_ADD_ITEM"c);
|
const Action ACTION_PROJECT_FOLDER_ADD_ITEM = new Action(IDEActions.ProjectFolderAddItem, "MENU_PROJECT_FOLDER_ADD_ITEM"c);
|
||||||
|
|
|
@ -80,6 +80,10 @@ class DSourceEdit : SourceEdit {
|
||||||
case IDEActions.FileSave:
|
case IDEActions.FileSave:
|
||||||
save();
|
save();
|
||||||
return true;
|
return true;
|
||||||
|
case IDEActions.InsertCompletion:
|
||||||
|
EditOperation edit = new EditOperation(EditAction.Replace, getCaretPosition, a.label);
|
||||||
|
_content.performOperation(edit, this);
|
||||||
|
return true;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -93,7 +97,7 @@ class DSourceEdit : SourceEdit {
|
||||||
MenuItem completionPopupItem = new MenuItem(null);
|
MenuItem completionPopupItem = new MenuItem(null);
|
||||||
//Create popup menu
|
//Create popup menu
|
||||||
foreach(int i, dstring suggestion ; suggestions) {
|
foreach(int i, dstring suggestion ; suggestions) {
|
||||||
auto action = new Action(i+1, suggestion);
|
auto action = new Action(IDEActions.InsertCompletion, suggestion);
|
||||||
completionPopupItem.add(action);
|
completionPopupItem.add(action);
|
||||||
}
|
}
|
||||||
completionPopupItem.updateActionState(this);
|
completionPopupItem.updateActionState(this);
|
||||||
|
|
Loading…
Reference in New Issue