Wish Auto Format the Spaces

HappyDad

Member
Licensed User
Longtime User
Is it possible to auto format the spaces in codes, for example, space before and after "=", etc.
Say, the code is now like this, without auto-formatting the spaces:
B4X:
        If lblResult.Text.Length>0 Then
            lblResult.Text=lblResult.Text.SubString2(0,lblResult.Text.Length-1)
        End If
After auto-formatting the spaces, it will look like this:
B4X:
        If lblResult.Text.Length > 0 Then
            lblResult.Text = lblResult.Text.SubString2(0, lblResult.Text.Length - 1)
        End If
 

Sandman

Expert
Licensed User
Longtime User
Is it possible to auto format the spaces in codes, for example, space before and after "=", etc.
Of course it is possible to do that. The problem is that there is close to no chance that we would agree on a standard that we all like.
 
D

Deleted member 103

Guest
Of course it is possible to do that. The problem is that there is close to no chance that we would agree on a standard that we all like.
And why shouldn't it be possible? It could optionally be adjustable.
The only question is whether it can be implemented.
 

Sandman

Expert
Licensed User
Longtime User
And why shouldn't it be possible? It could optionally be adjustable.
The bad news is that if we make it adjustable, that would be pretty close to not having a standard.
The good news is that I get to reference a xkcd comic for the second time this week:

1583653715576.png


The only question is whether it can be implemented.
That is hilarious, considering what magic @Erel has produced in the B4X suite. I'm having a really hard time imagining that formatting code is beyond his abilities. :)
 
D

Deleted member 103

Guest
I'm having a really hard time imagining that formatting code is beyond his abilities
I never said that Erel couldn't do it.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
If I'm not mistaken, the Editor is provided by third parties
The third party library is only responsible for the UI elements. All the logic is implemented in the IDE code.

It is possible to add formatting. Naturally it is not a simple feature to add especially when you need to deal with incomplete code which is the case when the developer writes the code.
 

LucaMs

Expert
Licensed User
Longtime User
It is possible to add formatting. Naturally it is not a simple feature to add especially when you need to deal with incomplete code which is the case when the developer writes the code.
Sure, but you should format the text only on "line loses focus" event, as you already do formatting the variable names correctly, not while the developer is writing.
 
D

Deleted member 103

Guest
I think the same as Luca, formatting at the end of the line when we press Return, like for For/Next If / Then etc is OK.
Exactly, that's what visual studio has always been doing.
 
D

Deleted member 103

Guest
By the way, I already had this wish in 2016. ;)
 
Top