{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/72","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/72/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/72/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/72/events","html_url":"https://github.com/dotnet/roslyn/issues/72","id":55413308,"number":72,"title":"Expose directive APIs on CSharpSyntaxTree","user":{"login":"davidfowl","id":95136,"avatar_url":"https://avatars.githubusercontent.com/u/95136?v=3","gravatar_id":"","url":"https://api.github.com/users/davidfowl","html_url":"https://github.com/davidfowl","followers_url":"https://api.github.com/users/davidfowl/followers","following_url":"https://api.github.com/users/davidfowl/following{/other_user}","gists_url":"https://api.github.com/users/davidfowl/gists{/gist_id}","starred_url":"https://api.github.com/users/davidfowl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidfowl/subscriptions","organizations_url":"https://api.github.com/users/davidfowl/orgs","repos_url":"https://api.github.com/users/davidfowl/repos","events_url":"https://api.github.com/users/davidfowl/events{/privacy}","received_events_url":"https://api.github.com/users/davidfowl/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/roslyn/labels/1%20-%20Planning","name":"1 - Planning","color":"cccccc"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/API","name":"API","color":"fc2929"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-Compilers","name":"Area-Compilers","color":"5319e7"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Feature%20Request","name":"Feature Request","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"jaredpar","id":146967,"avatar_url":"https://avatars.githubusercontent.com/u/146967?v=3","gravatar_id":"","url":"https://api.github.com/users/jaredpar","html_url":"https://github.com/jaredpar","followers_url":"https://api.github.com/users/jaredpar/followers","following_url":"https://api.github.com/users/jaredpar/following{/other_user}","gists_url":"https://api.github.com/users/jaredpar/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredpar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredpar/subscriptions","organizations_url":"https://api.github.com/users/jaredpar/orgs","repos_url":"https://api.github.com/users/jaredpar/repos","events_url":"https://api.github.com/users/jaredpar/events{/privacy}","received_events_url":"https://api.github.com/users/jaredpar/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/dotnet/roslyn/milestones/2","html_url":"https://github.com/dotnet/roslyn/milestones/Unknown","labels_url":"https://api.github.com/repos/dotnet/roslyn/milestones/2/labels","id":937398,"number":2,"title":"Unknown","description":"This represents work which is not planned for a specific release.\r\n\r\n<!---\r\n@huboard:{\"order\":0.25}\n-->\r\n","creator":{"login":"jaredpar","id":146967,"avatar_url":"https://avatars.githubusercontent.com/u/146967?v=3","gravatar_id":"","url":"https://api.github.com/users/jaredpar","html_url":"https://github.com/jaredpar","followers_url":"https://api.github.com/users/jaredpar/followers","following_url":"https://api.github.com/users/jaredpar/following{/other_user}","gists_url":"https://api.github.com/users/jaredpar/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredpar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredpar/subscriptions","organizations_url":"https://api.github.com/users/jaredpar/orgs","repos_url":"https://api.github.com/users/jaredpar/repos","events_url":"https://api.github.com/users/jaredpar/events{/privacy}","received_events_url":"https://api.github.com/users/jaredpar/received_events","type":"User","site_admin":false},"open_issues":328,"closed_issues":72,"state":"open","created_at":"2015-01-15T20:46:02Z","updated_at":"2015-09-02T20:29:50Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2015-01-25T12:21:09Z","updated_at":"2015-09-02T23:16:50Z","closed_at":null,"body":"I'd love to access this member without using private reflection:\r\n\r\nhttps://github.com/dotnet/roslyn/blob/b6484300dfafb43af0c27e542ec457a7583e1aa8/src/Compilers/CSharp/Portable/Syntax/CSharpSyntaxTree.cs#L116\r\n\r\nThe use case is the DNX compiler. I'd like to be able to do more efficient cross compiling (per target framework) by reusing syntax trees that are don't contain #ifdefs.\r\n\r\nhttps://github.com/dotnet/roslyn/blob/b6484300dfafb43af0c27e542ec457a7583e1aa8/src/Compilers/CSharp/Portable/Syntax/CSharpSyntaxTree.cs#L136"},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/137271294","html_url":"https://github.com/dotnet/roslyn/issues/72#issuecomment-137271294","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/72","id":137271294,"user":{"login":"jaredpar","id":146967,"avatar_url":"https://avatars.githubusercontent.com/u/146967?v=3","gravatar_id":"","url":"https://api.github.com/users/jaredpar","html_url":"https://github.com/jaredpar","followers_url":"https://api.github.com/users/jaredpar/followers","following_url":"https://api.github.com/users/jaredpar/following{/other_user}","gists_url":"https://api.github.com/users/jaredpar/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredpar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredpar/subscriptions","organizations_url":"https://api.github.com/users/jaredpar/orgs","repos_url":"https://api.github.com/users/jaredpar/repos","events_url":"https://api.github.com/users/jaredpar/events{/privacy}","received_events_url":"https://api.github.com/users/jaredpar/received_events","type":"User","site_admin":false},"created_at":"2015-09-02T23:16:50Z","updated_at":"2015-09-02T23:16:50Z","body":"Chatted a bit with @davidfowl about this request.  The end goal here is to make it easy to share SyntaxTree values between compilations when there are no `#ifdef / #else / etc ...`.  This helps support their cross compilation goals.  \r\n\r\nThe particular item mentioned here, `_hasDirectives` doesn't quite meet this goal.  It is really tracking whether or not any directive is present in the file.  That includes `#pragma, #region, etc ...` which have no impact on cross compilation.  \r\n\r\nInstead in order to support this scenario, and many others, we should add a new API of roughly the following form:\r\n\r\n```csharp\r\npublic IList<DirectiveTriviaSyntax> GetDirectiveTokens();\r\n```\r\n\r\nThis API would make it easy to detect the items that inhibit sharing SyntaxTree items between Compilation values.  \r\n\r\n\r\n\r\n"}}