For which packages does VSCode autocomplete work?

My current workaround (when needing test-dependencies intellisense besides MyPackage.jl):

  • create a new MyPackageTest.jl project (at the same dir level as MyPackage.jl)
  • name the .jl files exactly as I would if I were writing the tests inside the test directory within MyPackage.jl
  • the entry point for MyPackageTest.jl only includes runtests.jl + force copy functionality (acting as a one-way mirror and replacing the test files inside MyPackage/test)

The only inconvenience is that I now need two VSCode instances - but no more issues with autocompletion (at least, this is the only way I can write tests with autocompletion for both the package I working on and the test dependencies).

I am thinking of making it a template that can be hydrated with any package.

I am not saying this in bad faith - but I feel that we shouldnā€™t need to try crazy workarounds to have decent tooling. But at the same time, I know that this is OSS - so my feelings are just that - feelings - I cannot really demand things.

Partially a joke: @gdalle, youā€™ll have to remove modern in front of the workflow when presenting the test side of things in your blog entry. :slight_smile:

2 Likes

Well, but we - as an OS community - can try to organize the development of high quality tooling if we need it. If 10000 Julia users pay 10 EUR each we could pay a full-time developer for a yearā€¦
OK, perhaps not so realistic, but with a mix of public, commercial and community funding it should be possible to pay someone to fix the vscode Julia issuesā€¦

I want to repeat my suggestion to have a Zoom call to do some brainstorming how this could be doneā€¦

3 Likes

I would pay.

2 Likes

A funny (and maybe inspiring) story from the F# community.

  • They created Fable - that transpiles F# to JavaScript (and these days to Rust, Python and more).
  • They used F# to develop the VS Code plugin for F# development (ionide) and compiled it to JavaScript.
  • The quality of the extension is just amazing.

/start :dream

The takeaway: letā€™s create JS.jl so lots of Julia developers can work on the tooling - and as a side effect, get Julia competitive in the web development area (not only as a backend language) and get an additional incentive for people to come to Julia.

Technically this should work.

/end :dream

8 Likes

:man_shrugging:

I am developing a package Foo. I am also developing a package Bar.

Iā€™m writing a script and have include Foo and include Bar at the top of my script, but autocomplete does not work for either.

What should I do here to get autcomplete working again? Why is it broken?

1 Like

Do you mean using Foo and using Bar? In which environment are you working?

Iā€™m using my default Pkg environment (called ā€œ1.9ā€), in which Foo and Bar are both devved.

Youā€™re right I meant to say using

Iā€™m finding it really hard to find any useful documentation or even code to help figure out the problem. Iā€™m not averse to trying to solve this myself, but I really donā€™t know where to begin, so thank you for engaging!

Dev-ing the packages is a slight tweak of my initial question, perhaps this thread is more relevant:

What does ā€œtop of my fileā€ mean: ā€œtop levelā€ or ā€œat the beginning of the fileā€?

no clue, somewhere in the file I guess

I believe the conditions are as follows.

  1. The package must be in the environment.
  2. VS Code must be configured to be using that environment.
  3. The file you are working with must either be
    A. A script that uses or imports the package in question.
    B. Included by the top level module named after the environment.
2 Likes