![]() |
SB-Prime variable intellisense - Printable Version +- Small Basic Forum (https://litdev.uk/mybb) +-- Forum: Small Basic (https://litdev.uk/mybb/forumdisplay.php?fid=1) +--- Forum: Discussion (https://litdev.uk/mybb/forumdisplay.php?fid=4) +--- Thread: SB-Prime variable intellisense (/showthread.php?tid=55) |
RE: SB-Prime variable intellisense - z-s - 04-26-2024 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. RE: SB-Prime variable intellisense - litdev - 04-26-2024 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. RE: SB-Prime variable intellisense - Scout - 04-26-2024 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. RE: SB-Prime variable intellisense - AbsoluteBeginner - 04-26-2024 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. ![]() ( But, I have a string "a + b" with spaces.) RE: SB-Prime variable intellisense - litdev - 04-26-2024 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. RE: SB-Prime variable intellisense - Scout - 04-26-2024 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 RE: SB-Prime variable intellisense - litdev - 04-26-2024 As a test I created a version of SB-Prime (uploaded) with an option to test this. Its intersting different people use things differently. RE: SB-Prime variable intellisense - AbsoluteBeginner - 04-26-2024 I'm glad I could help improve our wonderful SB-Prime. ![]() 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. RE: SB-Prime variable intellisense - litdev - 04-26-2024 Good idea - I added it into the Format command - right click context menu and interface button. RE: SB-Prime variable intellisense - Scout - 04-26-2024 One entry for each character ![]() How do you recognize that a variable has been written? |