Skip to content

Conversation

@fredrikekre
Copy link
Member

This makes it possible to use direnv with the VSCode extension by setting Julia: Executable Path to the following script:

!#/bin/bash
export DIRENV_BASH=/bin/bash
exec /bin/direnv exec "${JULIA_VSCODE_WORKSPACE}" julia "$@"

@fredrikekre fredrikekre changed the title RFC: Pass workspace folder to julia exe. Pass workspace folder to julia exe. Oct 18, 2020
@pfitzseb
Copy link
Member

This needs to check whether workspaceFolders is defined, as per the docs:

workspaceFolders: ReadonlyArray<WorkspaceFolder> | undefined

List of workspace folders or undefined when no folder is open. Note that the first entry corresponds to the value of rootPath.

I'm also not sure if I like anyone messing with how we start the LS, but there's probably not much we can do about it :) This is also unlikely to be used by anyone who doesn't know what's going on, so whatever.

@fredrikekre
Copy link
Member Author

Thanks, I will fix that. Can it happen that the language server/Julia REPL can be started if it is undefined? Perhaps if you open a single file?

I'm also not sure if I like anyone messing with how we start the LS, but there's probably not much we can do about it :)

I don't need this for the LS startup, but currently there is only a single option for specifying the Julia binary so I don't have much choice.

@pfitzseb
Copy link
Member

What do you think about setting a IS_JULIA_LANGUAGESERVER env variable instead? Then your startup script can use pwd for user processes and just pass through for the LS?

@fredrikekre
Copy link
Member Author

Fine with me if you think the system can handle possible different binaries running the user process and the language server.

@fredrikekre fredrikekre changed the title Pass workspace folder to julia exe. Set JULIA_VSCODE_LANGUAGESERVER=1 for language server processes. Oct 28, 2020
@fredrikekre
Copy link
Member Author

Updated the PR

@pfitzseb pfitzseb merged commit 3e80037 into julia-vscode:master Oct 28, 2020
@fredrikekre fredrikekre deleted the fe/workspace-folder branch October 28, 2020 10:24
@fredrikekre fredrikekre changed the title Set JULIA_VSCODE_LANGUAGESERVER=1 for language server processes. Set JULIA_LANGUAGESERVER=1 for language server processes. Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants