-
Notifications
You must be signed in to change notification settings - Fork 105
/
Copy pathILanguageServerConfiguration.cs
58 lines (52 loc) · 2.38 KB
/
ILanguageServerConfiguration.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using OmniSharp.Extensions.LanguageServer.Protocol.Models;
namespace OmniSharp.Extensions.LanguageServer.Protocol.Server
{
public interface ILanguageServerConfiguration : IConfiguration
{
/// <summary>
/// Adds a set of configuration items to be tracked by the server
/// </summary>
/// <param name="configurationItems"></param>
/// <returns></returns>
ILanguageServerConfiguration AddConfigurationItems(IEnumerable<ConfigurationItem> configurationItems);
/// <summary>
/// Stops tracking a given set of configuration items
/// </summary>
/// <param name="configurationItems"></param>
/// <returns></returns>
ILanguageServerConfiguration RemoveConfigurationItems(IEnumerable<ConfigurationItem> configurationItems);
/// <summary>
/// Gets the current configuration values from the client
/// This configuration object is stateless such that it won't change with any other configuration changes
/// </summary>
/// <param name="items"></param>
/// <returns></returns>
Task<IConfiguration> GetConfiguration(params ConfigurationItem[] items);
/// <summary>
/// Gets the current configuration for a given document uri
/// This re-uses all the sections from the <see cref="ConfigurationItem" />s that
/// the root configuration uses.
///
/// This will watch for changes of the scoped documents and update the configuration.
/// </summary>
/// <param name="scopeUri"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<IScopedConfiguration> GetScopedConfiguration(DocumentUri scopeUri, CancellationToken cancellationToken);
/// <summary>
/// Attempt to get an existing scoped configuration so that it can be disposed
/// </summary>
/// <param name="scopeUri"></param>
/// <param name="configuration"></param>
/// <returns></returns>
bool TryGetScopedConfiguration(DocumentUri scopeUri, out IScopedConfiguration configuration);
/// <summary>
/// Is configuration supported by the client
/// </summary>
bool IsSupported { get; }
}
}