From d8e5c55416e06509674890406e17ea1034e43928 Mon Sep 17 00:00:00 2001 From: filipw Date: Fri, 4 Dec 2020 14:58:35 +0100 Subject: [PATCH] raise default GotoDefinitionRequest timeout from 2s to 10s --- .../Models/v1/GotoDefinition/GotoDefinitionRequest.cs | 2 +- .../Services/ExternalSourceServiceFactory.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/OmniSharp.Abstractions/Models/v1/GotoDefinition/GotoDefinitionRequest.cs b/src/OmniSharp.Abstractions/Models/v1/GotoDefinition/GotoDefinitionRequest.cs index ef3d70070d..e423e762a2 100644 --- a/src/OmniSharp.Abstractions/Models/v1/GotoDefinition/GotoDefinitionRequest.cs +++ b/src/OmniSharp.Abstractions/Models/v1/GotoDefinition/GotoDefinitionRequest.cs @@ -5,7 +5,7 @@ namespace OmniSharp.Models.GotoDefinition [OmniSharpEndpoint(OmniSharpEndpoints.GotoDefinition, typeof(GotoDefinitionRequest), typeof(GotoDefinitionResponse))] public class GotoDefinitionRequest : Request { - public int Timeout { get; set; } = 2000; + public int Timeout { get; set; } = 10000; public bool WantMetadata { get; set; } } } diff --git a/src/OmniSharp.Roslyn.CSharp/Services/ExternalSourceServiceFactory.cs b/src/OmniSharp.Roslyn.CSharp/Services/ExternalSourceServiceFactory.cs index 2b73512020..933eecb851 100644 --- a/src/OmniSharp.Roslyn.CSharp/Services/ExternalSourceServiceFactory.cs +++ b/src/OmniSharp.Roslyn.CSharp/Services/ExternalSourceServiceFactory.cs @@ -32,7 +32,7 @@ public IExternalSourceService Create(OmniSharpOptions omniSharpOptions) public CancellationToken CreateCancellationToken(OmniSharpOptions omniSharpOptions, int timeout) { var enableDecompilationSupport = omniSharpOptions.RoslynExtensionsOptions.EnableDecompilationSupport; - // since decompilation is slower, use a larger cancellation time (default is 2s per request) + // since decompilation is slower, use a larger cancellation time var cancellationTimeout = enableDecompilationSupport ? timeout <= 10000 ? 10000 : timeout // minimum 10s for decompilation : timeout; // request defined for metadata