{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/2044","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/2044/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/2044/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/2044/events","html_url":"https://github.com/dotnet/roslyn/issues/2044","id":68870289,"number":2044,"title":"Proposal: Project level using statements","user":{"login":"yufeih","id":511355,"avatar_url":"https://avatars.githubusercontent.com/u/511355?v=3","gravatar_id":"","url":"https://api.github.com/users/yufeih","html_url":"https://github.com/yufeih","followers_url":"https://api.github.com/users/yufeih/followers","following_url":"https://api.github.com/users/yufeih/following{/other_user}","gists_url":"https://api.github.com/users/yufeih/gists{/gist_id}","starred_url":"https://api.github.com/users/yufeih/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yufeih/subscriptions","organizations_url":"https://api.github.com/users/yufeih/orgs","repos_url":"https://api.github.com/users/yufeih/repos","events_url":"https://api.github.com/users/yufeih/events{/privacy}","received_events_url":"https://api.github.com/users/yufeih/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-04-16T08:16:51Z","updated_at":"2015-04-16T18:36:42Z","closed_at":null,"body":"**Problem**\r\n\r\nAll C# code starts with a list of `using` statements. For a large project, it is not uncommon for each file to contain more than 20 lines of using statement at the top. When moving code around, a lot of time is wasted managing namespaces.\r\n\r\nIDE can help import and remove unused namespaces, but the problem itself does go away.\r\n\r\nI propose to have a project level using statements, because files within a project are likely to share a set of common namespaces. With that, using statement inside the code file is used more for conflict resolution.\r\n\r\n**Design**\r\n\r\nThere are couple of ways to do it and I personally prefer the first approach because it integrates well with the new project file format.\r\n\r\n- Used a dedicated *json* file, or extend `project.json`.\r\n``` json\r\n{\r\n    \"namespaces\": [\r\n        \"System\",\r\n        \"System.Collections.Generic\",\r\n        \"System.Linq\"\r\n    ]\r\n}\r\n```\r\n`project.json` is a separate thing from *Roslyn*, so for *Roslyn*, this means *csc.exe* taking extra parameters just like how references are specified.\r\n\r\n- `using global System.Collections.Generic` inside a *cs* file, just like how global attributes are specified.\r\n\r\n- Automatically import all the namespaces of all referenced assemblies. Just an idea, this may create too much conflicts.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/93810381","html_url":"https://github.com/dotnet/roslyn/issues/2044#issuecomment-93810381","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/2044","id":93810381,"user":{"login":"apskim","id":852687,"avatar_url":"https://avatars.githubusercontent.com/u/852687?v=3","gravatar_id":"","url":"https://api.github.com/users/apskim","html_url":"https://github.com/apskim","followers_url":"https://api.github.com/users/apskim/followers","following_url":"https://api.github.com/users/apskim/following{/other_user}","gists_url":"https://api.github.com/users/apskim/gists{/gist_id}","starred_url":"https://api.github.com/users/apskim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apskim/subscriptions","organizations_url":"https://api.github.com/users/apskim/orgs","repos_url":"https://api.github.com/users/apskim/repos","events_url":"https://api.github.com/users/apskim/events{/privacy}","received_events_url":"https://api.github.com/users/apskim/received_events","type":"User","site_admin":false},"created_at":"2015-04-16T18:36:42Z","updated_at":"2015-04-16T18:36:42Z","body":"I'm going to add one more item to this proposal: project-level type aliases, with a similar syntax. This is something that many people have been asking for years.\r\n\r\nSomething like this (borrowing the syntax qualifier from attributes):\r\n```cs\r\nassembly:using Pair = System.Tuple<System.Int32, System.Int32>;\r\n```"}}