ok the good news, ...all declarations are picked up, including methods.
Rubberduck Code Inspections - 22/03/2015 11:35:11 PM
8 issues found.
Error: Variable 'result As String' is never assigned - VBAProject.ThisWorkbook, line 8
Error: Variable 'buzz As Integer = 5' is never assigned - VBAProject.ThisWorkbook, line 6
Error: Variable 'fizz As Integer = 3' is never assigned - VBAProject.ThisWorkbook, line 5
Error: Variable 'Public Sub FizzBuzz()
Const fizz As Integer = 3
Const buzz As Integer = 5
Dim result As String
Dim value As Integer
For value = 1 To 100
the less good news... all declarations are picked up, including methods
no biggie though.. I just need to be a little bit more specific with the queries :)
(and figure out why the whole declaration substatement is now showing up as the identifier name)
Busy, although I didn't touch my laptop till late Sunday, had my wife's friend over for diner (that never happened - long story), and spent Saturday evening over at my sister's place
> The Code Explorer currently gets its content by traversing the parse tree. With the new declarations API that becomes completely redundant; the tree view can be generated from the declarations API.
> Once #336 is done, implementing a "Find all references" context menu to the *Code Explorer* will be a breeze.
We also need to add this functionality to the code pane's context menu, which would allow the user to right-click any declaration and bring up a *search results* window that allows navigating to all references of the selected identifier.
in that specific case, Context is an ArgContext - it's part of the actual parse tree. ArgContext.Parent is an ArgsListContext, and ArgsListContext.Parent is, per our grammar, an EventSmtContext, DeclareStmtContext, or SubStmtContext, FunctionStmtContext, PropertyGetStmtContext, etc..
so what that code is saying, is "give me all parameters that aren't part of an Event or Declare statement, where you haven't found any references for.
the one thing that freaks me out is that the debugger won't register by itself. everytime I want to debug, I build, then run a .bat as admin to run regasm.exe on the debug build, then I can launch Excel and attach VS debugger to the EXCEL.EXE process. a PITA, but it works.
I hope I'm not going to break the debugging (on your end) with that merge
> The Declarations API is currently only visible through Inspector.FindIssuesAsync: var code = new VBProjectParseResult(_parser.Parse(project)); code.IdentifySymbols(); code.IdentifySymbolUsages(); // surely a bottleneck To be available everywhere, Parse(VBProject) needs to return a VBProjectParseResult object, with the symbols and usages already loaded.
> Indeed, VERY similar - from VariableNotUsedInspection: var declarations = parseResult.Declarations.Items.Where(declaration => (declaration.DeclarationType == DeclarationType.Variable) && !declaration.References.Any(reference => !reference.IsAssignment)); Adapting to procedures would look like this: var declarations =...
parseResult.Declarations.Items.Where(declaration => (declaration.DeclarationType == DeclarationType.Function || declaration.DeclarationType == DeclarationType.Procedure) && !declaration.References.Any()); Actually... this should also include PropertyGet, PropertyLet and PropertySet - so the inspection would say "Member is never called".
> This one needs to be tested against code like this: Public Function Foo(ByVal bar As Integer) As Integer Foo = bar End Function Public Sub DoSomething() Dim Foo(1 To 10) As Integer Foo(1) = 42 ' local-scope array assignment End Sub Function Foo is simply not visible to DoSomething, because local array Foo is shadowing it. If there's a bug with this, then function...
Yes, using prepared statements is a good habit to keep with any DB-accessing code. Remember, database administrators don't deal with bugs, only with regrets! — Phrancis57 secs ago
Although this may be actual code, without context about what the surrounding code does, and what this code accomplishes (in plain English), I find it difficult for anyone to provide a very meaningful review, hence, "Unclear what you're asking". — RubberDuck23 secs ago
Ugh I want to get this VBA to work, but I'm in so much pain I can barely think. (Did some boxing with a friend on Saturday, turns out he's much better at it than I am lol)
@RubberDuck I'm not convinced we should delete the 1.21 branch
we could keep it for historical reasons, like, in a year's time, when the code is nowhere what it was then, ..we can look at it and say "damn, look at all the work done!"
Oh wait, it made the file the first time (no error, but also no data) and the 2nd time it got that error so it must have not been allowed to overwrite it
Need to also add a check for that backslash in the path, it created C:\test_CombinedOutput.txt instead of C:\test\_combinedOutput
Store your FSO in a variable instead of creating a new one all the time. Maybe the first one is locking the file, so the second one can't use it. Which line is actually raising the error?
Are you sure? Debug.Print the path to make sure you have the path you think you do.
@Mat'sMug btw. My whole Tree was shit. I replaced it with another version that is shit. I'm starting to hate VB6 with a passion I never thought I would feel. I want constructors and delegates dang it!