Coder Social home page Coder Social logo

Comments (7)

DavidFeldhoff avatar DavidFeldhoff commented on June 13, 2024

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.

innonav-dev avatar innonav-dev commented on June 13, 2024

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.

DavidFeldhoff avatar DavidFeldhoff commented on June 13, 2024

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.

DavidFeldhoff avatar DavidFeldhoff commented on June 13, 2024

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.

DavidFeldhoff avatar DavidFeldhoff commented on June 13, 2024

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.

DavidFeldhoff avatar DavidFeldhoff commented on June 13, 2024

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.

DavidFeldhoff avatar DavidFeldhoff commented on June 13, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.