Wish IDE : Update code capitalization on line change, to match its declaration

TelKel81

Active Member
Licensed User
Not sure if it's intended : on line change, if the capitalization of a field/method doesn't correspond to the capitalization in its declaration, the code string won't be updated to reflect the declaration.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
B4J_GfZPiUhODw.gif
 

TelKel81

Active Member
Licensed User
I should have provided more info.

If the line is in error while the capitalization isn't reflecting its declaration, it will not adjust capitalization once the error is fixed. You have to manually change the capitalization.

There are also other contexts : at any time, if the capitalization of the method of a class is "mismatched" in a code line, and instead of pressing CTRL+SPACE where the correction must be done, I use arrows or click on a different line, the capitalization won't be updated.
 
Last edited:

toby

Well-Known Member
Licensed User
Longtime User
First of all, you should fix whatever errors you have, then you will get what you expect.
 

TelKel81

Active Member
Licensed User
No I won't. The capitalization won't be updated after the error is fixed.

Also if I type Class.method and click on any other line, the capitalization of that method won't be updated to reflect the capitalization of its declaration.
 
Last edited:

Sandman

Expert
Licensed User
Longtime User
Also if I type Class.method and click on any other line, the capitalization of that method won't be updated to reflect the capitalization of its declaration.
Yeah, I've noticed this too. I solve it by pressing enter at the end of the line, that fixes the capitalization. I've just accepted that the editor is a bit clunky.
 

TelKel81

Active Member
Licensed User
Please upload a test project
I don't have to upload a project, you just have to click on another line while your cursor is on a line in which the capitalization of a method (that's in a different class) does not correspond to the capitalization of its declaration.

e.g. point.x won't resolve to point.X if you change line with mouse while you're in any other class than Point.

The line doesn't have to be in error either.
 

toby

Well-Known Member
Licensed User
Longtime User
A project is worth a thousand words, yet so far you haven't provided a single line of code. Both @Erel and I confirmed the IDE works as expected as far as your problem is concerned, and couldn't reproduce the problem you described.


B4X:
Sub Class_Globals
    Private Root As B4XView
    Private xui As XUI
    Dim X As Int
    Dim Y As Int=99
    Dim TheCity As String="London"
    Dim theCountry As String="England"
    Dim NewValue As String
End Sub

Public Sub Initialize
'    B4XPages.GetManager.LogEvents = True
End Sub

'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
    'note: Even though the following 2 lines of code have an error, the variable capitalization is done correctly when Enter is pressed or use mouse to click anoher line.
    NewValue-=TheCity 'typed: newvalue-=thecity
    NewValue+=theCountry 'typed: newvalue+=thecountry
   

   
End Sub
 

Attachments

  • capitalization.png
    capitalization.png
    23.3 KB · Views: 56
  • Project.zip
    14.4 KB · Views: 60

toby

Well-Known Member
Licensed User
Longtime User
(edited)
I finally saw your problem. Personally, I prefer to select the sub name from the dropdown list, instead of typing it in full manually. I've found that it's easier for me.
 
Last edited:

TelKel81

Active Member
Licensed User
It's a 3 character word, I want to type it, it's faster than scrolling down with the arrow key. Is it frivolous that I expect the IDE to auto-capitalize whatever method name isn't currently matching its declaration when my cursor leaves that line and there is no error in my code ?

Also, in the 2nd part of the GIF example, I copy the line after highlighting it with CTRL+SHIFT+LEFT ARROW, and when I paste it and press Enter, the capitalization isn't updated. In that case, there is no dropdown list.
 

Cableguy

Expert
Licensed User
Longtime User
I honestly don't understand why this is going this far...
@toby kept asking for a project/code example to demonstrate the "error", even after several explanations about the fact that this is not a code error but an IDE behavior. Even after the fact that many other users confirms that this odd behavior exists, and @Martin D. shows exactly what he is trying to explain, some keep telling him how he should code!
This IS a demonstrated odd IDE behavior. One that many of us have already noticed, but preferred to not bring it to light, maybe to avoid exactly this kind of thread.
As I said, it's a behavior, and if @Erel deems it possible/necessary to correct, he will do his best to do it... but please, don't try to impose a certain way, your way, of coding into others!
 

TelKel81

Active Member
Licensed User
"This far" ? It's a one-page thread :) I'm just getting started !!! haha j/k...

But you're right : if Erel deems it possible/necessary to correct this demonstrated odd IDE behavior, he will do his best to do it.
 

MrKim

Well-Known Member
Licensed User
Longtime User
Yeah, if bugs me too but the IDE has SO MUCH that is RIGHT 👍👍🙏🙏 all is forgiven.
 
Top