diff options
Diffstat (limited to 'editors/code/src/ctx.ts')
-rw-r--r-- | editors/code/src/ctx.ts | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/editors/code/src/ctx.ts b/editors/code/src/ctx.ts index 70042a479..ff6245f78 100644 --- a/editors/code/src/ctx.ts +++ b/editors/code/src/ctx.ts | |||
@@ -60,6 +60,10 @@ export class Ctx { | |||
60 | this.pushCleanup(d); | 60 | this.pushCleanup(d); |
61 | } | 61 | } |
62 | 62 | ||
63 | get globalState(): vscode.Memento { | ||
64 | return this.extCtx.globalState; | ||
65 | } | ||
66 | |||
63 | get subscriptions(): Disposable[] { | 67 | get subscriptions(): Disposable[] { |
64 | return this.extCtx.subscriptions; | 68 | return this.extCtx.subscriptions; |
65 | } | 69 | } |
@@ -87,15 +91,11 @@ export async function sendRequestWithRetry<R>( | |||
87 | for (const delay of [2, 4, 6, 8, 10, null]) { | 91 | for (const delay of [2, 4, 6, 8, 10, null]) { |
88 | try { | 92 | try { |
89 | return await (token ? client.sendRequest(method, param, token) : client.sendRequest(method, param)); | 93 | return await (token ? client.sendRequest(method, param, token) : client.sendRequest(method, param)); |
90 | } catch (e) { | 94 | } catch (err) { |
91 | if ( | 95 | if (delay === null || err.code !== lc.ErrorCodes.ContentModified) { |
92 | e.code === lc.ErrorCodes.ContentModified && | 96 | throw err; |
93 | delay !== null | ||
94 | ) { | ||
95 | await sleep(10 * (1 << delay)); | ||
96 | continue; | ||
97 | } | 97 | } |
98 | throw e; | 98 | await sleep(10 * (1 << delay)); |
99 | } | 99 | } |
100 | } | 100 | } |
101 | throw 'unreachable'; | 101 | throw 'unreachable'; |