Autocomplete DataFrame columns not working in VS Code

Hi there, first I want to thank all people involved in the Julia extension for VS Code, you made a wonderful job.

Now I have a little issue that is annoying when doing data science: the column names of a DataFrame are not autocompleted. In Juno and in the REPL, if I have a DataFrame such as:

using DataFrames
df = DataFrame(A = 1:10, B = rand(10), C = rand(10))

I would expect to get a proposition of the column names for auto-completion if I type df.. But I don’t get any in the VS Code extension.
I don’t know if it is a bug happening just for me or if it is simply not implemented yet. I didn’t find any information on the subject so far (I tried the DataFrames doc, the VS Code extension doc and issues).

I tried to uninstall / re-install the extension but it didn’t work any better.

Can someone help me figuring that out ?

2 Likes

We’re generating completions all using static information from LS while REPL or Juno use dynamic information from running session.
What you want is actua kinda hard for LS to implement, because dataframe’s column is basically only available at runtime.

I made a PR that integrates VSCode’s completion with REPL (https://github.com/julia-vscode/julia-vscode/pull/1507) but we’re not settled down with how to use those dynamic information yet.

1 Like

OK thank you for the information, at least it’s not a bug :slight_smile: !
I’m glad there is some work ongoing to implement this, it’s very useful when doing data exploration.

1 Like

Thanks for doing this.

I have to second rvezy on this, df. auto-completion is pretty necessary when you have dozens of columns.

1 Like

Hi everyone,

This is my first time posting here, then I hope I made it well.

I have problems with the autocompletion on VScode for different things.

  1. Object structure:
x = (a = 3, b = 5)
x.

on vscode produced:
image

No autocompletion.

on Juno:
It shows suggestions, but I cannot post more than one screenshot.

The same happen with names of columns when you read a CSV, and paths.

VSCode Version: Version: 1.68.1
Commit: 30d9c6cd9483b2cc586687151bcbcd635f373630
Date: 2022-06-15T02:58:26.441Z
Electron: 17.4.7
Chromium: 98.0.4758.141
Node.js: 16.13.0
V8: 9.8.177.13-electron.0
OS: Linux x64 5.13.0-51-generic

Julia language support for VSCode: v1.6.24

Julia env: v1.7

Juno version: 0.12.6
Atom version: 1.60.0

Thanks in advance for your help.

Try with julia.runtimeCompletions enabled.

1 Like

Thanks, it works!

But for paths it doesn’t

on vscode: