We would like to build a community for Small Basic programmers of any age who like to code. Everyone from total beginner to guru is welcome. Click here to register and share your programming journey!


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SB-Prime variable intellisense
#11
Hello Everyone.
My General settings:    
And The Problem You Are talking about Is That In Both Standard  SB IDE And SB-Prime in a certain file (if its a temp or a saved) the variable which are deleted also appears without any value. but if you save and close the ide and then reopen the saved file the does not appears in intellisense.
maybe this problem would be fixed in SB-Prime as Standard SB IDE Cannot be Modified.
ZS
Reply
#12
Lots to digest there.

1] When a variable is found, it is not later deleted even if you delete all occurences in your code - this is expected behavior (maybe not what you expect, but it is how the code works).  New variables are checked for on any line that has been added/changed after the caret moves to a different line.  The list of found variables just grows for each program window i.e. the entire file is not parsed continually.  As Z-S observed, if a program is copied to a new window or saved and re-opend, then the entire file is parsed and only variables present are added to the list for that window.

2] AB (post 8), I cannot reproduce this

3] Scout (post 9) not sure if this is covered by point 1.  

I tried using /l:de-de and cannot see anything that isn't consistent with the rules I described.  Its hard sometimes to distinguish between what someone expects to happen and what I know know the code is doing.

   
Reply
#13
The behavior of the variable history should have been just a comment and is to be expected.
I can no longer reproduce the lack of "Text" and "Textwindow".
It only happened once when setting the language version in the IDE for the first time and then restarting SB-Prime.
Now I can set and delete the language version and restart and everything is fine.
[-] The following 1 user Likes Scout's post:
  • litdev
Reply
#14
Just in case, I will write in more detail my steps for post 8.

I launch SB-Prime.
I type the text “a = 3” and click “Enter”.
I type the text “test = 5” and click “Enter”.
Now I position the cursor at the end of the first line and click "Enter".
I type the text "b = 4". Then I click with the mouse at the beginning of the empty fourth line and type the text.
I write the letter “a” and this letter is displayed in the list.
Next, I write “+ b”, but the list does not appear. It turns out as seen in the screenshot.  Huh
( But, I have a string "a + b" with spaces.)
[-] The following 2 users Like AbsoluteBeginner's post:
  • litdev, z-s
Reply
#15
Excellent instructions I can reproduce!

This actually looks like a bug/feature in the Scintilla lexer (external dll I use) combined with my logic.

1] I only add a variable when the lexer is checking a line that is not the current.
2] The Scintilla lexer sends an event message whenever a line needs to be checked.

So if Scintilla lexer sends messages for parsing when I am on the line, I ignore it for variables becuase they could be being changed or part way through writng the name.
The Scintilla lexer however does not send a message if you just move the mouse away from a line rather than send a key.
So if you just move away and type, then this variable has not been tested for and not added to the list of variables.

This doesn't happen for me usually because I use a return key at the end of lines I write, and don't actually use the intellisense much.

Only way I can see to fix is to relax my rule about not considering variables on the current line - but this could result in lots of unnecessay variables added.
[-] The following 1 user Likes litdev's post:
  • AbsoluteBeginner
Reply
#16
If the line b=4 is completed with "Enter", b appears in the list.
If only the mouse pointer is placed in the last line, b does not appear in the list!
Line b=4 is not recognized as complete.

If one of the unrecognized variables is subsequently completed with ENTER, all variables are updated
[-] The following 1 user Likes Scout's post:
  • AbsoluteBeginner
Reply
#17
As a test I created a version of SB-Prime (uploaded) with an option to test this.  Its intersting different people use things differently.

   
[-] The following 1 user Likes litdev's post:
  • AbsoluteBeginner
Reply
#18
I'm glad I could help improve our wonderful SB-Prime.  Smile

I wonder if my proposal to create a button in SB-Prime (or assign a hotkey) could be useful for business, when clicked, the Editor would check whether there are variables in the list that have already been deleted in the code? That is, when you click such a button, the Editor will view all the code as it does when the code is first loaded.
[-] The following 1 user Likes AbsoluteBeginner's post:
  • litdev
Reply
#19
Good idea - I added it into the Format command - right click context menu and interface button.
[-] The following 1 user Likes litdev's post:
  • AbsoluteBeginner
Reply
#20
One entry for each character  Wink

   

How do you recognize that a variable has been written?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)