Matthew Davis
Matthew Davis

Reputation: 116

Why can't the SVN plugin in Visual Studio Code find my svn.path?

I definitely have a working copy of svn on my Mac (I regularly update SVN code from Sublime), but the SVN plugin on Visual Studio Code can't seem to find it.

It was suggested I could find the path by typing this into console echo $PATH but what I get back is this: /opt/subversion/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

Here's the notification in VS Code:

enter image description here

Upvotes: 3

Views: 15367

Answers (1)

Gino Mempin
Gino Mempin

Reputation: 29660

It looks like your error is coming from this SVN extension:
https://marketplace.visualstudio.com/items?itemName=johnstoncode.svn-scm

That extension has a default setting of

  // Path to the svn executable
  "svn.path": null,

You will have to manually and explicitly tell it the path to your svn installation.
It (and VS Code) will not automatically find it for you.

First, get the path to your svn installation:

$ which svn
/usr/local/bin/svn

$ svn --version
svn, version 1.14.1 (r1886195)
...

(The paths of course may differ on your machine.)

Then, add that path to your user or workspace settings:

settings UI

In settings.json:

"svn.path": "/usr/local/bin/svn"  

(Use the path on your machine)

Finally, reload VS Code and check the Output > SVN tab for logs that say the extension has successfully found it:

output tab with successful svn

The extension has a lot of other settings: https://github.com/JohnstonCode/svn-scm#settings.
Check and manually configure them yourself, if necessary.

Upvotes: 5

Related Questions