Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/docs-resolver.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ module.exports = DocsResolver =
assertModulePageAvailability: (path, callback) -> @assertPageAvailability(path, "$1/index.html", callback)

assertPageAvailability: (path, resourceEndFormat, callback) ->
c = atom.config.get('rust-api-docs-helper.rustReleaseChannel')
p = path.replace(/(\w*?)$/, resourceEndFormat)
req = new XMLHttpRequest()
req.onloadend = @onLoadEnd(path, @cache, callback)
req.open("HEAD","http://doc.rust-lang.org/#{p}")
req.open("HEAD","http://doc.rust-lang.org/#{c}/#{p}")
req.send()

onLoadEnd: (path, cache, callback) -> (e) ->
Expand Down
7 changes: 7 additions & 0 deletions lib/rust-api-docs-helper.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ module.exports = RustApiDocsHelper =
There is a bug at the moment that causes errors with this function.
"""
default: true
rustReleaseChannel:
type:'string'
description: """
Identifies which release channel to use when providing documentation.
"""
default: 'stable'
enum: ['stable', 'beta', 'nightly']

subscriptions: null

Expand Down