[PSS 2017] Copy Definition

Post feature requests, product enhancement ideas, and other product-specific suggestions here. Do not post bug reports.
Forum rules
Do not post any licensing information in this forum.
This topic is 6 years and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
Bosparan
Posts: 290
Last visit: Fri Oct 08, 2021 11:59 am

[PSS 2017] Copy Definition

Post by Bosparan »

Hi,

one of the more frequent things I get to do is copy&paste entire function definitions.
Currently, this requires me to go the the first line, place my cursor before the the "function" statement, and then mark the entire function script-code.
If I have a single function as the entire content of the file, that's fairly easy to do with "CTRL"+"A", however in more congested scenarios - which are common for me - it's straight manual work as mentioned above.
Wouldn't an option be nice that allows us to copy the entire definition of the function the clicked portion of script is part of?
Or maybe even of a remote function when right-clicking on a function-name as it is being used in the current code.

Ugh ... I think that explanation was a bit confused, so how about these two example usages:

Copy definition of current function
- I am currently editing a function (let's call it Get-Test)
- I right-click anywhere within Get-Test and select "Copy Definition"
- I now have the definition of the function Get-Test in the clipboard

Copy definition of remote function
- I am currently editing a function (let's call it Get-Test)
- Get-Test calls another function named Get-Example
- I right-click on that call to Get-Example and select "Copy Definition"
- I now have the definition of the function Get-Example in the clipboard

Cheers,
Fred
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: [PSS 2017] Copy Definition

Post by davidc »

You can copy a function definition by using the Function Explorer context menu's Copy command.

Alternatively, if you triple-click on the number column in the editor, it will automatically select the whole function.
David
SAPIEN Technologies, Inc.
Bosparan
Posts: 290
Last visit: Fri Oct 08, 2021 11:59 am

Re: [PSS 2017] Copy Definition

Post by Bosparan »

Hi David,

thankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyou...

The function explorer isn't really suitable for me in most cases for casual use - it's mostly hidden since I care more about snippets and the two share space in my configuration, I use it mostly for project-wide navigation purposes - but I was totally unaware of the option to triple-click on the numbers bar.
With that I obviously rest my case :)

Cheers,
Fred
This topic is 6 years and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked