mirror of
https://github.com/huhu/rust-search-extension
synced 2024-11-14 23:57:07 +00:00
Error code search support offline mode
This commit is contained in:
parent
e8d61e46da
commit
38aac8f289
1 changed files with 3 additions and 2 deletions
|
@ -339,10 +339,11 @@ function getPlatformOs() {
|
|||
let errorIndex = 'E' + String(baseIndex++).padStart(4, "0").toUpperCase();
|
||||
result.push(errorIndex);
|
||||
}
|
||||
let baseUrl = settings.isOfflineMode ? settings.offlineDocPath : 'https://doc.rust-lang.org/';
|
||||
return result.map(errorCode => {
|
||||
return {
|
||||
content: "https://doc.rust-lang.org/error-index.html#" + errorCode,
|
||||
description: `Search Rust error index for ${c.match(errorCode)} on https://doc.rust-lang.org/error-index.html`,
|
||||
content: `${baseUrl}error-index.html#${errorCode}`,
|
||||
description: `Search Rust error index for ${c.match(errorCode)} on ${settings.isOfflineMode ? 'offline mode' : 'https://doc.rust-lang.org/error-index.html'}`,
|
||||
};
|
||||
});
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue