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

Use Rubberduck only for versioning ? #3488

Closed
Selmirrrrr opened this issue Oct 20, 2017 · 18 comments
Closed

Use Rubberduck only for versioning ? #3488

Selmirrrrr opened this issue Oct 20, 2017 · 18 comments
Labels
discussion enhancement Feature requests, or enhancements to existing features. Ideas. Anything within the project's scope. feature-source-control status-declined This will not be implemented. support Whether you're using Rubberduck or you've forked it and have questions, never hesitate to ask!

Comments

@Selmirrrrr
Copy link

Hello,

Firstly let me thank you all for this amazing OSS project. I'm pretty new to Access VBA development (3 weeks) and my main task is to version our Access source code.

I have some issues with code inspections etc (endless loading and memory leak on startup) that freezes my Access 2013 project (tried many solutions and workarounds found in previous issues but didn't find a way make things work). Actually, I don't need code inspectons and others IDE features... So my question is : is it possible to disable others features and use only source control ?

Thank's in advance for your help.

@Vogel612 Vogel612 added discussion enhancement Feature requests, or enhancements to existing features. Ideas. Anything within the project's scope. feature-source-control support Whether you're using Rubberduck or you've forked it and have questions, never hesitate to ask! labels Oct 20, 2017
@Vogel612
Copy link
Member

Hey there,

a few points:

  1. Source Control is considered an experimental feature. We don't consider it ready for full use yet.
  2. Source Control is but a small part of what Rubberduck intends to achieve. While it may be useful to have the notion of "I only want Source Control" it's not a notion that's conform with the vision of what Rubberduck wants to be.
  3. No... We don't want to throw away three years of work by making it easy to ignore when Rubberduck is bugging you about the mistakes and problems in your code or helping you actually organize your Modules and Classes and Forms into useful folders...
  4. What ostensible benefit does this have over just writing a 20-line VBA script to export all your code and doing the source control by hand?

All in all this is not something that will ever be in scope, IMO

Regards Vogel

@Vogel612 Vogel612 added the status-declined This will not be implemented. label Oct 20, 2017
@retailcoder
Copy link
Member

Thank you for your support.

FWIW you can disable inspections through the settings dialog, at the very bottom of the "inspection settings" tab there's a checkbox to "run inspections on successful parse" - un-checking that box will only run inspections when you click the "refresh" button on the Inspection Results toolwindow.

Alternatively you can selectively disable any/all inspection(s) by setting their severity level to "do not show".

That said, if inspections "take forever" to load, it's likely because it's busy crunching hundreds upon hundreds and thousands of inspection results - blanket-dismissing them all and saying "I don't need any of that" essentially boils down to dismissing roughly 100 man-years of combined VBA experience analyzing your code for you. I wouldn't be so fast to say "I don't need that" with a whole 3 weeks of experience under my belt 😉

@Selmirrrrr
Copy link
Author

Selmirrrrr commented Oct 20, 2017

@Vogel612 Ouch, what a punch...

To answer to your points :

  1. I saw this point but I can live with that, and why not contribute to improve this feature.
  2. Ok for product's vision.
  3. I don't want to ignore other Rubberduck's features, it would be amazing if I achieve to enable Ruberduck on our solution, but I tried hard since one week (without opening issue for things I think that could probably come forme our code base), so no disrespect here.
  4. As I said, I'm very new to VBA development in my new job, I'm experienced with .NET C# but unfortunately not VBA, my colleagues told me that they already tried this solution but there were some issues with cases arbitrary switching from lowercase to uppercase and that's a mess to version.

Finally, I was not asking for something new to be implemented, I was just asking if it was already implemented.

@retailcoder I already disabled code inspection and defined all severity levels to "do not show" but it's still loading until it has enough RAM (tried on a i7 16GB RAM Access 2013 64 bits config).

There's a misunderstanding, I didn't told that I'm better than others and don't need code analyzers for this solution, I'm actually using Resharper for my .NET projects and that's an AMAZING help, just like Rubberduck seems to be for VBA projects, I just thought it would be easier to enable source control without this feature.

To sum up, sorry if you felt offended with my question (maybe that's because I'm not 100% fluent in English).

@Hosch250
Copy link
Member

  1. We are contributing to this feature. It started out back in 1.4.3, was greatly improved in 2.0.0, and was just recently made even more stable. There are still known bugs, though, and we are a small team and don't have time to contribute as much as we like.
  2. If you are experienced with C#, feel free to help contribute yourself :). More contributors are always welcome.

As for the RAM problem, that is another known issue that we are working on; it is related to the parsing/resolving stage, where we figure out what variable is being called where, etc. We are considering using a DB to store some of our data instead of storing it all in the RAM, but this will be a big change, and may take a while to be implemented.

@retailcoder
Copy link
Member

@r0xtar no worries (I was a bit irked by the idea of butchering 3 years' worth of work though ;-)

RAM consumption is an issue (see #3347), but it's the result of a deliberate and necessary memory-vs-performance trade-off in favor of performance, not of a memory leak - if there's a memory leak, it's most likely closer to COM interop and RCW's (e.g. commandbars, docked toolwindows) than any of the managed code, and definitely not perceptible through RAM monitoring (although possibly observable as a silently-crashing hsot process that might linger in Tasks Manager, as explained in the release notes - we used to outright crash on exit, so significant progress was made there, and more to come).

@Selmirrrrr
Copy link
Author

@Hosch250 I completely understand the resources/time problem for un free OSS project like Rubberduck is. That's why I totally respect amazing work that's done here.

With my issue, I see RAM consumption growing until usage hits 100%, but the Access process is still working (5-10% of CPU power) and Rubberduck writes parsing errors into the log file.

I'll take some time to try to help this project, my big problem here is lack of VBA knowledge, even if Rubberduck is written in C# I don't now if it's possible to contribute with my very very low VBA level (near to zero). But I'll try :)

@retailcoder
Copy link
Member

@r0xtar haha @Hosch250 just so happens to hate VBA with a passion lol no worries about VBA knowledge, it's not a prerequesite at all 👍

@Hosch250
Copy link
Member

Hosch250 commented Oct 20, 2017

Don't worry, I have yet to write a useful program in VBA. My limit is hit with stuff like:

Sub Foo()
    Dim fuzz As Integer
    fuzz = 0
    fuzz = 3
End Sub

As for the parsing errors, that is a whole new issue. Something in our grammar is broken. Can you share the details with us? This is something we'll mark as a top-priority bug.

@retailcoder
Copy link
Member

Agreed, the parsing errors are very very problematic, and a very likely cause for slow-downs if many modules are throwing exceptions. We'd need to see the logs =)

@MDoerner
Copy link
Contributor

Just two comments regarding the logs: to see parser errors, the log needs to be at least at level Error. Moreover, if your code is confidential, you might only want to provide the actual error entry as some log entries can reveal part of the code, especially at Trace level.

@Selmirrrrr
Copy link
Author

@Hosch250 same here 👍 .

Okay, so let's start it over again.

First issue, I disabled code inspection after successful parse and defined all warnings to do not show. When running Access in VBA mode the app does nothing (Pending...) but on click on "Refresh" there's a parse error :

2017-10-20 16:58:01.8211;ERROR-2.1.0.2382;Rubberduck.Parsing.VBA.ParseCoordinator;Unexpected exception thrown in parsing run. (thread 7).;System.Runtime.InteropServices.COMException (0x8002801D): Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))
at Microsoft.Vbe.Interop.Reference.get_FullPath()
at Rubberduck.VBEditor.SafeComWrappers.VBA.Reference.get_FullPath() in C:\projects\rubberduck\Rubberduck.VBEEditor\SafeComWrappers\VBA\Reference.cs:line 45
at Rubberduck.VBEditor.QualifiedModuleName.GetProjectId(IReference reference) in C:\projects\rubberduck\Rubberduck.VBEEditor\QualifiedModuleName.cs:line 31
at Rubberduck.Parsing.VBA.COMReferenceSynchronizerBase.GetReferenceProjectId(IReference reference, IReadOnlyList1 projects) in C:\projects\rubberduck\Rubberduck.Parsing\VBA\COMReferenceSynchronizerBase.cs:line 143 at Rubberduck.Parsing.VBA.COMReferenceSynchronizerBase.GetReferencesToLoadAndSaveReferencePriority(IReadOnlyList1 projects) in C:\projects\rubberduck\Rubberduck.Parsing\VBA\COMReferenceSynchronizerBase.cs:line 118
at Rubberduck.Parsing.VBA.COMReferenceSynchronizerBase.SyncComReferences(IReadOnlyList1 projects, CancellationToken token) in C:\projects\rubberduck\Rubberduck.Parsing\VBA\COMReferenceSynchronizerBase.cs:line 69 at Rubberduck.Parsing.VBA.ParsingStageService.SyncComReferences(IReadOnlyList1 projects, CancellationToken token) in C:\projects\rubberduck\Rubberduck.Parsing\VBA\ParsingStageService.cs:line 99
at Rubberduck.Parsing.VBA.ParseCoordinator.ExecuteCommonParseActivities(IReadOnlyCollection1 toParse, IReadOnlyCollection1 toReresolveReferencesInput, CancellationToken token) in C:\projects\rubberduck\Rubberduck.Parsing\VBA\ParseCoordinator.cs:line 164
at Rubberduck.Parsing.VBA.ParseCoordinator.ParseAllInternal(Object requestor, CancellationToken token) in C:\projects\rubberduck\Rubberduck.Parsing\VBA\ParseCoordinator.cs:line 367
at Rubberduck.Parsing.VBA.ParseCoordinator.ParseAll(Object requestor, CancellationToken token) in C:\projects\rubberduck\Rubberduck.Parsing\VBA\ParseCoordinator.cs:line 303

Access is still up, but does not use much RAM and does not process anything. Okay, let's disable custom librairies.

Yes, we have our COM librairies and they are registered in my GAC but anyway, I disabled them from current project and started it up again.

On startup, Access does nothing, pending is shown and all Rubberduck controls are disabled. On clicking on refresh Access starts throwing parsing warnings like this one :

2017-10-20 17:05:14.4044;WARN-2.1.0.2382;Rubberduck.Parsing.VBA.VBAModuleParser;SLL mode failed in module Z_CompareTables2BDMemeStructure. Retrying using LL.;Rubberduck.Parsing.Symbols.SyntaxErrorException: mismatched input '[' expecting {, ':', '!', '.', '&', AND, EQV, IMP, IS, LIKE, MOD, OR, REM, XOR, '/', '', '=', GEQ, '>', LEQ, '(', '<', '-', '*', NEQ, '+', '^', NEWLINE, ''', WS, LINE_CONTINUATION} ---> Antlr4.Runtime.InputMismatchException: Exception of type 'Antlr4.Runtime.InputMismatchException' was thrown.
at Antlr4.Runtime.DefaultErrorStrategy.Sync(Parser recognizer)
at Rubberduck.Parsing.Grammar.VBAParser.lExpression(Int32 _p) in C:\projects\rubberduck\Rubberduck.Parsing\Grammar\VBAParser.cs:line 17792
--- End of inner exception stack trace ---
at Rubberduck.Parsing.Symbols.ExceptionErrorListener.SyntaxError(IRecognizer recognizer, IToken offendingSymbol, Int32 line, Int32 charPositionInLine, String msg, RecognitionException e) in C:\projects\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.NotifyErrorListeners(Parser recognizer, String message, RecognitionException e)
at Antlr4.Runtime.DefaultErrorStrategy.ReportInputMismatch(Parser recognizer, InputMismatchException e)
at Antlr4.Runtime.DefaultErrorStrategy.ReportError(Parser recognizer, RecognitionException e)
at Rubberduck.Parsing.Grammar.VBAParser.lExpression(Int32 _p) in C:\projects\rubberduck\Rubberduck.Parsing\Grammar\VBAParser.cs:line 17944
at Rubberduck.Parsing.Grammar.VBAParser.expression(Int32 _p) in C:\projects\rubberduck\Rubberduck.Parsing\Grammar\VBAParser.cs:line 16810
at Rubberduck.Parsing.Grammar.VBAParser.letStmt() in C:\projects\rubberduck\Rubberduck.Parsing\Grammar\VBAParser.cs:line 8842
at Rubberduck.Parsing.Grammar.VBAParser.mainBlockStmt() in C:\projects\rubberduck\Rubberduck.Parsing\Grammar\VBAParser.cs:line 1893
at Rubberduck.Parsing.Grammar.VBAParser.blockStmt() in C:\projects\rubberduck\Rubberduck.Parsing\Grammar\VBAParser.cs:line 1633
at Rubberduck.Parsing.Grammar.VBAParser.block() in C:\projects\rubberduck\Rubberduck.Parsing\Grammar\VBAParser.cs:line 1548
at Rubberduck.Parsing.Grammar.VBAParser.ifStmt() in C:\projects\rubberduck\Rubberduck.Parsing\Grammar\VBAParser.cs:line 7917
at Rubberduck.Parsing.Grammar.VBAParser.mainBlockStmt() in C:\projects\rubberduck\Rubberduck.Parsing\Grammar\VBAParser.cs:line 1872
at Rubberduck.Parsing.Grammar.VBAParser.blockStmt() in C:\projects\rubberduck\Rubberduck.Parsing\Grammar\VBAParser.cs:line 1633
at Rubberduck.Parsing.Grammar.VBAParser.block() in C:\projects\rubberduck\Rubberduck.Parsing\Grammar\VBAParser.cs:line 1548
at Rubberduck.Parsing.Grammar.VBAParser.ifStmt() in C:\projects\rubberduck\Rubberduck.Parsing\Grammar\VBAParser.cs:line 7917
at Rubberduck.Parsing.Grammar.VBAParser.mainBlockStmt() in C:\projects\rubberduck\Rubberduck.Parsing\Grammar\VBAParser.cs:line 1872
at Rubberduck.Parsing.Grammar.VBAParser.blockStmt() in C:\projects\rubberduck\Rubberduck.Parsing\Grammar\VBAParser.cs:line 1633
at Rubberduck.Parsing.Grammar.VBAParser.block() in C:\projects\rubberduck\Rubberduck.Parsing\Grammar\VBAParser.cs:line 1548
at Rubberduck.Parsing.Grammar.VBAParser.subStmt() in C:\projects\rubberduck\Rubberduck.Parsing\Grammar\VBAParser.cs:line 11796
at Rubberduck.Parsing.Grammar.VBAParser.moduleBodyElement() in C:\projects\rubberduck\Rubberduck.Parsing\Grammar\VBAParser.cs:line 1484
at Rubberduck.Parsing.Grammar.VBAParser.moduleBody() in C:\projects\rubberduck\Rubberduck.Parsing\Grammar\VBAParser.cs:line 1388
at Rubberduck.Parsing.Grammar.VBAParser.module() in C:\projects\rubberduck\Rubberduck.Parsing\Grammar\VBAParser.cs:line 364
at Rubberduck.Parsing.Grammar.VBAParser.startRule() in C:\projects\rubberduck\Rubberduck.Parsing\Grammar\VBAParser.cs:line 267
at Rubberduck.Parsing.VBA.VBAModuleParser.Parse(String moduleName, CommonTokenStream moduleTokens, IParseTreeListener[] listeners, BaseErrorListener errorListener, ITokenStream& outStream) in C:\projects\rubberduck\Rubberduck.Parsing\VBA\VBAModuleParser.cs:line 23

And now Rubberduck eats all my RAM :/ until there's something to eat haha (I left Access open all night long for a try)...

When rewriting this comment, I just noticed that's maybe not a parsing problem but a problem related to removed COM references is it possible ?

@Vogel612
Copy link
Member

Re the first error: See #3058

Re the second: These warnings usually just mean that the parser has had a small problem when running on a faster "prediction mode". If the code does compile, Rubberduck usually can circumvent that by retrying the parsing in the slower mode. As long as you do not see actual Parser errors, these messages should only be a slowdown issue, not a breakage issue..

@retailcoder
Copy link
Member

Gracefully failing to load a COM library is a known critical issue with a relatively simple fix that's... worth a hotfix release over the weekend.

@Vogel612 Vogel612 changed the title User Rubberduck only for versioning ? Use Rubberduck only for versioning ? Oct 20, 2017
@Selmirrrrr
Copy link
Author

@Vogel612 The code compiles, I left my PC on all night long with Access on "parsing", and the results is that my log file grows to hundreds megs, Rubberduck eats all my RAM and Access is unusable (to slow).

That's why I thought that maybe our code base is too big to be handled by Rubberduck and wanted to just enable source control.

I'll try with the COM library fix and give you news asap.

@Vogel612 thank's for misspelling correction in the title

@retailcoder
Copy link
Member

hmm that's new... and very worrying... sounds like it's stuck in some infinite "retry" loop that somehow manages to skip the "clear cached state" part of the process... rest assured that the intent was definitely not that!

@rubberduck203
Copy link
Member

Just to jump in here for a moment, if all you need is source control, I would look into one of the other solutions for Access. There are a number of projects (of varying quality) for getting VBA into source control. I do think our project offers other benefits, but may not be best for meeting your immediate need.

@Selmirrrrr
Copy link
Author

I didn't found anything else that's open source and for me it sounds like a requirement for a source control tool (I'm not scarred about my code being stolen, it's about principles).

I'll think about it this this weekend and take a look to Rubberduck's source code and see if I can do anything that could also help the community.

@retailcoder
Copy link
Member

@r0xtar awesome! Feel free to join our happy bunch anytime in our war room on Stack Exchange chat - the parent site is Code Review, you'll need 20 rep to talk, but as a moderator I can grant you explicit write access if you need it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion enhancement Feature requests, or enhancements to existing features. Ideas. Anything within the project's scope. feature-source-control status-declined This will not be implemented. support Whether you're using Rubberduck or you've forked it and have questions, never hesitate to ask!
Projects
None yet
Development

No branches or pull requests

6 participants