Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser Error reported - no further information provided to help me understand why it failed. #1703

Closed
PeterMTaylor opened this issue Jun 5, 2016 · 10 comments
Labels
bug Identifies work items for known bugs parse-tree-processing
Milestone

Comments

@PeterMTaylor
Copy link

Using clone on commit 8428eb4 but referenced to my local git objects when error is detected.

I was surprised for RD to parse fail on a VBA code I was working on. I raise this issue because I could not see how I could not understand why it failed. The debug only provided a clue that it has failed and my options were limited in regards to no further information in determining why.

capture parse error not further info

Failed twice.

(3826897) Executing click handler for menu item 'Code &Inspections', hash code 20116683
InspectionResultsViewModel handles StateChanged...
RubberduckParser handles OnStateChanged (Parsing)
RubberduckCommandBar handles StateChanged...
RubberduckCommandBar status text changes to 'Parsing...'.
App handles StateChanged (Parsing), evaluating menu states...
IParseTree for component 'usefulcJobject' acquired in 1421ms (thread 16)
Module 'usefulcJobject' state is changing to 'Parsed' (thread 16)
ParserState evaluates to 'Parsed' (thread 16)
ParserState changed to 'Parsed', raising OnStateChanged
InspectionResultsViewModel handles StateChanged...
RubberduckParser handles OnStateChanged (Parsed)
(handling OnStateChanged) Starting resolver task
Exception thrown: 'System.Runtime.InteropServices.COMException' in Rubberduck.VBEditor.dll
Exception thrown in thread 16:
System.Runtime.InteropServices.COMException (0x80070006): System Error &H80070006 (-2147024890).  
   at Microsoft.Vbe.Interop._VBComponent.get_Name()
   at Rubberduck.VBEditor.QualifiedModuleName..ctor(VBComponent component) in C:\Users\Peter\Dropbox\Doing\Github\Rubberduck\Rubberduck.VBEEditor\QualifiedModuleName.cs:line 43
   at Rubberduck.Parsing.VBA.RubberduckParserState.ClearStateCache(VBComponent component, Boolean notifyStateChanged) in C:\Users\Peter\Dropbox\Doing\Github\Rubberduck\Rubberduck.Parsing\VBA\RubberduckParserState.cs:line 445
   at Rubberduck.Parsing.VBA.RubberduckParserState.HasAllParseTrees(IReadOnlyList`1 expected) in C:\Users\Peter\Dropbox\Doing\Github\Rubberduck\Rubberduck.Parsing\VBA\RubberduckParserState.cs:line 546
   at Rubberduck.Parsing.VBA.RubberduckParser.ResolveInternal(CancellationToken token) in C:\Users\Peter\Dropbox\Doing\Github\Rubberduck\Rubberduck.Parsing\VBA\RubberduckParser.cs:line 441
   at Rubberduck.Parsing.VBA.RubberduckParser.Resolve(CancellationToken token) in C:\Users\Peter\Dropbox\Doing\Github\Rubberduck\Rubberduck.Parsing\VBA\RubberduckParser.cs:line 433
   at Rubberduck.Parsing.VBA.RubberduckParser.StateOnStateChanged(Object sender, EventArgs e) in C:\Users\Peter\Dropbox\Doing\Github\Rubberduck\Rubberduck.Parsing\VBA\RubberduckParser.cs:line 68
   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   at Rubberduck.Parsing.VBA.RubberduckParserState.OnStateChanged(ParserState state) in C:\Users\Peter\Dropbox\Doing\Github\Rubberduck\Rubberduck.Parsing\VBA\RubberduckParserState.cs:line 139
   at Rubberduck.Parsing.VBA.RubberduckParserState.set_Status(ParserState value) in C:\Users\Peter\Dropbox\Doing\Github\Rubberduck\Rubberduck.Parsing\VBA\RubberduckParserState.cs:line 289
   at Rubberduck.Parsing.VBA.RubberduckParserState.SetModuleState(VBComponent component, ParserState state, SyntaxErrorException parserError) in C:\Users\Peter\Dropbox\Doing\Github\Rubberduck\Rubberduck.Parsing\VBA\RubberduckParserState.cs:line 189
   at Rubberduck.Parsing.VBA.RubberduckParser.<>c__DisplayClass23_0.<ParseAsyncInternal>b__1(Object sender, ParseCompletionArgs e) in C:\Users\Peter\Dropbox\Doing\Github\Rubberduck\Rubberduck.Parsing\VBA\RubberduckParser.cs:line 412
   at Rubberduck.Parsing.VBA.ComponentParseTask.Start(CancellationToken token) in C:\Users\Peter\Dropbox\Doing\Github\Rubberduck\Rubberduck.Parsing\VBA\ComponentParseTask.cs:line 69
Module 'usefulcJobject' state is changing to 'Error' (thread 16)
ParserState evaluates to 'Error' (thread 16)
ParserState changed to 'Error', raising OnStateChanged
InspectionResultsViewModel handles StateChanged...
RubberduckParser handles OnStateChanged (Error)
RubberduckCommandBar handles StateChanged...
RubberduckCommandBar status text changes to 'Parse Error'.
App handles StateChanged (Error), evaluating menu states...
Hotkey '^`' hooked successfully to command 'Rubberduck.UI.Command.ReparseCommand'
Hotkey '^P' hooked successfully to command 'Rubberduck.UI.Command.IndentCurrentProcedureCommand'
Hotkey '^M' hooked successfully to command 'Rubberduck.UI.Command.IndentCurrentModuleCommand'
Hotkey '^R' hooked successfully to command 'Rubberduck.UI.Command.CodeExplorerCommand'
Hotkey '^T' hooked successfully to command 'Rubberduck.UI.Command.FindSymbolCommand'
Hotkey '^+I' hooked successfully to command 'Rubberduck.UI.Command.InspectionResultsCommand'
Hotkey '^+T' hooked successfully to command 'Rubberduck.UI.Command.TestExplorerCommand'
Hotkey '^+C' hooked successfully to command 'Rubberduck.UI.Command.Refactorings.RefactorMoveCloserToUsageCommand'
Hotkey '^+R' hooked successfully to command 'Rubberduck.UI.Command.Refactorings.CodePaneRefactorRenameCommand'
Hotkey '^+M' hooked successfully to command 'Rubberduck.UI.Command.Refactorings.RefactorExtractMethodCommand'
Hotkey '^`' hooked successfully to command 'Rubberduck.UI.Command.ReparseCommand'
Hotkey '^P' hooked successfully to command 'Rubberduck.UI.Command.IndentCurrentProcedureCommand'
Hotkey '^M' hooked successfully to command 'Rubberduck.UI.Command.IndentCurrentModuleCommand'
Hotkey '^R' hooked successfully to command 'Rubberduck.UI.Command.CodeExplorerCommand'
Hotkey '^T' hooked successfully to command 'Rubberduck.UI.Command.FindSymbolCommand'
Hotkey '^+I' hooked successfully to command 'Rubberduck.UI.Command.InspectionResultsCommand'
Hotkey '^+T' hooked successfully to command 'Rubberduck.UI.Command.TestExplorerCommand'
Hotkey '^+C' hooked successfully to command 'Rubberduck.UI.Command.Refactorings.RefactorMoveCloserToUsageCommand'
Hotkey '^+R' hooked successfully to command 'Rubberduck.UI.Command.Refactorings.CodePaneRefactorRenameCommand'
Hotkey '^+M' hooked successfully to command 'Rubberduck.UI.Command.Refactorings.RefactorExtractMethodCommand'
The thread 0x1f1c has exited with code 0 (0x0).
IParseTree for component 'restLibrary' acquired in 120775ms (thread 7)
Module 'restLibrary' state is changing to 'Parsed' (thread 7)
ParserState evaluates to 'Parsed' (thread 7)
ParserState changed to 'Parsed', raising OnStateChanged
InspectionResultsViewModel handles StateChanged...
RubberduckParser handles OnStateChanged (Parsed)
(handling OnStateChanged) Starting resolver task
Exception thrown: 'System.Runtime.InteropServices.COMException' in Rubberduck.VBEditor.dll
Exception thrown in thread 7:
System.Runtime.InteropServices.COMException (0x80070006): System Error &H80070006 (-2147024890).  
   at Microsoft.Vbe.Interop._VBComponent.get_Name()
   at Rubberduck.VBEditor.QualifiedModuleName..ctor(VBComponent component) in C:\Users\Peter\Dropbox\Doing\Github\Rubberduck\Rubberduck.VBEEditor\QualifiedModuleName.cs:line 43
   at Rubberduck.Parsing.VBA.RubberduckParserState.ClearStateCache(VBComponent component, Boolean notifyStateChanged) in C:\Users\Peter\Dropbox\Doing\Github\Rubberduck\Rubberduck.Parsing\VBA\RubberduckParserState.cs:line 445
   at Rubberduck.Parsing.VBA.RubberduckParserState.HasAllParseTrees(IReadOnlyList`1 expected) in C:\Users\Peter\Dropbox\Doing\Github\Rubberduck\Rubberduck.Parsing\VBA\RubberduckParserState.cs:line 546
   at Rubberduck.Parsing.VBA.RubberduckParser.ResolveInternal(CancellationToken token) in C:\Users\Peter\Dropbox\Doing\Github\Rubberduck\Rubberduck.Parsing\VBA\RubberduckParser.cs:line 441
   at Rubberduck.Parsing.VBA.RubberduckParser.Resolve(CancellationToken token) in C:\Users\Peter\Dropbox\Doing\Github\Rubberduck\Rubberduck.Parsing\VBA\RubberduckParser.cs:line 433
   at Rubberduck.Parsing.VBA.RubberduckParser.StateOnStateChanged(Object sender, EventArgs e) in C:\Users\Peter\Dropbox\Doing\Github\Rubberduck\Rubberduck.Parsing\VBA\RubberduckParser.cs:line 68
   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   at Rubberduck.Parsing.VBA.RubberduckParserState.OnStateChanged(ParserState state) in C:\Users\Peter\Dropbox\Doing\Github\Rubberduck\Rubberduck.Parsing\VBA\RubberduckParserState.cs:line 139
   at Rubberduck.Parsing.VBA.RubberduckParserState.set_Status(ParserState value) in C:\Users\Peter\Dropbox\Doing\Github\Rubberduck\Rubberduck.Parsing\VBA\RubberduckParserState.cs:line 289
   at Rubberduck.Parsing.VBA.RubberduckParserState.SetModuleState(VBComponent component, ParserState state, SyntaxErrorException parserError) in C:\Users\Peter\Dropbox\Doing\Github\Rubberduck\Rubberduck.Parsing\VBA\RubberduckParserState.cs:line 189
   at Rubberduck.Parsing.VBA.RubberduckParser.<>c__DisplayClass23_0.<ParseAsyncInternal>b__1(Object sender, ParseCompletionArgs e) in C:\Users\Peter\Dropbox\Doing\Github\Rubberduck\Rubberduck.Parsing\VBA\RubberduckParser.cs:line 412
   at Rubberduck.Parsing.VBA.ComponentParseTask.Start(CancellationToken token) in C:\Users\Peter\Dropbox\Doing\Github\Rubberduck\Rubberduck.Parsing\VBA\ComponentParseTask.cs:line 69
Module 'restLibrary' state is changing to 'Error' (thread 7)
ParserState evaluates to 'Error' (thread 7)
ParserState changed to 'Error', raising OnStateChanged
InspectionResultsViewModel handles StateChanged...
RubberduckParser handles OnStateChanged (Error)
RubberduckCommandBar handles StateChanged...
RubberduckCommandBar status text changes to 'Parse Error'.
App handles StateChanged (Error), evaluating menu states...
Hotkey '^`' hooked successfully to command 'Rubberduck.UI.Command.ReparseCommand'
Hotkey '^P' hooked successfully to command 'Rubberduck.UI.Command.IndentCurrentProcedureCommand'
Hotkey '^M' hooked successfully to command 'Rubberduck.UI.Command.IndentCurrentModuleCommand'
Hotkey '^R' hooked successfully to command 'Rubberduck.UI.Command.CodeExplorerCommand'
Hotkey '^T' hooked successfully to command 'Rubberduck.UI.Command.FindSymbolCommand'
Hotkey '^+I' hooked successfully to command 'Rubberduck.UI.Command.InspectionResultsCommand'
Hotkey '^+T' hooked successfully to command 'Rubberduck.UI.Command.TestExplorerCommand'
Hotkey '^+C' hooked successfully to command 'Rubberduck.UI.Command.Refactorings.RefactorMoveCloserToUsageCommand'
Hotkey '^+R' hooked successfully to command 'Rubberduck.UI.Command.Refactorings.CodePaneRefactorRenameCommand'
Hotkey '^+M' hooked successfully to command 'Rubberduck.UI.Command.Refactorings.RefactorExtractMethodCommand'
Hotkey '^`' hooked successfully to command 'Rubberduck.UI.Command.ReparseCommand'
Hotkey '^P' hooked successfully to command 'Rubberduck.UI.Command.IndentCurrentProcedureCommand'
Hotkey '^M' hooked successfully to command 'Rubberduck.UI.Command.IndentCurrentModuleCommand'
Hotkey '^R' hooked successfully to command 'Rubberduck.UI.Command.CodeExplorerCommand'
Hotkey '^T' hooked successfully to command 'Rubberduck.UI.Command.FindSymbolCommand'
Hotkey '^+I' hooked successfully to command 'Rubberduck.UI.Command.InspectionResultsCommand'
Hotkey '^+T' hooked successfully to command 'Rubberduck.UI.Command.TestExplorerCommand'
Hotkey '^+C' hooked successfully to command 'Rubberduck.UI.Command.Refactorings.RefactorMoveCloserToUsageCommand'
Hotkey '^+R' hooked successfully to command 'Rubberduck.UI.Command.Refactorings.CodePaneRefactorRenameCommand'
Hotkey '^+M' hooked successfully to command 'Rubberduck.UI.Command.Refactorings.RefactorExtractMethodCommand'
The thread 0x11c0 has exited with code 0 (0x0).
The thread 0x6ec has exited with code 0 (0x0).
The thread 0x21e4 has exited with code 0 (0x0).
The thread 0x1104 has exited with code 0 (0x0).
The thread 0x2ad4 has exited with code 0 (0x0).
The thread 0x1c74 has exited with code 0 (0x0).
The thread 0x2258 has exited with code 0 (0x0).
The thread 0x2854 has exited with code 0 (0x0).
The thread 0x144c has exited with code 0 (0x0).
The thread 0x2098 has exited with code 0 (0x0).
The thread 0x19a0 has exited with code 0 (0x0).
The thread 0x1f80 has exited with code 0 (0x0).
The thread 0x1ff4 has exited with code 0 (0x0).
The thread 0x14a8 has exited with code 0 (0x0).
The thread 0x24d4 has exited with code 0 (0x0).
Exception thrown: 'Microsoft.Mashup.Host.Document.UnauthorizedException' in Microsoft.Mashup.Document.dll
The thread 0x2ebc has exited with code 0 (0x0).
The thread 0x1440 has exited with code 0 (0x0).

The Code Explorer will not display anything except the Parser Error.

@Vogel612
Copy link
Member

Vogel612 commented Jun 5, 2016

The CodeExplorer should actually start displaying things already. The code has finished Parsing and is in the Resolving step. It seems these two things are still too tightly coupled and an error during Parsing doesn't correctly update the ParserState to ResolverError, but to ParserError.

Indicative of this are:

ParserState changed to 'Parsed', raising OnStateChanged
InspectionResultsViewModel handles StateChanged...
RubberduckParser handles OnStateChanged (Parsed)
(handling OnStateChanged) Starting resolver task

The problem lies therein that the Resolver Task doesn't correctly catch Exceptions before they bubble out into the last completed ComponentParseTask, which pokemon-catches them and makes a ParserError where there is none.
This also explains why the ParserError doesn't have further information

@ghost
Copy link

ghost commented Jun 5, 2016

Can you post the code here maybe? I'd be especially interested in the restLibrary module because it took so long to parse.

IParseTree for component 'restLibrary' acquired in 120775ms (thread 7)

@ThunderFrame
Copy link
Member

@ghost
Copy link

ghost commented Jun 5, 2016

Thanks. Looks like that parses fine here in a reasonable amount of time (1sec, times 10 on a normal PC).

@comintern
Copy link
Contributor

Exception thrown in thread 7:
System.Runtime.InteropServices.COMException (0x80070006): System Error &H80070006 (-2147024890).

I suspect this is related to the underlying cause for #1633 and #1649. See my comment here.

@Hosch250
Copy link
Member

Hosch250 commented Jun 9, 2016

There was no parser error. The trouble is the uncaught COM exception.

@Hosch250 Hosch250 added bug Identifies work items for known bugs parse-tree-processing labels Jun 10, 2016
@Hosch250 Hosch250 added this to the Version 2.0 milestone Jun 10, 2016
@PeterMTaylor
Copy link
Author

Thank you for showing me the reason for the parse error now with the 7th July build.
I can see it now when it fails and what to do about it.

capture 1633 parse error showing results

@PeterMTaylor
Copy link
Author

Um... Interestingly one of the Code Inspections suggests to me to replace be explicit about parameters as they otherwise assumed to be variant. After asking CI to replace all occurance in the module, I had no idea the parser restarted and complained having a parse error hence the message. Interestingly the parser is complaining about my use of the word = False when altered to fix variant to become "False As" as shown below in red.

capture replacing as variant caused a parse error

@retailcoder
Copy link
Member

retailcoder commented Jul 7, 2016

@PeterMTaylor that's a bug in the inspection's quick-fix. I'm opening a new issue. ref. #1982

@Vogel612
Copy link
Member

Vogel612 commented Jul 7, 2016

that's a different issue though. @retailcoder I think we can consider this one here fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Identifies work items for known bugs parse-tree-processing
Projects
None yet
Development

No branches or pull requests

6 participants