julia-vscode / julia-vscode

Julia extension for Visual Studio Code
https://www.julia-vscode.org/
Other
1.28k stars 201 forks source link

Tables.jl support plans? #3068

Open aplavin opened 2 years ago

aplavin commented 2 years ago

I noticed that the extension can display some objects in the tabular view, but for now the set of supported types seems very limited compared to Tables.jl. Is full support for Tables planned, or Tables are out of scope here?

A couple of Tables that cannot be displayed at all:

tbl = (a=[1], b=[2])
struct S
    a
    b
end

tbl = [S(1, 2)]

An example Table that is displayed as a regular array, different from its Tables interpretation:

using AxisKeys

tbl = KeyedArray([1, 2], x=[3, 4])
pfitzseb commented 1 year ago

I'd like to support all Tables-compatible tables, yes. IIRC that was tricky to do without dependency issues, but I can't quite recall all the details.

aplavin commented 1 year ago

A potentially simple solution would be to always show the "table" icon in variable explorer, and use columntable or rowtable to actually load data when users click there.

oxinabox commented 1 month ago

The docs currently say:

All Tables.jl-compatible tables (and more!) can be displayed in the integrated table viewer.

but right now the example from the top errors.

julia> vscodedisplay((;a=[1,2], b=[10,20]))
┌ Warning: Cannot display values of type @NamedTuple{a::Vector{Int64}, b::Vector{Int64}} in VS Code.
└ @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.98.1/scripts/packages/VSCodeServer/src/display.jl:225