When I try to refresh Rubberduck, it runs into a Resolver Error. I have attached the log file.
P.s. Might I suggest that you log the Rubberduck version and Office info? Would make it much easier to point the problem to specific versions.
RubberduckLog.txt
Re PS: That was already incorporated. The newest version will log basic OS and Host information when starting up.
The Log you have there is pretty interesting. @retailcoder The SafeComWrapper.Release results in an ArgumentException as soon as it goes into Item:
2017-01-02 20:37:40.5660;ERROR;Rubberduck._Extension;System.ArgumentException: Invalid argument.
at Microsoft.Vbe.Interop.Forms.Controls.Item(Object varg)
at Rubberduck.VBEditor.SafeComWrappers.VBA.Controls.get_Item(Object index) in c:\Users\Mathieu\Documents\GitHub\Rubberduck\Rubberduck.VBEEditor\SafeComWrappers\VBA\Controls.cs:line 24
at Rubberduck.VBEditor.SafeComWrappers.VBA.Controls.Release() in c:\Users\Mathieu\Documents\GitHub\Rubberduck\Rubberduck.VBEEditor\SafeComWrappers\VBA\Controls.cs:line 43
at Rubberduck.VBEditor.SafeComWrappers.VBA.VBComponent.Release() in c:\Users\Mathieu\Documents\GitHub\Rubberduck\Rubberduck.VBEEditor\SafeComWrappers\VBA\VBComponent.cs:line 174
at Rubberduck.VBEditor.SafeComWrappers.VBA.VBComponents.Release() in c:\Users\Mathieu\Documents\GitHub\Rubberduck\Rubberduck.VBEEditor\SafeComWrappers\VBA\VBComponents.cs:line 81
at Rubberduck.VBEditor.SafeComWrappers.VBA.VBProject.Release() in c:\Users\Mathieu\Documents\GitHub\Rubberduck\Rubberduck.VBEEditor\SafeComWrappers\VBA\VBProject.cs:line 109
at Rubberduck.VBEditor.SafeComWrappers.VBA.VBProjects.Release() in c:\Users\Mathieu\Documents\GitHub\Rubberduck\Rubberduck.VBEEditor\SafeComWrappers\VBA\VBProjects.cs:line 67
at Rubberduck.VBEditor.SafeComWrappers.VBA.VBE.Release() in c:\Users\Mathieu\Documents\GitHub\Rubberduck\Rubberduck.VBEEditor\SafeComWrappers\VBA\VBE.cs:line 76
at Rubberduck._Extension.ShutdownAddIn() in c:\Users\Mathieu\Documents\GitHub\Rubberduck\RetailCoder.VBE\Extension.cs:line 195;
The error described in the log that can be observed is the following:
`
2017-01-02 21:33:14.7350;ERROR;Rubberduck.Parsing.VBA.ComponentParseTask;Exception thrown in thread 56.;Rubberduck.Parsing.Symbols.SyntaxErrorException: extraneous input 'const' expecting {ABS, ANY, ARRAY, B_CHAR, CBOOL, CBYTE, CCUR, CDATE, CDBL, CDEC, CINT, CLNG, CLNGLNG, CLNGPTR, CSNG, CSTR, CURRENCY, CVAR, CVERR, DEBUG, DOEVENTS, FIX, INPUTB, INT, LBOUND, LEN, LENB, LONGLONG, LONGPTR, MIDB, MIDBTYPESUFFIX, MIDTYPESUFFIX, PSET, SGN, UBOUND, ACCESS, ADDRESSOF, ALIAS, AND, ATTRIBUTE, APPEND, BEGIN, BINARY, BOOLEAN, BYVAL, BYREF, BYTE, CLASS, CLOSE, DATABASE, DATE, DOUBLE, END, EQV, ERROR, FALSE, GET, IMP, IN, INPUT, IS, INTEGER, LOCK, LONG, LIB, LIKE, LINE_INPUT, LOCK_READ, LOCK_WRITE, LOCK_READ_WRITE, ME, MID, MOD, NAME, NEW, NOT, NOTHING, NULL, OBJECT, ON_ERROR, OPEN, OPTIONAL, OR, OUTPUT, PARAMARRAY, PRESERVE, PRINT, PTRSAFE, PUT, RANDOM, READ, READ_WRITE, REM, RESET, SEEK, SHARED, SINGLE, SPC, STEP, STRING, TAB, TEXT, THEN, TO, TRUE, TYPEOF, UNLOCK, UNTIL, VARIANT, VERSION, WIDTH, WITHEVENTS, WRITE, XOR, '[', WS, IDENTIFIER, LINE_CONTINUATION, LOAD, RESUME_NEXT}
at Rubberduck.Parsing.Symbols.ExceptionErrorListener.SyntaxError(IRecognizer recognizer, IToken offendingSymbol, Int32 line, Int32 charPositionInLine, String msg, RecognitionException e) in c:\Users\Mathieu\Documents\GitHub\Rubberduck\Rubberduck.Parsing\Symbols\ExceptionErrorListener.cs:line 10
at Antlr4.Runtime.ProxyErrorListener`1.SyntaxError(IRecognizer recognizer, Symbol offendingSymbol, Int32 line, Int32 charPositionInLine, String msg, RecognitionException e)
at Antlr4.Runtime.Parser.NotifyErrorListeners(IToken offendingToken, String msg, RecognitionException e)
at Antlr4.Runtime.DefaultErrorStrategy.ReportUnwantedToken(Parser recognizer)
at Antlr4.Runtime.DefaultErrorStrategy.Sync(Parser recognizer)
at Rubberduck.Parsing.Grammar.VBAParser.whiteSpace() in c:\Users\Mathieu\Documents\GitHub\Rubberduck\Rubberduck.Parsing\Grammar\VBAParser.cs:line 19534
at Rubberduck.Parsing.Grammar.VBAParser.constStmt() in c:\Users\Mathieu\Documents\GitHub\Rubberduck\Rubberduck.Parsing\Grammar\VBAParser.cs:line 5361
at Rubberduck.Parsing.Grammar.VBAParser.moduleDeclarationsElement() in c:\Users\Mathieu\Documents\GitHub\Rubberduck\Rubberduck.Parsing\Grammar\VBAParser.cs:line 1270
at Rubberduck.Parsing.Grammar.VBAParser.moduleDeclarations() in c:\Users\Mathieu\Documents\GitHub\Rubberduck\Rubberduck.Parsing\Grammar\VBAParser.cs:line 988
at Rubberduck.Parsing.Grammar.VBAParser.module() in c:\Users\Mathieu\Documents\GitHub\Rubberduck\Rubberduck.Parsing\Grammar\VBAParser.cs:line 354
at Rubberduck.Parsing.Grammar.VBAParser.startRule() in c:\Users\Mathieu\Documents\GitHub\Rubberduck\Rubberduck.Parsing\Grammar\VBAParser.cs:line 266
at Rubberduck.Parsing.VBA.VBAModuleParser.Parse(String moduleName, String moduleCode, IParseTreeListener[] listeners, ITokenStream& outStream) in c:\Users\Mathieu\Documents\GitHub\Rubberduck\Rubberduck.Parsing\VBA\VBAModuleParser.cs:line 34
at Rubberduck.Parsing.VBA.AttributeParser.Parse(IVBComponent component) in c:\Users\Mathieu\Documents\GitHub\Rubberduck\Rubberduck.Parsing\VBA\AttributeParser.cs:line 51
at Rubberduck.Parsing.VBA.ComponentParseTask.Start(CancellationToken token) in c:\Users\Mathieu\Documents\GitHub\Rubberduck\Rubberduck.Parsing\VBA\ComponentParseTask.cs:line 51
麓
@halcwb Somewhere in your code you use const and the parser doesn't like that. this should manifest as a parser error (but doesn't for whatever reason). Have you double-checked your code compiles without problems in the vbe?
Note that the log shows Rubberduck was trying to shut down in the middle of parsing 馃槙
The code compiles without problems. I use Option Explicit.
I use const as a prefix for private const variables. I use CONST_ prefix for public const variables. I do not have an instance of const as whole word in my code. So, I don't think that Rubberduck should fail because of this.
P.s. Feel free to check out my repository at: https://github.com/halcwb/AfsprakenProgramma
The prefixes aren't the issue - this resolves just fine:
Public Const CONST_Foo = 42
Sub Bar()
Debug.Print CONST_Foo
End Sub
What _isn't_ clear is why there's still a parser thread running at that point in the log. The inspections finish and the Find command starts here:
2016-12-19 15:28:44.4846;DEBUG;Rubberduck.UI.Command.MenuItems.ParentMenus.ParentMenuItemBase;(2126321) Executing click handler for menu item '&Find all references...', hash code 26250893;
2016-12-19 15:28:53.3776;TRACE;Rubberduck.UI.Inspections.InspectionResultsViewModel+d__38;Inspections loaded in 39072ms;
Then shortly after, the Settings click handler starts:
2016-12-19 15:29:54.9796;DEBUG;Rubberduck.UI.Command.MenuItems.ParentMenus.ParentMenuItemBase;(19136893) Executing click handler for menu item 'S&ettings', hash code 36712608;
But...there isn't any parser state changed logged before it hits the parser error here:
2016-12-19 19:00:20.1276;ERROR;Rubberduck.Parsing.VBA.RubberduckParser;Exception thrown acquiring declarations for 'frmNaamGeven' (thread 17).;System.NullReferenceException: Object reference not set to an instance of an object.
at Rubberduck.VBEditor.SafeComWrappers.VBA.Controls.System.Collections.Generic.IEnumerable.GetEnumerator() in c:\Users\Mathieu\Documents\GitHub\Rubberduck\Rubberduck.VBEEditor\SafeComWrappers\VBA\Controls.cs:line 29
at Rubberduck.Parsing.Symbols.DeclarationSymbolsListener.DeclareControlsAsMembers(IVBComponent form) in c:\Users\Mathieu\Documents\GitHub\Rubberduck\Rubberduck.Parsing\Symbols\DeclarationSymbolsListener.cs:line 168
at Rubberduck.Parsing.Symbols.DeclarationSymbolsListener..ctor(RubberduckParserState state, QualifiedModuleName qualifiedName, ComponentType type, IEnumerable1 annotations, IDictionary2 attributes, Declaration projectDeclaration) in c:\Users\Mathieu\Documents\GitHub\Rubberduck\Rubberduck.Parsing\Symbols\DeclarationSymbolsListener.cs:line 119
at Rubberduck.Parsing.VBA.RubberduckParser.ResolveDeclarations(IVBComponent component, IParseTree tree) in c:\Users\Mathieu\Documents\GitHub\Rubberduck\Rubberduck.Parsing\VBA\RubberduckParser.cs:line 549
My suspicion is that this is related to issues in tracking the parser state. Possibly another manifestation of the underlying cause for #2459?
@comintern that looks very very much like the COM wrapper iterator bug causing an NRE when iterating form controls - that one is fixed already. ...I'll sync up [next] tonight and see if 2.0.10 can be released as is - seems a lot of 2.0.9 bugs are off the table already.
This bug was resolved in build 2.0.10.36196.
Most helpful comment
This bug was resolved in build 2.0.10.36196.