Bug 570774 - [code mining] codeminings are placed too narrow / allow to specify padding
Summary: [code mining] codeminings are placed too narrow / allow to specify padding
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.14   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-30 03:48 EST by Christoph Laeubrich CLA
Modified: 2021-01-30 11:32 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Laeubrich CLA 2021-01-30 03:48:58 EST
Current behavior is the following:

I have a line for example

CodeMinings are cool


I now place one code mining 'very' after the 'e' the result is

CodeMinings arevery cool

I now place one code mining 'not' after the 'e' the result is

CodeMinings arevery | not cool

what I like to have is something like

CodeMinings are very cool
CodeMinings are very | not cool

My suggestion here would be to change the placing algorithm in the following way:
1) if the mining is the first (or only item) in the list and the preceding character is not a whitespace, add a whitespace infront
2) if the mining is the last (or only item) in the list and the next character is not a whitespace, add one afterwards


This behavior could be configurable via the ICodeMining itself (e.g. via a getSpacingStrategy()) to allow different plugable ways. I could even think about that one might wants something like this:

CodeMinings are [very|not] cool