Sourcegraph extensions have been deprecated with the September 2022 Sourcegraph release. Learn more.
The repo and the docs below are kept to support older Sourcegraph versions.
Adds a button to the Sourcegraph's extension panel and at the top of files in code hosts like GitHub (when the Sourcegraph browser extension is installed) that will open the current file in Sublime Text.
This extension requires all git repos to be cloned and available on your local machine.
-
openInAtom.basePath
: [REQUIRED] String. The absolute path on your computer where your git repositories live. The extension will try to open the file in a clone named by the last segment of the repository name in that folder. This extension requires all git repos to be already cloned under this path with their original names, which the final path can later be altered using theopenInAtom.replacements
option.- Note:
"/Users/yourusername/src"
is a valid absolute path, while"~/src"
is not.
- Note:
-
openInAtom.replacements
: [OPTIONAL] Object. Set to an object that includes pairs of strings, where each key will be replaced by its value in the final url. The key can be a string or a RegExp, and the value must be a string.- Example: using
"openInAtom.replacements": {"(?<=Documents\/)(.*[\\\/])": "sourcegraph-$1"}
will addsourcegraph-
in front of the string that matches the(?<=Documents\/)(.*[\\\/])
RegExp pattern, while"openInAtom.replacements": {"sourcegraph-": ""}
will removesourcegraph-
from the final URL.
- Example: using
-
openInAtom.osPaths
: [OPTIONAL] Object. The extension uses the assigned path for the detected Operating System when available. If no platform is detected then we will keep using the basePath provided byopenInAtom.basePath
.- Note: Currently support
"windows"
,"mac"
, and"linux"
as keys.
- Note: Currently support
To open repository files in your Documents directory:
{
"extensions": {
"sourcegraph/open-in-atom": true,
},
// where the cloned git repositories are located
"openInAtom.basePath": "/Users/USERNAME/Documents/"
}
{
"extensions": {
"sourcegraph/open-in-atom": true
},
"openInAtom.osPaths": {
"windows": "/C:/Users/USERNAME/folder/",
"mac": "/Users/USERNAME/folder/",
"linux": "/home/USERNAME/folder/"
},
// required -set basePath as fallback path when no operating system is detected
"openInAtom.basePath": "/Users/USERNAME/Documents/",
}
If you're using Atom on Linux, you should have the URI handling configured accordingly on your machine.
- Run
yarn && yarn run serve
and keep the Parcel bundler process running - Sideload the extension (at the URL http://localhost:1234 by default) on your Sourcegraph instance or Sourcegraph.com
When you edit a source file in your editor, Parcel will recompile the extension. Reload the Sourcegraph web page to use the updated extension.