This commit is contained in:
Akash Yadav
2021-09-24 20:41:58 +05:30
parent e117d7b4b0
commit 9c6db435ad
3 changed files with 4 additions and 13 deletions
@@ -80,7 +80,8 @@ public class EditorPagerAdapter extends FragmentStatePagerAdapter implements Edi
mFragments.add(EditorFragment
.newInstance(file, project, selection)
.setFileOpenListener(listener)
.setJLSRequestor(jlsRequestor));
.setJLSRequestor(jlsRequestor)
.setModificationStateListener(this));
mOpenedFiles.add(file);
notifyDataSetChanged();
return mFragments.size() - 1;
@@ -71,15 +71,8 @@ class EditorTextActionModeStarter implements CodeEditor.EditorTextActionPresente
android.R.attr.actionModePasteDrawable,
});
List<Diagnostic> diags = mEditor.findDiagnosticsContainingLine(mEditor.getCursor().getLeftLine());
if(diags != null && diags.size() > 0) {
this.actions = new ArrayList<>();
for(Diagnostic d : diags) {
if(d != null && d.codeActions != null) {
this.actions.addAll(d.codeActions);
}
}
} else actions = null;
// TODO: Request code actions on selection change
actions = null;
if(actions != null && actions.size() > 0) {
menu.add(0, 8, 0, mEditor.getContext().getString(com.itsaky.androidide.R.string.msg_code_actions))
@@ -22,7 +22,4 @@ public class Diagnostic {
@SerializedName("tags")
public List<Integer> tags;
@SerializedName("codeActions")
public List<CodeAction> codeActions = new ArrayList<>();
}