Comments (7)
Good Point, makes sense :)
The var keyword is always a discussion point. I don't know yet how to make it suitable for all.
I thought about going into the snippet mode after the procedure is created, so that you can tab through (and delete) the var keywords if you want to. Or maybe I should make it configurable:
- "add var always"
- "add var never"
- "use snippet mode"
and maybe also:
- "add var to variables which contain the following words" as you suggested.
But I don't like to make everything configurable and keep it simple instead, so I tend to use the snippet mode, even if you then always jump to the procedure definition and have to go back to the calling position manually (But you do that anyway to check the var keywords, don't you?)...
I would love to hear your thoughts on that. :)
from al-codeactions.
Yes, currently we have to jump to the definition anyway to check the var assignment. Adding the var keyword to all variables would eliminate this process (at least for us). So a configuration would help us a lot. With a DropDown field for the three possible options it should still be a pretty lean configuration.
We didn’t think to much about adding the var only to specific variable names, because we have to add a lot of var keywords to variables that do not follow a specific naming convention. But the two I suggested are used widely, also by Microsoft. So from our point of view you could add the keyword to those without a configuration.
If you decide to not add a configuration, a snippet mode would be very beneficial, since we have to check the definition in nine out of ten cases.
from al-codeactions.
Okay, thanks for your input.
Unfortunately I'm currently quite busy, so that I'm most probably not able to make it this week, but I'll keep you posted.
from al-codeactions.
Hi InnoNavSupport, it has been some time that you've posted the issue and I didn't kept my promise to keep you posted - sorry for that.
I just re-read my issues and changed my mind on this topic and decided to pick your idea up, that for event publishers, all parameters will be var. Hope that's still helpful for you, even a year later :)
Thanks for your idea and cheers,
David
from al-codeactions.
Small sitenote: "All parameters will be var" is not entirely correct. I'll only pass them as 'var' if it's possible. So literals or something like that won't have the 'var' keyword (see code-sample in #69 )
from al-codeactions.
Based on the response in issue 69, I changed it again a little bit.
There will be two new settings for your needs:
- varParameters: string[]. Parameters with these names will always be declared as var-Parameters. Default: ["IsHandled"]
- publisherHasVarParametersOnly: boolean. All parameters of new publishers will be declared as var-parameters. Default: false
I hope that fits your needs.
Best regards & Cheers
David
from al-codeactions.
And it's released. Please check out the issue #69 how it's solved. I'll close this now to focus any feedback on that issue. But thanks ofr reporting!
from al-codeactions.
Related Issues (20)
- [Bug] "Promote Action" does not add actionRef HOT 2
- [Improvement] Extract to Procedure could avoid var for paramater variables HOT 2
- Extract to procedure - Preceding Comments are missing HOT 4
- [Question] Linux support HOT 1
- Generate in-object Permission property HOT 2
- [Create Procedure] adds "internal" even if the caller is in a different app HOT 4
- Extract to Procedure unavailable in larger projects HOT 13
- Extract to procedure is not available after installing Pre-Release version HOT 18
- Extract Label Tries to Rename Wrong Thing HOT 7
- 'Add OnBefore/OnAfter publisher' unavailable HOT 3
- "Create procedure" on Rec inside a page extension will create a function inside the page extension HOT 1
- Promote Action ignores "" HOT 1
- Possible bug in "Reference to Built in functions" HOT 1
- Many functionalities are broken with AZ AL Dev Tools/AL Code Outline v3.0.56
- Rport functionality and design HOT 1
- Create overload does not work anymore HOT 3
- Slows down other QuickFixes HOT 1
- Remove unused Variables Error HOT 2
- Slows down intellisense HOT 4
- Poor Performance with AL Lang v13 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from al-codeactions.