Community
Participate
Working Groups
I have a Codemining that uses LineContentCodeMining to insert an action inside a word. This leads to a little bit confusing cursor handling. Say the Editor contains the content 'HelloWorld', the LineContentCodeMining is inserted between the two words the following happens (| = cursor position, []=selection): 1) The editor show HelloMiningWorld| 2) I place the cursor here now in front of the mining HelloMining|World 3) I now press the left-arrow key 4) The result is Hell|oMiningWorld 5) I press "delete", the result is Hell|World 6) I pres STRG+Z 7) the result is The result is Hell|[oMining]World The expectation would be: 1) I can 'navigate over' the mining item with the cursor keys 2) redo an edit only marks the redo-text not the mining itself ----- code ----- public class BugCodeMiningProvider implements ICodeMiningProvider { private static final String CODE = "Mining"; @Override public CompletableFuture<List<? extends ICodeMining>> provideCodeMinings(ITextViewer viewer, IProgressMonitor monitor) { return CompletableFuture.supplyAsync(() -> { IDocument document = viewer.getDocument(); if (document.get().startsWith("HelloWorld")) { LineContentCodeMining mining = new LineContentCodeMining( new Position(5, CODE.length()), BugCodeMiningProvider.this) { @Override protected CompletableFuture<Void> doResolve(ITextViewer viewer, IProgressMonitor monitor) { return CompletableFuture.runAsync(() -> { super.setLabel(CODE); }); } }; return Collections.singletonList( mining); } return Collections.emptyList(); }); } @Override public void dispose() { } }
If this is intentional I think it would be good to make it configurable so the mining can choose the behavior.