BoltBait Posted May 21, 2020 Share Posted May 21, 2020 CodeLab 5.4 Released This is only for Paint.NET 4.2.11+! Small (but important) update today... Changes: ▪ Improved suggested variable names (toe_head2001) ▪ Improvemens in Autocomplete and Intellisense (toe_head2001) ▪ Generate Type Definitions on F12. You can now see definitions inside of libraries. (toe_head2001) ▪ Remember scroll positions (and other things) when switching tabs (toe_head2001) ▪ Rewrite File New Template for up to 2 Scratch Surfaces, also bug fixes and better code (BoltBait) Grab the CodeLab DLL here: https://www.boltbait.com/pdn/CodeLab/ File New Template Improvements: When I completely rewrote the File New Templates in CodeLab 5.0, I was under the assumption that it was OK to use the DST surface as a scratch surface during the calculation of your final results. This is OK under some very narrow circumstances, but generally this should be avoided. (This could cause your effects to have different results when previewing your effect and when clicking OK to finalize your image.) In this release, I have removed this capability and replaced it with a second scratch surface called AUX. So, now you have access to the source surface (SRC) which is your layer before any changes are made, a working surface (WRK) to use as a scratch surface if necessary, a second working surface (AUX) to use if necessary, and of course the destination surface (DST) where you store your final calculated pixels. In previous versions, the blend modes had the top and bottom layers swapped--that's fixed in this build. The code generated should also be easier to understand. (This is the last update before toe_head2001 rewrites the entire compiler section.) 1 3 Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
ReMake Posted May 21, 2020 Share Posted May 21, 2020 CodeLab 5.4 in Russian You can find the new version of CodeLab in Russian here. Вы можете найти новую версию CodeLab на русском языке здесь. 1 Quote Link to comment Share on other sites More sharing options...
toe_head2001 Posted May 21, 2020 Share Posted May 21, 2020 Here's a screenshot showing Type Definitions: You can still look up Definitions on docs.microsoft.com, but you'll have to open the context menu: 1 Quote (September 25th, 2023) Sorry about any broken images in my posts. I am aware of the issue. My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
MJW Posted June 15, 2020 Share Posted June 15, 2020 Is there any way to make autocomplete less aggressive? It's driving me crazy. I try to type "x = ", and it changes "x" to "BinaryPixelOp" (?) when I press the space bar (even though "x" is a defined, in-scope variable at the time). The only way I can find to prevent it is to left click the mouse after every variable I type. I'd far rather have no autocomplete at all than too much. Quote Link to comment Share on other sites More sharing options...
toe_head2001 Posted June 15, 2020 Share Posted June 15, 2020 21 minutes ago, MJW said: ... I try to type "x = ", and it changes "x" to ... There does appear to be a bug here. I'll investigate. 22 minutes ago, MJW said: The only way I can find to prevent it is to left click the mouse after every variable I type. You can also press the Esc key. Quote (September 25th, 2023) Sorry about any broken images in my posts. I am aware of the issue. My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
BoltBait Posted June 15, 2020 Share Posted June 15, 2020 24 minutes ago, MJW said: Is there any way to make autocomplete less aggressive? It's driving me crazy. I try to type "x = ", and it changes "x" to "BinaryPixelOp" (?) when I press the space bar (even though "x" is a defined, in-scope variable at the time). The only way I can find to prevent it is to left click the mouse after every variable I type. I'd far rather have no autocomplete at all than too much. I can not get this to fail as you describe. Can you show me the script you're editing and where your cursor is when you type "x ="? Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
MJW Posted June 15, 2020 Share Posted June 15, 2020 I wish it worked the other way around: press Esc or something very specific like that to do the autocomplete, otherwise, skip it. Most of the time, I'd rather just type stuff in myself. (And I'm not even a good typist.) Quote Link to comment Share on other sites More sharing options...
MJW Posted June 15, 2020 Share Posted June 15, 2020 void XYCoords(int ix, int iy, out double x, out double y) { x = (double)ix; y = (double)iy; x = zoomScale * (x - centerX); y = zoomScale * (y - centerY); } When I got to the point of typing "x =". But that's just one of many times autocomplete inserted something I didn't want. Quote Link to comment Share on other sites More sharing options...
BoltBait Posted June 15, 2020 Share Posted June 15, 2020 That reproduces for me. Looks like the parameters of the function are not being parsed properly. Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
toe_head2001 Posted June 15, 2020 Share Posted June 15, 2020 Yeah, the auto complete box just needs to prioritize exact matches. Should be easy to fix. 5 minutes ago, MJW said: I wish it worked the other way around We are doing the "standard" way. I don't know of any editor that does it the inverse way. Quote (September 25th, 2023) Sorry about any broken images in my posts. I am aware of the issue. My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
BoltBait Posted June 15, 2020 Share Posted June 15, 2020 1 minute ago, toe_head2001 said: Yeah, the auto complete box just needs to prioritize exact matches. Should be easy to fix. It may be more complicated than that. When I entered his example, the autocomplete box didn't list "x" in it. Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
toe_head2001 Posted June 16, 2020 Share Posted June 16, 2020 1 minute ago, BoltBait said: When I entered his example, the autocomplete box didn't list "x" in it. Did you resolve the build errors before trying? Method parameters are "parsed" through Reflection of the built effect. So, if there are build errors, those parameters won't get parsed. Quote (September 25th, 2023) Sorry about any broken images in my posts. I am aware of the issue. My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
BoltBait Posted June 16, 2020 Share Posted June 16, 2020 There was a build error. It was that the out parameter "x" must be set before returning. Paradox. Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
MJW Posted June 16, 2020 Share Posted June 16, 2020 I think prioritizing the exact match would greatly improve it. However, as BoltBait just mentioned, currently the list doesn't always include the actual thing. Another example of this is that I have a class-level variable called c2. When I type it, the only autocomplete selection is some "Func2" thing. Quote Link to comment Share on other sites More sharing options...
toe_head2001 Posted June 16, 2020 Share Posted June 16, 2020 3 minutes ago, MJW said: When I type it, the only autocomplete selection is some "Funct2" thing. Were you typing in the class-level or within a Method body? That does make an intentional difference. Quote (September 25th, 2023) Sorry about any broken images in my posts. I am aware of the issue. My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
MJW Posted June 16, 2020 Share Posted June 16, 2020 Outside any method, to make it "global." A variable set in PreRender() to be used in Render(). Quote Link to comment Share on other sites More sharing options...
toe_head2001 Posted June 16, 2020 Share Posted June 16, 2020 You should see the autocomplete for 'c2' within a method (such as PreRender or Render), but you should not see it outside of a method. Quote (September 25th, 2023) Sorry about any broken images in my posts. I am aware of the issue. My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
MJW Posted June 16, 2020 Share Posted June 16, 2020 I may have misinterpreted your question. c2 is defined outside any method, but the faulty autocompletion occurred when I typed it within PreRender(). Quote Link to comment Share on other sites More sharing options...
BoltBait Posted June 16, 2020 Share Posted June 16, 2020 This can happen if the code hasn't compiled yet. Just press the compile button (F6) after defining the variable. Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
toe_head2001 Posted June 16, 2020 Share Posted June 16, 2020 User-Defined types and type members are also parsed via Reflection. Make sure the code was successfully compiled at least once before you try to get an AutoComplete for a field. (The build can fail afterwards, since a build failure won't clear out the previously set AutoComplete items.) Quote (September 25th, 2023) Sorry about any broken images in my posts. I am aware of the issue. My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
MJW Posted June 16, 2020 Share Posted June 16, 2020 6 minutes ago, BoltBait said: This can happen if the code hasn't compiled yet How can I compile code that's incomplete and therefore has a number of syntax errors? Quote Link to comment Share on other sites More sharing options...
MJW Posted June 16, 2020 Share Posted June 16, 2020 I wish there were a switch to disable autocomplete. Unless it really behaves itself, it's far more of a hindrance than a help for me. Quote Link to comment Share on other sites More sharing options...
BoltBait Posted June 16, 2020 Share Posted June 16, 2020 6 minutes ago, MJW said: How can I compile code that's incomplete and therefore has a number of syntax errors? Well, in the second example, of adding "int c2;" you can build. In the case of adding a function: void XYCoords(int ix, int iy, out double x, out double y) { x = (double)ix; y = (double)iy; x = zoomScale * (x - centerX); y = zoomScale * (y - centerY); } There's not much that you can do about it except don't type "out" both times, compile, then put them in. Type it in like this: void XYCoords(int ix, int iy, double x, double y) { } Build, then type "out" before both out variables. It works then. Pain in the butt, I know. As I said in a previous post, this situation is a paradox for CodeLab and I'm not sure we could correct something like that. Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
MJW Posted June 16, 2020 Share Posted June 16, 2020 XYCoords() is just one function among many that might not compile. If autocomplete doesn't work properly until the code is complied, perhaps it should be disabled until then. Quote Link to comment Share on other sites More sharing options...
BoltBait Posted June 16, 2020 Share Posted June 16, 2020 Well, CodeLab can offer suggestion for everything that was valid as of the last successful compile. So, it is still quite useful. I think you've just stumbled upon an interesting paradox with "out" variables. Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.