You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by Alvin Thompson <al...@thompsonlogic.com> on 2019/12/10 17:46:06 UTC

NetBeans bounty--earn $200!

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 the file, it should fall back to the preferences. This really is an absolute must team work these days.

You get $100 for coming up with the plugin, and another $100 if it gets donated and makes it into NetBeans itself. But I imagine most people will want to do this so that I have a slightly higher opinion of them.

I would do this myself but I am very, very lazy.

That is all,
Alvin


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: NetBeans bounty--earn $200!

Posted by Emilian Bold <em...@gmail.com>.
Well, that's a pretty big commitment.

--emi

On Tue, Dec 10, 2019 at 8:16 PM Alvin Thompson <al...@thompsonlogic.com> wrote:
>
> That’s +1 dollar? ;)
>
> > On Dec 10, 2019, at 1:11 PM, Emilian Bold <em...@gmail.com> wrote:
> >
> > +1
> >
> > --emi
> >
> > On Tue, Dec 10, 2019 at 7:46 PM Alvin Thompson <al...@thompsonlogic.com> 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 the file being edited. For any indentation info that can not be gleaned from the file, it should fall back to the preferences. This really is an absolute must team work these days.
> >>
> >> You get $100 for coming up with the plugin, and another $100 if it gets donated and makes it into NetBeans itself. But I imagine most people will want to do this so that I have a slightly higher opinion of them.
> >>
> >> I would do this myself but I am very, very lazy.
> >>
> >> That is all,
> >> Alvin
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> >> For additional commands, e-mail: dev-help@netbeans.apache.org
> >>
> >> For further information about the NetBeans mailing lists, visit:
> >> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >>
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> > For additional commands, e-mail: dev-help@netbeans.apache.org
> >
> > For further information about the NetBeans mailing lists, visit:
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: NetBeans bounty--earn $200!

Posted by Alvin Thompson <al...@thompsonlogic.com>.
That’s +1 dollar? ;)

> On Dec 10, 2019, at 1:11 PM, Emilian Bold <em...@gmail.com> wrote:
> 
> +1
> 
> --emi
> 
> On Tue, Dec 10, 2019 at 7:46 PM Alvin Thompson <al...@thompsonlogic.com> 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 the file being edited. For any indentation info that can not be gleaned from the file, it should fall back to the preferences. This really is an absolute must team work these days.
>> 
>> You get $100 for coming up with the plugin, and another $100 if it gets donated and makes it into NetBeans itself. But I imagine most people will want to do this so that I have a slightly higher opinion of them.
>> 
>> I would do this myself but I am very, very lazy.
>> 
>> That is all,
>> Alvin
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
>> For additional commands, e-mail: dev-help@netbeans.apache.org
>> 
>> For further information about the NetBeans mailing lists, visit:
>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>> 
>> 
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
> 
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: NetBeans bounty--earn $200!

Posted by Emilian Bold <em...@gmail.com>.
+1

--emi

On Tue, Dec 10, 2019 at 7:46 PM Alvin Thompson <al...@thompsonlogic.com> 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 the file being edited. For any indentation info that can not be gleaned from the file, it should fall back to the preferences. This really is an absolute must team work these days.
>
> You get $100 for coming up with the plugin, and another $100 if it gets donated and makes it into NetBeans itself. But I imagine most people will want to do this so that I have a slightly higher opinion of them.
>
> I would do this myself but I am very, very lazy.
>
> That is all,
> Alvin
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: NetBeans bounty--earn $200!

Posted by Alvin Thompson <al...@thompsonlogic.com>.
…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 for showing the status of the plugin in the status bar, for example:
the plugin successfully detected the indentation settings
the plugin successfully detected at least the big two settings (expand tabs and spaces per indent), and guessed at one or more of the remaining settings
the indentation of the file is inconsistent; the plugin picked one
the plugin just used the current NetBeans indentation settings (for example the file is empty and has no indentation yet) 



> On Dec 12, 2019, at 9:24 AM, Alvin Thompson <al...@thompsonlogic.com> wrote:
> 
> 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 <niftiness@gmail.com <ma...@gmail.com>> wrote:
>> 
>> 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 sources with a long history
>> may contain a mix of tabs and spaces, different indent levels etc.
>> 
>> Not to mention more esoteric things - for example, spaces inside
>> parentheses and how that deals with nested parentheses - e.g. “foo( bar(
>> baz ))” good and “foo( bar( baz ) )” bad (I have yet to find an incantation
>> off NetBeans’s own formatter that gets this right.
>> 
>> If you just want to detect tabs or spaces and how many, that might be a
>> $200 job. For detecting everything and not getting at least one thing
>> embarrassingly wrong, likely $100k is not enough.
>> 
>> So if someone does this, choose carefully what problems you DON’T want to
>> solve, or plan on going down an infinitely deep rabbit hole.
>> 
>> -Tim
>> 
>>> 
>> 
>> 
>> The plugin would need to fall back to the NetBeans prefs to "figure out"
>>> sensible values for these.
>>> 
>>> While not rocket science, this isn’t entirely straightforward because you
>>> can’t just copy the NetBeans prefs. Continuing the example above, if
>>> NetBeans specifies that the standard indentation is 2 spaces and the
>>> continuation indentation is also 2 spaces, you can figure out that the
>>> continuation indentation for this file should be one tab. If in NetBeans
>>> the continuation indentation was 4 spaces (twice the standard indentation),
>>> the continuation indentation for this file should be 2 tabs.
>>> 
>>> -Alvin
>>> 
>>> --
>> http://timboudreau.com <http://timboudreau.com/>


Re: NetBeans bounty--earn $200!

Posted by Alvin Thompson <al...@thompsonlogic.com>.
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 <ni...@gmail.com> wrote:
> 
> 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 sources with a long history
> may contain a mix of tabs and spaces, different indent levels etc.
> 
> Not to mention more esoteric things - for example, spaces inside
> parentheses and how that deals with nested parentheses - e.g. “foo( bar(
> baz ))” good and “foo( bar( baz ) )” bad (I have yet to find an incantation
> off NetBeans’s own formatter that gets this right.
> 
> If you just want to detect tabs or spaces and how many, that might be a
> $200 job. For detecting everything and not getting at least one thing
> embarrassingly wrong, likely $100k is not enough.
> 
> So if someone does this, choose carefully what problems you DON’T want to
> solve, or plan on going down an infinitely deep rabbit hole.
> 
> -Tim
> 
>> 
> 
> 
> The plugin would need to fall back to the NetBeans prefs to "figure out"
>> sensible values for these.
>> 
>> While not rocket science, this isn’t entirely straightforward because you
>> can’t just copy the NetBeans prefs. Continuing the example above, if
>> NetBeans specifies that the standard indentation is 2 spaces and the
>> continuation indentation is also 2 spaces, you can figure out that the
>> continuation indentation for this file should be one tab. If in NetBeans
>> the continuation indentation was 4 spaces (twice the standard indentation),
>> the continuation indentation for this file should be 2 tabs.
>> 
>> -Alvin
>> 
>> --
> http://timboudreau.com <http://timboudreau.com/>

Re: NetBeans bounty--earn $200!

Posted by Tim Boudreau <ni...@gmail.com>.
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 sources with a long history
may contain a mix of tabs and spaces, different indent levels etc.

Not to mention more esoteric things - for example, spaces inside
parentheses and how that deals with nested parentheses - e.g. “foo( bar(
baz ))” good and “foo( bar( baz ) )” bad (I have yet to find an incantation
off NetBeans’s own formatter that gets this right.

If you just want to detect tabs or spaces and how many, that might be a
$200 job. For detecting everything and not getting at least one thing
embarrassingly wrong, likely $100k is not enough.

So if someone does this, choose carefully what problems you DON’T want to
solve, or plan on going down an infinitely deep rabbit hole.

-Tim

>


The plugin would need to fall back to the NetBeans prefs to "figure out"
> sensible values for these.
>
> While not rocket science, this isn’t entirely straightforward because you
> can’t just copy the NetBeans prefs. Continuing the example above, if
> NetBeans specifies that the standard indentation is 2 spaces and the
> continuation indentation is also 2 spaces, you can figure out that the
> continuation indentation for this file should be one tab. If in NetBeans
> the continuation indentation was 4 spaces (twice the standard indentation),
> the continuation indentation for this file should be 2 tabs.
>
> -Alvin
>
> --
http://timboudreau.com

Re: NetBeans bounty--earn $200!

Posted by Alvin Thompson <al...@thompsonlogic.com>.
> On Dec 11, 2019, at 7:53 AM, Eric Bresie <eb...@gmail.com> 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 expression, etc.)?

I think actually doing the indentation with the plugin may be more work than needed for this plugin. It may be simpler to just figure out what the indentation should be and then change the NetBeans indentation preferences to the values you figured out. NetBeans already has indentation code so let NetBeans do the work.

>>>>>> For any indentation
>>>>>> info that can not be gleaned
>>>>>> from the file, it should fall back to the preferences
> 
> Not sure what is meant here? Assume this would be on an empty file or a case when no indentation is present on the line.
> 
> How is this different from current Netbeans indentation capabilities?


Yep, for a new file, it would just use the NetBeans preferences for indentation. But there are also "in between" cases where some information is available from the file being edited but some is not. For example, consider opening this file:


package foo;
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 plugin would need to fall back to the NetBeans prefs to "figure out" sensible values for these.

While not rocket science, this isn’t entirely straightforward because you can’t just copy the NetBeans prefs. Continuing the example above, if NetBeans specifies that the standard indentation is 2 spaces and the continuation indentation is also 2 spaces, you can figure out that the continuation indentation for this file should be one tab. If in NetBeans the continuation indentation was 4 spaces (twice the standard indentation), the continuation indentation for this file should be 2 tabs.

-Alvin


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

Posted by Eric Bresie <eb...@gmail.com>.
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 not be gleaned
> > > > > from the file, it should fall back to the preferences

Not sure what is meant here? Assume this would be on an empty file or a case when no indentation is present on the line.

How is this different from current Netbeans indentation capabilities?

Eric Bresie
Ebresie@gmail.com
> On December 10, 2019 at 1:12:12 PM CST, Laszlo Kishalmi <la...@gmail.com> wrote:
>
> 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 IND then
> > multiple the remainder with the number of lines which that leading
> > space is used that would be DEV
> > summarize of these DEV values (deviations)
> >
> > The deviation for IND=1 shall be 0. Start to increase IND, the largest
> > number while IND is 0 the indent of the file.
> Actually do not just increase the IND but test a few like 2-8 spaces and
> where the max IND which below that threshold would be the detected
> indenting.
> >
> >
> > For miss formatted files you might allow a threshold somewhat above 0
> > as well. This threshold could be a function of the number of lines in
> > the file.
> >
> > On 12/10/19 10:50 AM, Emilian Bold wrote:
> > > 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 of solving it.
> > >
> > > --emi
> > >
> > > On Tue, Dec 10, 2019 at 8:44 PM Siddhesh Rane
> > > <si...@disroot.org> wrote:
> > > > 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 reproduce pseudo code,
> > > > that was not valid code, but was very well formatted. It was quite
> > > > cool to see the network had learned several things, indentation
> > > > being one of them. Do check out the Source Code section of the blog
> > > > to know what I am talking about.
> > > >
> > > > The most straightforward way I see to do this is some frequency
> > > > model of a predefined set of indentation rules.
> > > > But if anyone is interested to create a small fast neural network
> > > > with limited features, it would be great to see the possibilities.
> > > >
> > > > +1 for this.
> > > >
> > > > Regards
> > > > Siddhesh
> > > >
> > > > [1] http://karpathy.github.io/2015/05/21/rnn-effectiveness/
> > > >
> > > > December 10, 2019 11:16 PM, "Alvin Thompson"
> > > > <al...@thompsonlogic.com> 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 the file being edited. For any indentation
> > > > > info that can not be gleaned
> > > > > from the file, it should fall back to the preferences. This really
> > > > > is an absolute must team work
> > > > > these days.
> > > > >
> > > > > You get $100 for coming up with the plugin, and another $100 if it
> > > > > gets donated and makes it into
> > > > > NetBeans itself. But I imagine most people will want to do this so
> > > > > that I have a slightly higher
> > > > > opinion of them.
> > > > >
> > > > > I would do this myself but I am very, very lazy.
> > > > >
> > > > > That is all,
> > > > > Alvin
> > > > >
> > > > > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> > > > > For additional commands, e-mail: dev-help@netbeans.apache.org
> > > > >
> > > > > For further information about the NetBeans mailing lists, visit:
> > > > > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> > > > For additional commands, e-mail: dev-help@netbeans.apache.org
> > > >
> > > > For further information about the NetBeans mailing lists, visit:
> > > > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> > > >
> > > >
> > > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> > > For additional commands, e-mail: dev-help@netbeans.apache.org
> > >
> > > For further information about the NetBeans mailing lists, visit:
> > > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> > >
> > >
> > >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>

Re: NetBeans bounty--earn $200!

Posted by Laszlo Kishalmi <la...@gmail.com>.
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 IND then 
> multiple the remainder with the number of lines which that leading 
> space is used that would be DEV
>     summarize of these DEV values (deviations)
>
> The deviation for IND=1 shall be 0. Start to increase IND, the largest 
> number while IND is 0 the indent of the file.
Actually do not just increase the IND but test a few like 2-8 spaces and 
where the max IND which below that threshold would be the detected 
indenting.
>
>
> For miss formatted files you might allow a threshold somewhat above 0 
> as well. This threshold could be a function of the number of lines in 
> the file.
>
> On 12/10/19 10:50 AM, Emilian Bold wrote:
>> 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 of solving it.
>>
>> --emi
>>
>> On Tue, Dec 10, 2019 at 8:44 PM Siddhesh Rane 
>> <si...@disroot.org> wrote:
>>> 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 reproduce pseudo code, 
>>> that was not valid code, but was very well formatted. It was quite 
>>> cool to see the network had learned several things, indentation 
>>> being one of them. Do check out the Source Code section of the blog 
>>> to know what I am talking about.
>>>
>>> The most straightforward way I see to do this is some frequency 
>>> model of a predefined set of indentation rules.
>>> But if anyone is interested to create a small fast neural network 
>>> with limited features, it would be great to see the possibilities.
>>>
>>> +1 for this.
>>>
>>> Regards
>>> Siddhesh
>>>
>>> [1] http://karpathy.github.io/2015/05/21/rnn-effectiveness/
>>>
>>> December 10, 2019 11:16 PM, "Alvin Thompson" 
>>> <al...@thompsonlogic.com> 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 the file being edited. For any indentation 
>>>> info that can not be gleaned
>>>> from the file, it should fall back to the preferences. This really 
>>>> is an absolute must team work
>>>> these days.
>>>>
>>>> You get $100 for coming up with the plugin, and another $100 if it 
>>>> gets donated and makes it into
>>>> NetBeans itself. But I imagine most people will want to do this so 
>>>> that I have a slightly higher
>>>> opinion of them.
>>>>
>>>> I would do this myself but I am very, very lazy.
>>>>
>>>> That is all,
>>>> Alvin
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
>>>> For additional commands, e-mail: dev-help@netbeans.apache.org
>>>>
>>>> For further information about the NetBeans mailing lists, visit:
>>>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
>>> For additional commands, e-mail: dev-help@netbeans.apache.org
>>>
>>> For further information about the NetBeans mailing lists, visit:
>>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>>>
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
>> For additional commands, e-mail: dev-help@netbeans.apache.org
>>
>> For further information about the NetBeans mailing lists, visit:
>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>>
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: NetBeans bounty--earn $200!

Posted by daesmond <da...@gmail.com>.
On 12/12/2019 5:55 am, Neil C Smith wrote:
> On Wed, 11 Dec 2019, 20:31 Emilian Bold, <em...@gmail.com> 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 UI for it though.
>>
> Isn't that in the menu? View -> Show Non-Printable characters
>
> Best wishes,
>
> Neil

[32] space

[09] tab

[08] backspace

and so on

That's what keyloggers do

But then it would confuse the code formation more

Unless you put it as annotation


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: NetBeans bounty--earn $200!

Posted by Neil C Smith <ne...@apache.org>.
On Wed, 11 Dec 2019, 20:31 Emilian Bold, <em...@gmail.com> 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 UI for it though.
>

Isn't that in the menu? View -> Show Non-Printable characters

Best wishes,

Neil

>

Re: NetBeans bounty--earn $200!

Posted by Emilian Bold <em...@gmail.com>.
> 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 UI for it though.

--emi

On Wed, Dec 11, 2019 at 10:26 PM Scott Palmer <sw...@gmail.com> wrote:
>
> 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 actual code on the line. I want to be able to set the tab width to what I like and have everyone else’s code adapt, without modifying the file content.  When spaces are used to indent, that doesn’t work.
>
> Tabs must only be the first characters on the line. After the first non-tab there can never be another tab on the line.  This rule ensures that it is possible to change the tab width to any positive integer and not screw up any intentional alignment.
>
> I want to use spaces after the tabs for alignment purposes, e.g lining up parameters so they appear after the ‘(‘ if a method call needs to split lines.
>
>         method(a ,b
>                c ,d);
>         <tab to here, spaces to align ‘c’ with ‘a'
>
>         int one   = 1;
>         int three = 3;
>         int five  = 5
>                   <always spaces to align after indent level
>
> I want code formatting to respect intentional extra spaces for alignment.
>
> I could tolerate spaces if they weren’t so painful for navigation. I want everything treated as a tab up to the indent level (based on the program structure).
>
> Maybe an advanced plugin could keep track of indent level separately so the editor behaved as if tabs were used to indent, but was smart about what was detected as the indent width in the file when it was loaded. IT could treat indenting as if it were done with tabs.  When saving it would know that the file used spaces and it knows how many spaces were used to indent one level so keeps that number of spaces when the file is saved, regardless of what my preferred tab width is for viewing/editing.
>
> If spaces are found before tabs on the same line, the plugin could use version control to find who last committed the file, track them down on social media, and send a firing squad to their house ;-)
>
>
> Scott
>
>
> P.S.  A NetBeans option to make whitespace visible so we can see when spaces/tabs are not used consistently would be nice.
>
> > On Dec 10, 2019, at 2:08 PM, Laszlo Kishalmi <la...@gmail.com> 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 IND then multiple the remainder with the number of lines which that leading space is used that would be DEV
> >     summarize of these DEV values (deviations)
> >
> > The deviation for IND=1 shall be 0. Start to increase IND, the largest number while IND is 0 the indent of the file.
> >
> > For miss formatted files you might allow a threshold somewhat above 0 as well. This threshold could be a function of the number of lines in the file.
> >
> > On 12/10/19 10:50 AM, Emilian Bold wrote:
> >> 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 of solving it.
> >>
> >> --emi
> >>
> >> On Tue, Dec 10, 2019 at 8:44 PM Siddhesh Rane <si...@disroot.org> wrote:
> >>> 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 reproduce pseudo code, that was not valid code, but was very well formatted. It was quite cool to see the network had learned several things, indentation being one of them. Do check out the Source Code section of the blog to know what I am talking about.
> >>>
> >>> The most straightforward way I see to do this is some frequency model of a predefined set of indentation rules.
> >>> But if anyone is interested to create a small fast neural network with limited features, it would be great to see the possibilities.
> >>>
> >>> +1 for this.
> >>>
> >>> Regards
> >>> Siddhesh
> >>>
> >>> [1] http://karpathy.github.io/2015/05/21/rnn-effectiveness/
> >>>
> >>> December 10, 2019 11:16 PM, "Alvin Thompson" <al...@thompsonlogic.com> 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 the file being edited. For any indentation info that can not be gleaned
> >>>> from the file, it should fall back to the preferences. This really is an absolute must team work
> >>>> these days.
> >>>>
> >>>> You get $100 for coming up with the plugin, and another $100 if it gets donated and makes it into
> >>>> NetBeans itself. But I imagine most people will want to do this so that I have a slightly higher
> >>>> opinion of them.
> >>>>
> >>>> I would do this myself but I am very, very lazy.
> >>>>
> >>>> That is all,
> >>>> Alvin
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> >>>> For additional commands, e-mail: dev-help@netbeans.apache.org
> >>>>
> >>>> For further information about the NetBeans mailing lists, visit:
> >>>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> >>> For additional commands, e-mail: dev-help@netbeans.apache.org
> >>>
> >>> For further information about the NetBeans mailing lists, visit:
> >>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >>>
> >>>
> >>>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> >> For additional commands, e-mail: dev-help@netbeans.apache.org
> >>
> >> For further information about the NetBeans mailing lists, visit:
> >> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >>
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> > For additional commands, e-mail: dev-help@netbeans.apache.org
> >
> > For further information about the NetBeans mailing lists, visit:
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: NetBeans bounty--earn $200!

Posted by Scott Palmer <sw...@gmail.com>.
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 actual code on the line. I want to be able to set the tab width to what I like and have everyone else’s code adapt, without modifying the file content.  When spaces are used to indent, that doesn’t work. 

Tabs must only be the first characters on the line. After the first non-tab there can never be another tab on the line.  This rule ensures that it is possible to change the tab width to any positive integer and not screw up any intentional alignment.

I want to use spaces after the tabs for alignment purposes, e.g lining up parameters so they appear after the ‘(‘ if a method call needs to split lines.

	method(a ,b
	       c ,d);
	<tab to here, spaces to align ‘c’ with ‘a'

	int one   = 1;
	int three = 3;
	int five  = 5
	          <always spaces to align after indent level

I want code formatting to respect intentional extra spaces for alignment.

I could tolerate spaces if they weren’t so painful for navigation. I want everything treated as a tab up to the indent level (based on the program structure).

Maybe an advanced plugin could keep track of indent level separately so the editor behaved as if tabs were used to indent, but was smart about what was detected as the indent width in the file when it was loaded. IT could treat indenting as if it were done with tabs.  When saving it would know that the file used spaces and it knows how many spaces were used to indent one level so keeps that number of spaces when the file is saved, regardless of what my preferred tab width is for viewing/editing.

If spaces are found before tabs on the same line, the plugin could use version control to find who last committed the file, track them down on social media, and send a firing squad to their house ;-)


Scott


P.S.  A NetBeans option to make whitespace visible so we can see when spaces/tabs are not used consistently would be nice.

> On Dec 10, 2019, at 2:08 PM, Laszlo Kishalmi <la...@gmail.com> 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 IND then multiple the remainder with the number of lines which that leading space is used that would be DEV
>     summarize of these DEV values (deviations)
> 
> The deviation for IND=1 shall be 0. Start to increase IND, the largest number while IND is 0 the indent of the file.
> 
> For miss formatted files you might allow a threshold somewhat above 0 as well. This threshold could be a function of the number of lines in the file.
> 
> On 12/10/19 10:50 AM, Emilian Bold wrote:
>> 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 of solving it.
>> 
>> --emi
>> 
>> On Tue, Dec 10, 2019 at 8:44 PM Siddhesh Rane <si...@disroot.org> wrote:
>>> 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 reproduce pseudo code, that was not valid code, but was very well formatted. It was quite cool to see the network had learned several things, indentation being one of them. Do check out the Source Code section of the blog to know what I am talking about.
>>> 
>>> The most straightforward way I see to do this is some frequency model of a predefined set of indentation rules.
>>> But if anyone is interested to create a small fast neural network with limited features, it would be great to see the possibilities.
>>> 
>>> +1 for this.
>>> 
>>> Regards
>>> Siddhesh
>>> 
>>> [1] http://karpathy.github.io/2015/05/21/rnn-effectiveness/
>>> 
>>> December 10, 2019 11:16 PM, "Alvin Thompson" <al...@thompsonlogic.com> 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 the file being edited. For any indentation info that can not be gleaned
>>>> from the file, it should fall back to the preferences. This really is an absolute must team work
>>>> these days.
>>>> 
>>>> You get $100 for coming up with the plugin, and another $100 if it gets donated and makes it into
>>>> NetBeans itself. But I imagine most people will want to do this so that I have a slightly higher
>>>> opinion of them.
>>>> 
>>>> I would do this myself but I am very, very lazy.
>>>> 
>>>> That is all,
>>>> Alvin
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
>>>> For additional commands, e-mail: dev-help@netbeans.apache.org
>>>> 
>>>> For further information about the NetBeans mailing lists, visit:
>>>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
>>> For additional commands, e-mail: dev-help@netbeans.apache.org
>>> 
>>> For further information about the NetBeans mailing lists, visit:
>>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>>> 
>>> 
>>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
>> For additional commands, e-mail: dev-help@netbeans.apache.org
>> 
>> For further information about the NetBeans mailing lists, visit:
>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>> 
>> 
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
> 
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: NetBeans bounty--earn $200!

Posted by Laszlo Kishalmi <la...@gmail.com>.
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 number of lines which that leading space 
is used that would be DEV
     summarize of these DEV values (deviations)

The deviation for IND=1 shall be 0. Start to increase IND, the largest 
number while IND is 0 the indent of the file.

For miss formatted files you might allow a threshold somewhat above 0 as 
well. This threshold could be a function of the number of lines in the file.

On 12/10/19 10:50 AM, Emilian Bold wrote:
> 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 of solving it.
>
> --emi
>
> On Tue, Dec 10, 2019 at 8:44 PM Siddhesh Rane <si...@disroot.org> wrote:
>> 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 reproduce pseudo code, that was not valid code, but was very well formatted. It was quite cool to see the network had learned several things, indentation being one of them. Do check out the Source Code section of the blog to know what I am talking about.
>>
>> The most straightforward way I see to do this is some frequency model of a predefined set of indentation rules.
>> But if anyone is interested to create a small fast neural network with limited features, it would be great to see the possibilities.
>>
>> +1 for this.
>>
>> Regards
>> Siddhesh
>>
>> [1] http://karpathy.github.io/2015/05/21/rnn-effectiveness/
>>
>> December 10, 2019 11:16 PM, "Alvin Thompson" <al...@thompsonlogic.com> 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 the file being edited. For any indentation info that can not be gleaned
>>> from the file, it should fall back to the preferences. This really is an absolute must team work
>>> these days.
>>>
>>> You get $100 for coming up with the plugin, and another $100 if it gets donated and makes it into
>>> NetBeans itself. But I imagine most people will want to do this so that I have a slightly higher
>>> opinion of them.
>>>
>>> I would do this myself but I am very, very lazy.
>>>
>>> That is all,
>>> Alvin
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
>>> For additional commands, e-mail: dev-help@netbeans.apache.org
>>>
>>> For further information about the NetBeans mailing lists, visit:
>>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
>> For additional commands, e-mail: dev-help@netbeans.apache.org
>>
>> For further information about the NetBeans mailing lists, visit:
>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>>
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: NetBeans bounty--earn $200!

Posted by Emilian Bold <em...@gmail.com>.
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 of solving it.

--emi

On Tue, Dec 10, 2019 at 8:44 PM Siddhesh Rane <si...@disroot.org> wrote:
>
> 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 reproduce pseudo code, that was not valid code, but was very well formatted. It was quite cool to see the network had learned several things, indentation being one of them. Do check out the Source Code section of the blog to know what I am talking about.
>
> The most straightforward way I see to do this is some frequency model of a predefined set of indentation rules.
> But if anyone is interested to create a small fast neural network with limited features, it would be great to see the possibilities.
>
> +1 for this.
>
> Regards
> Siddhesh
>
> [1] http://karpathy.github.io/2015/05/21/rnn-effectiveness/
>
> December 10, 2019 11:16 PM, "Alvin Thompson" <al...@thompsonlogic.com> 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 the file being edited. For any indentation info that can not be gleaned
> > from the file, it should fall back to the preferences. This really is an absolute must team work
> > these days.
> >
> > You get $100 for coming up with the plugin, and another $100 if it gets donated and makes it into
> > NetBeans itself. But I imagine most people will want to do this so that I have a slightly higher
> > opinion of them.
> >
> > I would do this myself but I am very, very lazy.
> >
> > That is all,
> > Alvin
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> > For additional commands, e-mail: dev-help@netbeans.apache.org
> >
> > For further information about the NetBeans mailing lists, visit:
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: NetBeans bounty--earn $200!

Posted by Alvin Thompson <al...@thompsonlogic.com>.
> On Dec 10, 2019, at 1:43 PM, Siddhesh Rane <si...@disroot.org> 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 one—preferably the most common indentation. But for starters it would be OK if the plugin used the first indentation it found that matched that rule. But bonus points for handling inconsistency.

You may want to see how others are doing it. For example, I know there are at least a couple of Brackets plugins that do similar (yeah they’re in javascript, but they should give the gist of it). I doubt anything as complex as ML is necessary.

Thanks!
Alvin

Re: NetBeans bounty--earn $200!

Posted by Siddhesh Rane <si...@disroot.org>.
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 reproduce pseudo code, that was not valid code, but was very well formatted. It was quite cool to see the network had learned several things, indentation being one of them. Do check out the Source Code section of the blog to know what I am talking about.

The most straightforward way I see to do this is some frequency model of a predefined set of indentation rules.
But if anyone is interested to create a small fast neural network with limited features, it would be great to see the possibilities.

+1 for this.

Regards
Siddhesh 

[1] http://karpathy.github.io/2015/05/21/rnn-effectiveness/

December 10, 2019 11:16 PM, "Alvin Thompson" <al...@thompsonlogic.com> 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 the file being edited. For any indentation info that can not be gleaned
> from the file, it should fall back to the preferences. This really is an absolute must team work
> these days.
> 
> You get $100 for coming up with the plugin, and another $100 if it gets donated and makes it into
> NetBeans itself. But I imagine most people will want to do this so that I have a slightly higher
> opinion of them.
> 
> I would do this myself but I am very, very lazy.
> 
> That is all,
> Alvin
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
> 
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: NetBeans bounty--earn $200!

Posted by Alvin Thompson <al...@thompsonlogic.com>.
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 <al...@thompsonlogic.com> wrote:
> 
> the three preferences to figure out are standard indentation, label indentation, and continuation indentation


Re: NetBeans bounty--earn $200!

Posted by Alvin Thompson <al...@thompsonlogic.com>.
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. NetBeans already has indentation code so let it do the heavy lifting for you.

I haven’t looked at the code, but I assume NetBeans has an event for when a file is activated for editing (that is, the file is opened or switched to). I imagine that this plugin could just listen for that event, and in the handler:
look at the existing code to figure out what the indentation rules should be
the three preferences to figure out are standard indentation, label indentation, and continuation indentation
if you can’t figure out all three of the above settings by looking at the code, figure out sensible settings by looking at the current preferences
override NetBeans’ own preferences to those new values

…and you’re done!

One potential complication I foresee is that NetBeans itself overrides these preferences with its project-specific formatting preferences, so the plugin would need to make sure it overrides those as well. This plugin should not however change those project-specific preferences on disk—that would be a headache because version control would pick up the change. Again, I haven’t looked at the code so I don’t know if this is actually an issue.

-Alvin


> On Dec 10, 2019, at 12:46 PM, Alvin Thompson <al...@thompsonlogic.com> 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 the file being edited. For any indentation info that can not be gleaned from the file, it should fall back to the preferences. This really is an absolute must team work these days.
> 
> You get $100 for coming up with the plugin, and another $100 if it gets donated and makes it into NetBeans itself. But I imagine most people will want to do this so that I have a slightly higher opinion of them.
> 
> I would do this myself but I am very, very lazy.
> 
> That is all,
> Alvin
>