❔ Disabling Top level statements in VSCode
Anyone know how I can disable top level statemnts in VSCode? I hate the top level statements
38 Replies
Just write the boilerplate if you like useless code this much
You can just write a Program class and Main method and it'll work
the what
no well
I should rephrase
I hate the top level statements since I learnt with the old code type
Idk how to use the new tls
Boilerplate, useless code in other words
Just write
class Program
Add a void Main()
to it
Boomty
how exactly do you
use tls
like how do ymou make new methods
You just... do?
just pretend you're in the main method
qwhat if I dont wanna be 😭
calling other methods
or do you not have to do that in tls
Then you write a method right there
At the end of the file
And call it
Or you make a new file with a class and a method
And use that
public static void Main(string[] args)
{
// TLS is right here.
}
Like this?
So
Yeah
I frogot how to request stuff or whatever in methods so uh
Well, you'll need to type your parameters
Or... give them a name
Whichever it is that you didn't do
But yes
I didnt do what did I do
How do i give maaaa the name string
MethodName(type name, type name, type name)
oh my god
sorry and thanks
For example,
tyty
wait so
you're not supposed to leave the main method?
OR
there are some magic in TLS
that make things essentially end up like your first image
you're sorta overthinking top level statements was my point.
i indeed am
hm
ty
This is basically what the compiler does with top-level statements
that's a good gif
compilers can do blinkys?
so SDK5 people are the compilers
SDK5...?
.net sdk 5
And that
Uh, well, .NET 5 SDk does contain the compiler, yes
Since C# is a compiled language... it does need a compiler
I'm not sure if any of the people working on it are a compiler gained sentience, but I'd doubt that
you never know
Roslyn is indeed sentient
chat gproslyn
Fred and everyone else in #roslyn is just a figment of Roslyn
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.