Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 (opening can-o-worms) Local functions

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
Uniwares Posted - Apr 02 2020 : 10:51:40 AM
Not sure if that was already reported, but local functions dont fare very well in VA.



Coloring is off, functions dont appear in Find Symbols, dont show up in nav bar (then again, they also dont show up in the VS navbar neither in the codemaid's spade), and probably a few other things i didnt check yet.

https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/local-functions

11   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Jul 11 2022 : 07:51:16 AM
I don't suppose suggesting Extract Method helps much? Plus this assumes you have the time / permission for some refactoring work.
Uniwares Posted - Jul 08 2022 : 07:26:01 AM
May need more than luck here, hahahaha
feline Posted - Jul 08 2022 : 06:38:33 AM
Unfortunately no progress to report on this, but C# local methods is something we are aware of, and it is still on our list of things to support better. It hasn't come up much since you first mentioned it, so knowing you still need this helps a bit.

I know there are some situations that work best with large methods, but 6k lines does seem a little large. Good luck, you may need it.
Uniwares Posted - Jul 08 2022 : 04:56:42 AM
Is there any progress on local functions in the methods list? Just had to deal with a 6k lines method with dozens of local methods spread all over (please dont ask why, real life happens)
feline Posted - Apr 04 2020 : 07:36:09 AM
Hopefully it is just this then, but obviously, do please let us know when you notice something else not quite right.
Uniwares Posted - Apr 03 2020 : 10:03:53 AM
Didn't notice anything beside that "bool" yet.
feline Posted - Apr 03 2020 : 09:42:30 AM
Is the colouring error the colour of "bool", or is there another error in the nav bar colouring as well? "bool" always being coloured by VA as a function outside of the editor is currently a known bug:

case=141535

which happens outside of Local Functions.
Uniwares Posted - Apr 03 2020 : 06:29:47 AM
Yes, Find References and Goto work correctly for local funcions. As reported, nav bar errs only in coloring but shows local function correctly. (ah, and the code tooltip in VA Find References is still an uncolored basic tooltip, but thats already a case if I am not mistaken.)
sean Posted - Apr 02 2020 : 2:24:39 PM
Find References and Goto are already supported on local functions. The VA Nav Bar shows context and definition when caret is on either invocation or definition. If those features are not working for you, it may be that our examples are not complex enough.

Methods in File (alt+m) support is considered a feature request (case=140866). The behavior for local functions is similar to local variables which also do not appear in the alt+m list or the Find Symbol in Solution dialog.
Uniwares Posted - Apr 02 2020 : 1:36:47 PM
Well, in a certain way, often you know that there was a function named "ReadDataFrom..." but you dont really remember if thats local or global, yet you wont to get there.
As for outline and Alt+M, i think its really nice to have, but even VS doesnt show it correctly everywhere (hint, hint), for example VS's Goto doesnt show them anywhere.
But besides all that, it doesnt really break anything serious in VA it seems.
feline Posted - Apr 02 2020 : 12:52:38 PM
We don't currently support C# Local Functions, but are aware this:

case=99749

For when we do try though, would you really expect to see them listed in the Find Symbol dialog? All of the examples given on the page you have linked to are showing Local Functions as existing inside the parent function, so not accessible outside of the parent function.

I can see it making sense to list these in the Alt-M list and VA Outline, but I am not sure about Find Symbol dialog. Or do you have a reason why they should be there?

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000