{"action":"created","issue":{"url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/1538","repository_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck","labels_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/1538/labels{/name}","comments_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/1538/comments","events_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/1538/events","html_url":"https://github.com/rubberduck-vba/Rubberduck/issues/1538","id":155697586,"number":1538,"title":"Com Exception while getting help file. Reflection API","user":{"login":"joshuader6","id":10895412,"avatar_url":"https://avatars.githubusercontent.com/u/10895412?v=3","gravatar_id":"","url":"https://api.github.com/users/joshuader6","html_url":"https://github.com/joshuader6","followers_url":"https://api.github.com/users/joshuader6/followers","following_url":"https://api.github.com/users/joshuader6/following{/other_user}","gists_url":"https://api.github.com/users/joshuader6/gists{/gist_id}","starred_url":"https://api.github.com/users/joshuader6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshuader6/subscriptions","organizations_url":"https://api.github.com/users/joshuader6/orgs","repos_url":"https://api.github.com/users/joshuader6/repos","events_url":"https://api.github.com/users/joshuader6/events{/privacy}","received_events_url":"https://api.github.com/users/joshuader6/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/labels/api","name":"api","color":"DDDDDd"},{"url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/labels/bug","name":"bug","color":"e11d21"},{"url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/labels/status-norepro","name":"status-norepro","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/milestones/20","html_url":"https://github.com/rubberduck-vba/Rubberduck/milestones/Version%202.0","labels_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/milestones/20/labels","id":1063094,"number":20,"title":"Version 2.0","description":"This version will include source control (GitHub) integration, WPF controls in dockable hosts, many more refactorings and inspections, and lots of bug fixes.","creator":{"login":"retailcoder","id":5751684,"avatar_url":"https://avatars.githubusercontent.com/u/5751684?v=3","gravatar_id":"","url":"https://api.github.com/users/retailcoder","html_url":"https://github.com/retailcoder","followers_url":"https://api.github.com/users/retailcoder/followers","following_url":"https://api.github.com/users/retailcoder/following{/other_user}","gists_url":"https://api.github.com/users/retailcoder/gists{/gist_id}","starred_url":"https://api.github.com/users/retailcoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/retailcoder/subscriptions","organizations_url":"https://api.github.com/users/retailcoder/orgs","repos_url":"https://api.github.com/users/retailcoder/repos","events_url":"https://api.github.com/users/retailcoder/events{/privacy}","received_events_url":"https://api.github.com/users/retailcoder/received_events","type":"User","site_admin":false},"open_issues":61,"closed_issues":276,"state":"open","created_at":"2015-04-11T13:20:05Z","updated_at":"2016-05-20T05:29:04Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2016-05-19T09:55:23Z","updated_at":"2016-05-20T09:53:12Z","closed_at":null,"body":"I was just playing around with the Reflection API and tested this: \r\n\r\nWhile hitting the duck.Parse command this happend\r\n![image](https://cloud.githubusercontent.com/assets/10895412/15389672/5a78bd20-1db8-11e6-92a5-981943f1f954.png)\r\n```\r\n\r\n public void SetModuleState(VBComponent component, ParserState state, SyntaxErrorException parserError = null)\r\n        {\r\n            if (AllUserDeclarations.Any())\r\n            {\r\n                var projectId = component.Collection.Parent.HelpFile;\r\n                var project = AllUserDeclarations.SingleOrDefault(item =>\r\n                    item.DeclarationType == DeclarationType.Project && item.ProjectId == projectId);\r\n\r\n                if (project == null)\r\n                {\r\n                    // ghost component shouldn't even exist\r\n                    ClearStateCache(component);\r\n                    Status = EvaluateParserState();\r\n                    return;\r\n                }\r\n            }\r\n            var key = new QualifiedModuleName(component);\r\n\r\n            _moduleStates.AddOrUpdate(key, new ModuleState(state), (c, e) => e.SetState(state));\r\n            _moduleStates.AddOrUpdate(key, new ModuleState(parserError), (c, e) => e.SetModuleException(parserError));\r\n            Debug.WriteLine(\"Module '{0}' state is changing to '{1}' (thread {2})\", key.ComponentName, state, Thread.CurrentThread.ManagedThreadId);\r\n            OnModuleStateChanged(component, state);\r\n            Status = EvaluateParserState();\r\n        }\r\n```\r\n\r\nI cannot seem to get the local information on Component: \r\n![image](https://cloud.githubusercontent.com/assets/10895412/15389800/f69c28cc-1db8-11e6-84b1-d5e0e7cec45d.png)\r\n\r\nPressing F5 gets me this: \r\n![image](https://cloud.githubusercontent.com/assets/10895412/15389824/159b0f5e-1db9-11e6-8fe0-b95411510649.png)\r\n\r\n```\r\n        private void ParseComponent(VBComponent component, TokenStreamRewriter rewriter = null)\r\n        {\r\n            ParseAsync(component, CancellationToken.None, rewriter).Wait();\r\n        }\r\n```\r\nIn this step the Component doesn't throw an error.\r\n![image](https://cloud.githubusercontent.com/assets/10895412/15389884/58384b92-1db9-11e6-81bf-f1118e943e18.png)\r\n\r\nNoted that \"TestDeclarations\" (Component.Name) is the module where my reflection code sits.\r\n\r\nThis resulted then in this: \r\n![image](https://cloud.githubusercontent.com/assets/10895412/15389710/7ebca534-1db8-11e6-8162-96a1992e3ebd.png)\r\n```\r\nOption Explicit\r\n\r\n\r\nSub tester()\r\n    Dim duck As New Rubberduck.ParserState\r\n    'Set duck = CreateObject(\"Rubberduck.ParserState\")\r\n    duck.Initialize Application.VBE\r\n    Debug.Print \"Parsing\"\r\n    duck.Parse\r\n    \r\n    Dim i As Variant\r\n    Dim item As Declaration\r\n    Stop\r\n    For Each i In duck.UserDeclarations\r\n        Set item = i\r\n        If item.DeclarationType = DeclarationType_ClassModule Then\r\n            Debug.Print item.Name\r\n        End If\r\n    Next\r\n    \r\nEnd Sub\r\n```\r\n\r\nStrange is that the main parser in the addin works fine without any error. "},"comment":{"url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/comments/220564395","html_url":"https://github.com/rubberduck-vba/Rubberduck/issues/1538#issuecomment-220564395","issue_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/1538","id":220564395,"user":{"login":"Vogel612","id":7288995,"avatar_url":"https://avatars.githubusercontent.com/u/7288995?v=3","gravatar_id":"","url":"https://api.github.com/users/Vogel612","html_url":"https://github.com/Vogel612","followers_url":"https://api.github.com/users/Vogel612/followers","following_url":"https://api.github.com/users/Vogel612/following{/other_user}","gists_url":"https://api.github.com/users/Vogel612/gists{/gist_id}","starred_url":"https://api.github.com/users/Vogel612/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vogel612/subscriptions","organizations_url":"https://api.github.com/users/Vogel612/orgs","repos_url":"https://api.github.com/users/Vogel612/repos","events_url":"https://api.github.com/users/Vogel612/events{/privacy}","received_events_url":"https://api.github.com/users/Vogel612/received_events","type":"User","site_admin":false},"created_at":"2016-05-20T09:53:12Z","updated_at":"2016-05-20T09:53:12Z","body":">   bei Rubberduck.Parsing.VBA.RubberduckParser.ResolveDeclarations\r\n\r\nThis suggests that the problem is in fact the resolver and not the Parser. The difference is a little ... unclear, especially since the class that ties the Parsing and Resolving together is called `RubberduckParser`... Maybe that needs a rename :confused: \r\n\r\nDo you by any chance get a ResolverError when refreshing Rubberduck through the status bar?"}}
{"actor":{"display_login":"Vogel612"}}