LanguageServer.jl icon indicating copy to clipboard operation
LanguageServer.jl copied to clipboard

Missing Reference using DrWatson

Open arnold-c opened this issue 2 years ago • 0 comments

I use DrWatson to manage most of my projects. I've noticed that the language server does not recognize DrWatson functions, and therefore I cannot use the helper functions for relative paths etc, meaning features like "go to definition" do not work.

The basic structure is that there are multiple directories, and functions are typically placed in the src/ directory, with scripts in the scripts/ directory.

In the below example, there is a file src/my-functions.jl that contains foo() = println("bar")

# Activate project "Test" using DrWatson
using DrWatson 
quickactivate("Test")

include("../src/my-functions.jl")

foo()

julia> bar

This does not work

# Activate project "Test" using DrWatson
using DrWatson
quickactivate("Test")

include(srcdir("my-functions.jl"))            # Missing reference: srcdir

foo()

julia> bar

In this example, it's not too hard to just use relative paths, but there are certainly times when this would be unwieldy. I get the same issue when using both NeoVim and VSCode.

I have no idea how LSPs work (in general, or in this case), but if you think it's a somewhat simple fix and could point me in the right direction I'm happy to have a go!

Thanks.

arnold-c avatar Sep 04 '23 23:09 arnold-c