Background/Situation
When Rider extracts a new file, it creates the namespace declared at the top of the file:
namespace MyTest;
public class MyClass
{
}
However, it is preferred to use the well-known "old" format with nested namespaces and classes:
namespace MyTest
{
public class MyClass
{
}
}
Question
Is it possible to edit the default behavior/template to avoid quite often manual switches (even with the refactoring option)? How to disable top-level-statements?
Answer
To disable top-level statements in the .cs files, put the caret to it, press the wrench icon in the gutter, and choose To explicit program class.
Also, it is possible to disable top-level statements right on the project's creation. When you are creating a new project in the wizard, tick Do not use top-level statements checkbox.
Comments
0 comments
Please sign in to leave a comment.