Re: NetBeans bounty--earn $200!

2019-12-12 Thread Alvin Thompson
…and if the current indentation is inconsistent, just pick one. It would be way beyond the scope of this request to, for example, figure out the indentation around the current cursor position. In fact I would say that would be too complex, and a bad (inconsistent) user experience. Bonus $50

Re: NetBeans bounty--earn $200!

2019-12-12 Thread Alvin Thompson
Agree. The only settings I really care about it detecting are "expand tabs to spaces", "spaces per indent", and "continuation indentation". Bonus points for "label indentation" (and "absolute label indentation"). > On Dec 11, 2019, at 8:51 PM, Tim Boudreau wrote: > > public class Bar { >>

Re: NetBeans bounty--earn $200!

2019-12-11 Thread Tim Boudreau
public class Bar { > public int wazoo; > } > > There is enough Information to know that the standard indentation is 1 > tab, but you don’t have enough information to know what the label > indentation or continuation indentation should be. The hard part is dealing with ambiguity. Real

Re: NetBeans bounty--earn $200!

2019-12-11 Thread daesmond
On 12/12/2019 5:55 am, Neil C Smith wrote: On Wed, 11 Dec 2019, 20:31 Emilian Bold, wrote: P.S. A NetBeans option to make whitespace visible so we can see when spaces/tabs are not used consistently would be nice. Offtopic, but such an editor flag does exist (I forgot the name). I

Re: NetBeans bounty--earn $200!

2019-12-11 Thread Neil C Smith
On Wed, 11 Dec 2019, 20:31 Emilian Bold, wrote: > > P.S. A NetBeans option to make whitespace visible so we can see when > spaces/tabs are not used consistently would be nice. > > Offtopic, but such an editor flag does exist (I forgot the name). I > remember playing with it long ago. There's no

Re: NetBeans bounty--earn $200!

2019-12-11 Thread Scott Palmer
Re #1: I will dash your hopes. :-) I’ve been thinking about writing a plugin to manage indentation, because so far nothing I’ve seen does it right. I prefer tabs for indentation. Why? because I don’t want it to be possible to have the cursor anywhere but a valid indent level prior to the

Re: NetBeans bounty--earn $200!

2019-12-11 Thread Alvin Thompson
Sorry, I forgot a fourth setting that needs to be detected/overridden: expand tabs to spaces > On Dec 11, 2019, at 10:34 AM, Alvin Thompson wrote: > > the three preferences to figure out are standard indentation, label > indentation, and continuation indentation

Re: NetBeans bounty--earn $200!

2019-12-11 Thread Alvin Thompson
To be clear (and to make things easier), the plugin doesn’t have to do the indentation itself. It may be simpler (and probably preferred) to simply figure out what the new indentation rules should be and dynamically change the indentation preferences in NetBeans to the values you figured out.

Re: NetBeans bounty--earn $200!

2019-12-11 Thread Alvin Thompson
> On Dec 11, 2019, at 7:53 AM, Eric Bresie wrote: > > Would this be as simple as a stack with the current line indentation added > and then continue to peek at current and then pop off when a change of > indentation change may occur (i.e. end of block of code, new statement, new >

Re: Re: NetBeans bounty--earn $200!

2019-12-11 Thread Eric Bresie
Would this be as simple as a stack with the current line indentation added and then continue to peek at current and then pop off when a change of indentation change may occur (i.e. end of block of code, new statement, new expression, etc.)? > > > > > For any indentation > > > > > info that can

Re: NetBeans bounty--earn $200!

2019-12-10 Thread Alvin Thompson
> On Dec 10, 2019, at 1:43 PM, Siddhesh Rane wrote: > > The most straightforward way I see to do this is some frequency model of a > predefined set of indentation rules. You bring up a good point I didn’t think of. If the file has inconsistent indentation, the plugin should just pick

Re: NetBeans bounty--earn $200!

2019-12-10 Thread Laszlo Kishalmi
On 12/10/19 11:08 AM, Laszlo Kishalmi wrote: Well I'd: 1. convert tab to spaces (however I hope no one using tabs by now) 2. Create a histogram from the leading spaces 3. Start some division test.     Let say we test with indent: IND     for each all leading space number in the histogram with

Re: NetBeans bounty--earn $200!

2019-12-10 Thread Laszlo Kishalmi
Well I'd: 1. convert tab to spaces (however I hope no one using tabs by now) 2. Create a histogram from the leading spaces 3. Start some division test.     Let say we test with indent: IND     for each all leading space number in the histogram with IND then multiple the remainder with the

Re: NetBeans bounty--earn $200!

2019-12-10 Thread Emilian Bold
Well, this is some original idea! If somebody needs help with such a thing, I would do it just to learn. But honestly for an existing file I believe you could detect the indentation style just looking at the AST. Heuristics would work imho. But, of course, a neural network would be the cool way

Re: NetBeans bounty--earn $200!

2019-12-10 Thread Siddhesh Rane
Glad to see someone interested in this feature. A long time ago I came across a blog post[1] by Andrej Karpathy (AI guru) in which a neural network was trained on variety of text datasets and then used as a content generator. When trained on Linux and Apache source code, the generator could

Re: NetBeans bounty--earn $200!

2019-12-10 Thread Emilian Bold
Well, that's a pretty big commitment. --emi On Tue, Dec 10, 2019 at 8:16 PM Alvin Thompson wrote: > > That’s +1 dollar? ;) > > > On Dec 10, 2019, at 1:11 PM, Emilian Bold wrote: > > > > +1 > > > > --emi > > > > On Tue, Dec 10, 2019 at 7:46 PM Alvin Thompson > > wrote: > >> > >> Hi, > >> > >>

Re: NetBeans bounty--earn $200!

2019-12-10 Thread Alvin Thompson
That’s +1 dollar? ;) > On Dec 10, 2019, at 1:11 PM, Emilian Bold wrote: > > +1 > > --emi > > On Tue, Dec 10, 2019 at 7:46 PM Alvin Thompson > wrote: >> >> Hi, >> >> Assuming that this email doesn't get flagged as spam due to the subject >> line, this is just a reminder that I have a

Re: NetBeans bounty--earn $200!

2019-12-10 Thread Emilian Bold
+1 --emi On Tue, Dec 10, 2019 at 7:46 PM Alvin Thompson wrote: > > Hi, > > Assuming that this email doesn't get flagged as spam due to the subject line, > this is just a reminder that I have a bounty for anyone who creates a > NetBeans plugin that detects and uses the existing indentation of

NetBeans bounty--earn $200!

2019-12-10 Thread Alvin Thompson
Hi, Assuming that this email doesn't get flagged as spam due to the subject line, this is just a reminder that I have a bounty for anyone who creates a NetBeans plugin that detects and uses the existing indentation of the file being edited. For any indentation info that can not be gleaned from