You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by Kenneth Fogel <kf...@dawsoncollege.qc.ca.INVALID> on 2025/01/13 18:17:53 UTC
Formatting Source Code
This is a minor issue and not necessarily a bug to be reported. When I create a file using the classless approach such as:
void main() {
println("Mooses rule!");
}
It will run with the --enable-preview VM option. Great!
Unfortunately, all that Source -> Formatting does is add a blank line at the top of the file and nothing more. I assume it is looking for something it can identify as a class otherwise it does not format the file.
Ken
RE: Formatting Source Code
Posted by Kenneth Fogel <kf...@dawsoncollege.qc.ca.INVALID>.
Forgot to mention that I am using NetBeans 24 and Java 23 on a Windows 11 system.
-----Original Message-----
From: Kenneth Fogel <kf...@dawsoncollege.qc.ca.INVALID>
Sent: January 13, 2025 1:18 PM
To: dev@netbeans.apache.org
Subject: Formatting Source Code
This is a minor issue and not necessarily a bug to be reported. When I create a file using the classless approach such as:
void main() {
println("Mooses rule!");
}
It will run with the --enable-preview VM option. Great!
Unfortunately, all that Source -> Formatting does is add a blank line at the top of the file and nothing more. I assume it is looking for something it can identify as a class otherwise it does not format the file.
Ken
---------------------------------------------------------------------
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: Formatting Source Code
Posted by Ernie Rael <er...@raelity.com>.
This might be loosely related to
javadoc completion doesn't work in "package-info.java"
https://github.com/apache/netbeans/issues/7986
-ernie
On 25/01/13 10:20 AM, Michael Bien wrote:
> Hi,
>
> I noticed this too while writing scripts. The indentation engine
> does not expect methods outside of class bodies and will likely need
> some updates.
>
> best regards,
> michael
>
> On 13.01.25 19:17, Kenneth Fogel wrote:
>> This is a minor issue and not necessarily a bug to be reported. When
>> I create a file using the classless approach such as:
>>
>> void main() {
>> println("Mooses rule!");
>> }
>>
>> It will run with the --enable-preview VM option. Great!
>>
>> Unfortunately, all that Source -> Formatting does is add a blank
>> line at the top of the file and nothing more. I assume it is looking
>> for something it can identify as a class otherwise it does not format
>> the file.
>>
>> Ken
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> 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: Formatting Source Code
Posted by Michael Bien <mb...@gmail.com>.
Hi,
I noticed this too while writing scripts. The indentation engine
does not expect methods outside of class bodies and will likely need
some updates.
best regards,
michael
On 13.01.25 19:17, Kenneth Fogel wrote:
> This is a minor issue and not necessarily a bug to be reported. When I create a file using the classless approach such as:
>
> void main() {
> println("Mooses rule!");
> }
>
> It will run with the --enable-preview VM option. Great!
>
> Unfortunately, all that Source -> Formatting does is add a blank line at the top of the file and nothing more. I assume it is looking for something it can identify as a class otherwise it does not format the file.
>
> Ken
>
>
>
---------------------------------------------------------------------
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