kdbinsidebrains / plugin

IntelliJ Idea plugin for KDB+ Q Language
9 stars 3 forks source link

KDB Inspector Problem #99

Closed freeclb closed 2 months ago

freeclb commented 2 months ago
          you can always check all keys of a dict using command **key**:

key .db.Ax

Please make sure that you have symbol `290.130973 in the keys or copy the context of the keys here.

If I have dict with `290.130973 as a key: image

it's correctly shown in the Inspector for me: image

Feel free to reopen with more details

Originally posted by @smklimenko in https://github.com/kdbinsidebrains/plugin/issues/98#issuecomment-2232690041

freeclb commented 2 months ago

Actually .db.Ax like: image and key is symbol, KDB Inspector says structure can't be loaded.

smklimenko commented 2 months ago

In this case .db.Ax is not a dictionary but namespace: https://code.kx.com/q/basics/syntax/#names-and-namespaces

Namespace can't have dot in names as dot is a separator and system functions \a, \f, \v (https://code.kx.com/q/basics/syscmds/#f-functions) don't work herecan be used to analyze the namespace name .db.Ax.290.130974 is treated as 4 separate inner namespaces: db Ax 290 130974

In result, even formally, that's fine from Q point of data types but as some system functions don't work - the Inspector fails to show anything here.

This won't be fixed on my side. Once you use dictionary type for .db.Ax rather than namespace type for this variable the Inspector will work with no issues.

I even can't imagine how you create such namespace structure because when you do something like but maybe it's better to revise your code here as it potentially can lead to more critical issues.

smklimenko commented 2 months ago

ok, probably I know how to fix that. Not very correct but anyway, should work somehow

smklimenko commented 2 months ago

Fixed in 5.8.2 once available in JetBrains Marketplace.

Any namespace with a dot in the name is ignored and treated as a dictionary that means it won't be expanded in the Inspector but visible and executable.

In auto-completion such value is also wrapped with symbol, like: .a.b[`c.d] rather than .a.b.c.d that is not correct and doesn't work.

freeclb commented 2 months ago

Thanks!