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
[PSS 2017] Copy Definition
Forum rules
Do not post any licensing information in this forum.
Do not post any licensing information in this forum.
Re: [PSS 2017] Copy Definition
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.
Alternatively, if you triple-click on the number column in the editor, it will automatically select the whole function.
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: [PSS 2017] Copy Definition
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
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