Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 (opening can-o-worms) Local functions
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Uniwares
Tomato Guru

Portugal
2229 Posts

Posted - Apr 02 2020 :  10:51:40 AM  Show Profile  Reply with Quote
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

feline
Whole Tomato Software

United Kingdom
17863 Posts

Posted - Apr 02 2020 :  12:52:38 PM  Show Profile  Reply with Quote
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?

zen is the art of being at one with the two'ness
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2229 Posts

Posted - Apr 02 2020 :  1:36:47 PM  Show Profile  Reply with Quote
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.
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Apr 02 2020 :  2:24:39 PM  Show Profile  Reply with Quote
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.

Edited by - sean on Apr 02 2020 2:25:08 PM
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2229 Posts

Posted - Apr 03 2020 :  06:29:47 AM  Show Profile  Reply with Quote
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.)
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17863 Posts

Posted - Apr 03 2020 :  09:42:30 AM  Show Profile  Reply with Quote
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.

zen is the art of being at one with the two'ness
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2229 Posts

Posted - Apr 03 2020 :  10:03:53 AM  Show Profile  Reply with Quote
Didn't notice anything beside that "bool" yet.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17863 Posts

Posted - Apr 04 2020 :  07:36:09 AM  Show Profile  Reply with Quote
Hopefully it is just this then, but obviously, do please let us know when you notice something else not quite right.

zen is the art of being at one with the two'ness
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2229 Posts

Posted - Jul 08 2022 :  04:56:42 AM  Show Profile  Reply with Quote
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)
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17863 Posts

Posted - Jul 08 2022 :  06:38:33 AM  Show Profile  Reply with Quote
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.

zen is the art of being at one with the two'ness
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2229 Posts

Posted - Jul 08 2022 :  07:26:01 AM  Show Profile  Reply with Quote
May need more than luck here, hahahaha
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17863 Posts

Posted - Jul 11 2022 :  07:51:16 AM  Show Profile  Reply with Quote
I don't suppose suggesting Extract Method helps much? Plus this assumes you have the time / permission for some refactoring work.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2021 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000