dotnet / dotnet/vblang

[Proposal] Make "End Namespace" optional

Open
#532 15 comments 5 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
328
Forks
71
PR merge metrics
No merged PRs in 30d

Description

It's common practice to have single class, interface, module per file so it's rare case that we need two namespaces in single file, i can think only that in case of generated files it may be usefull to have multiple namespaces per file.

So instead of writing:
```vb
Namespace Sample
Class Test
End Class
End Namespace
```
it would be nice if it could be written as:

```vb
Namespace Sample
Class Test
End Class
```

In case that there are two namespace in file, starting new namespace should implicitly close previous one, so in next example we would have Sample1.Test and Sample2.Test classes.
```vb
Namespace Sample1
Class Test
End Class

Namespace Sample2
Class Test
End Class
```
Update:
1. Mxing namespace styles in same file would not be allowed

2. Nesting namespace is just new namespace with full name
```vb
Namespace One
Namespace One.Two
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.