{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/4050","repository_url":"https://api.github.com/repos/Microsoft/visualfsharp","labels_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/4050/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/4050/comments","events_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/4050/events","html_url":"https://github.com/Microsoft/visualfsharp/issues/4050","id":278684145,"number":4050,"title":"Auto-generated methods / fields for events and properties are not marked as such","user":{"login":"realvictorprm","id":25414896,"avatar_url":"https://avatars1.githubusercontent.com/u/25414896?v=4","gravatar_id":"","url":"https://api.github.com/users/realvictorprm","html_url":"https://github.com/realvictorprm","followers_url":"https://api.github.com/users/realvictorprm/followers","following_url":"https://api.github.com/users/realvictorprm/following{/other_user}","gists_url":"https://api.github.com/users/realvictorprm/gists{/gist_id}","starred_url":"https://api.github.com/users/realvictorprm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realvictorprm/subscriptions","organizations_url":"https://api.github.com/users/realvictorprm/orgs","repos_url":"https://api.github.com/users/realvictorprm/repos","events_url":"https://api.github.com/users/realvictorprm/events{/privacy}","received_events_url":"https://api.github.com/users/realvictorprm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-12-02T13:30:05Z","updated_at":"2017-12-04T23:41:36Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"During using Code Lens I noticed in some cases multiple annotations which was obviously a bug. Cause of such were auto-generated methods / fields by the compiler which we're all on the same line (because they are virtual but need some kind of placement). To fix this I tried filtering each `FSharpMemberOfFunctionOrValue` element out which `func.IsCompilerGenerated` was true. However I noticed that several methods were not flagged although they are compiler generated. \r\n\r\nExample:\r\n\r\n```fsharp\r\ntype Foo() =\r\n\r\n    let foo = new Event<int>()\r\n\r\n    member __.bar1 =\r\n        foo.Publish\r\n\r\n    [<CLIEvent>] \r\n    member __.bar2 =\r\n        foo.Publish  \r\n```\r\n\r\nThe compiler generates here getter and setter for both members but does not flag them as compiler generated. Also the generated methods are not flagged as event neither as getter or setter method for events (e.g. `IsEventAddMethod`or `IsEventRemoveMethod`) which I think is wrong too.\r\n\r\n#### Repro Steps\r\n\r\n1. Create a new F# project\r\n2. Add the F# Compiler Service package to it\r\n3. Iterate over func declarations of the example code below (use the checker)\r\n4. Print out whether methods are compiler generated\r\n\r\n\r\n#### Expected behavior\r\nMethods which are compiler generated should have the flag `IsCompilerGenerated` set to true.\r\nMoreover relevant flags like `IsEventAddMethod` should be set to true too for events.\r\n\r\nHere a text file which contains the output for the remove method of `bar2` from the example:\r\n[EventAutogeneratedBug.txt](https://github.com/Microsoft/visualfsharp/files/1523841/EventAutogeneratedBug.txt)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/comments/349144952","html_url":"https://github.com/Microsoft/visualfsharp/issues/4050#issuecomment-349144952","issue_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/4050","id":349144952,"user":{"login":"TIHan","id":1278959,"avatar_url":"https://avatars3.githubusercontent.com/u/1278959?v=4","gravatar_id":"","url":"https://api.github.com/users/TIHan","html_url":"https://github.com/TIHan","followers_url":"https://api.github.com/users/TIHan/followers","following_url":"https://api.github.com/users/TIHan/following{/other_user}","gists_url":"https://api.github.com/users/TIHan/gists{/gist_id}","starred_url":"https://api.github.com/users/TIHan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TIHan/subscriptions","organizations_url":"https://api.github.com/users/TIHan/orgs","repos_url":"https://api.github.com/users/TIHan/repos","events_url":"https://api.github.com/users/TIHan/events{/privacy}","received_events_url":"https://api.github.com/users/TIHan/received_events","type":"User","site_admin":false},"created_at":"2017-12-04T23:41:36Z","updated_at":"2017-12-04T23:41:36Z","author_association":"CONTRIBUTOR","body":"If there are serious issues with some not being marked as compiler generated, then we should try to fix them. Perhaps would could be smarter on what is compiler generated. "}}
{"actor":{"display_login":"TIHan"}}