var qualifier = base.GetQualifier(reference, finder);
var document = (Declaration.GetModuleParent(reference.ParentNonScoping) as DocumentModuleDeclaration);
if (document != null)
{
if (document.SupertypeNames.Contains("Workbook"))
{
// inside a workbook module: result if unqualified.
return qualifier == null;
}
// inside a worksheet module: no result; result anywhere else.
return !document.SupertypeNames.Contains("Worksheet");
note to self: stick to "no LINQ in inspections" rule-of-thumb, it's a good rule.
now base.GetQualifier probably belongs ...elsewhere..
want thoughts on whether this seems a sensible thing to. I'm writing a visitor for type API to abstract out the mechanics of collecting information from type infos so that we can re-use the information for different purposes. A type info can have an implemented type info that may need to be visited in turn, so I have this:
public interface ITypeInfoVisitor
{
...
void VisitTypeImplementedTypeInfo(int href, ITypeInfo implementedTypeInfo, out bool visit);
...
}
basically the consumers get to decide whether they want to visit the implemented type info:
ExecuteVisit(v =>
{
v.VisitTypeImplementedTypeInfo(href, implementedTypeInfo, out var visit);
if (visit)
{
new TypeInfoWalker().Accept(_typeLib, _index, implementedTypeInfo, Visitors);
}
});
wondering now why can't it just return a bool instead of out var bool.
yes I think I was following the example too rigidly. in the examples, visitors usually have void methods
furthermore, the examples usually imply that visitors don't get to decide how they will visit; they just are visited. In this case, I don't want to visit something if they don't care for it.
also, I'm actually inclined to leave it as a out because this is a side-effect, not a direct result of the VisitImplementedTypeInfo -- what does returning false means to a VisitImplementedTypeInfo ? ShouldVisitImplementedTypeInfo also sounds silly and doesn't address the fact that information about the implemented type info are returned independently of the type info (because they pertain to the containing type info)
hmm should we be special casing? I think I asked about that before given that it's an appobject so therefore resolver should provide a global variable declaration for it automatically
one more possibly nutty question... if names is on lhs, is it somehow getting caught by the modifications you made to the resolve to find the ancestor and thus the 600+?
Just discovered twinBasic thanks to last post on RD blog. Incredible...! The only thing I am a bit disappointed is I cannot test own dll's (unfortunately Office x64 here) :(
I wanted show some new possibilities using twinBasic on main Excel's internet board in my country, but it seems I must switch to x32 first
@this I misremembered how we treat with blocks in the resolver. It should be easy to put the qualifying qualified selection on identifier references. Then, one can get the corresponding reference can be acquired from the declaration finder.
If the with block variable is an expression, one has to be a bit cautious, though.
That is actually also true for member access expressions.
@MathieuGuindon Does your fix for the inspection work for access on user-defined functions and properties returning a worksheet?
Btw, I would like to say that what they have done to rust is amazing. They have const generics for integral types now, i.e. you can define types generic over a concrete integer. E.g. one can define an n-dimensional vector generic on n.
@M.Doerner it should but I don't want to say "yes" without a test for it, the implementation is rather frail tbh.. Should be recursive but currently isn't.
users that don't have "check for new pre-release builds" enabled won't be notified of 2.5.2 until it's merged into [main]
@SonGokussj4 FYI we'll be releasing soon-ish, no more new resource keys are being merged in for v2.5.2; do you think you can have a translation PR soon?
getting above error at line : If lst.ListColumns("ExecBroker") = "ABCD" then ..
not sure how to set or use the dimension correctly..
thanks in advance for any help.
Sub processPershingManual()
Dim lst As Excel.ListObject
Dim lstRow As Excel.ListRow
Dim ListColumns As String
Dim rngHedgeServeTe...
@this Love the fixed font. I read that as Dim (ell) as Long : Debug.Print (one)
l (ell) 1 (one)
That, right there, is precisely the bug that had my dad running in circles for 3 weeks trying to track it down. (Way back when he was working on his Master's degree in the 70s)
@IvenBach nah, that was just my way of welcoming him today. I'm pushing it to have 40-50 tabs open, especially now that Firefox has banned all the decent tab managers.
(well, I haven't looked lately, but my favorites went by the wayside a while back when their internal changes eliminated a lot of my preferred extensions)
It's just that nobody noticed that my comment appeared immediately after his avatar dropped into the list. ;)
looks like having a different revision# in the version number is having an effect on what version people are downloading: past 2 hours saw 5 downloads of 2.5.2, 0 of 2.5.1
wondering whether or not we should version-bump [next] preemtively
> First, you’ll use this technique to solve one of the most annoying problems known to humanity: version-controlling Microsoft Word documents. Everyone knows that Word is the most horrific editor around, but oddly, everyone still uses it.
usually the pre-release downloads are much slower than the not-pre downloads
the .2 seems to stick out and trigger some "hey this version is much newer than the other download" response that doesn't happen with the build numbers alone (or the actual release dates lol)
gosh I need to redo that home page. I can't stand that damn carousel anymore
@MathieuGuindon Hi Mat, yeah, I've accidentally seen your Twitter post just now and checked the StackExchange site for notifications (which I periodically forget to visit).
Don't tell me not to rush. That's really dangerous :-D Quite the opposite is working better. I don't have VS installed (because last time I couldn't build RD with it.) So will try to install today and start with translations.
@M.Doerner yeah about that... did you eyeball the base method I put in the base reference inspection class? It's (poorly) doing essentially what you're about to do
just wondering - I want to allow ability to visit only a specific type info or a entire type library, so I'm making a ITypeLibVisitor and ITypeInfoVisitor. However, when visiting the type library, it might be the case that it wants to visit the type infos. That is an implementation detail that should be delegated to the visitor class, right? I'm thinking of having this:
public interface ITypeLibVisitor
{
...
void ProvideTypeInfoVisitors(IEnumerable<ITypeInfoVisitor> visitors);
...
}
if they are provided, the TypeLibWalker will then create the TypeInfoWalker and proceed to visit them via the 2nd walker.
Hm, adding the selection is much more annoying than I thought. It is not really clear to me what is the correct selection in quite a few cases. E.g. what to use for an index expression parent?
Is there a real benefit to getting the declaration, except easier cache invalidation?
I know this is not in the scope but having declarations/references instead of selection means that rewriting wouldn't necessarily require invalidating the parser cache just because the offsets in the module change.
I'm thinking of the rewrites where new lines are added or lines removed above the expression and thus do not change the contents of that particular expression. Right now, we have to invalidate the entire module if there's been a rewrite even if it's only one character change.
what's stopping us from providing a twinBASIC VBIDE add-in?
But to be realistic, though, that probably won't happen until next year or so. tB needs to grow some more before it can start building solutions on par with C#, I think.
Comming back to the references, unless one does obscure trickery, the qualifying bit of a member access in VBA can really only be a simple name expression, an index expression or a member access expression, right?
In these cases, I can get the corresponding reference and attach it to the one for the accessed member.
BTW, the obscure thing I was thinking about is a parenthesized expression containing something representing an object with an object returning default member.
#FunFact the 10th and last listed article on the news page is the release announcement for 2.5.1, so the announcement for 2.5.2 will bump it off the list