Skip to content

Commit e8689ee

Browse files
committed
f why u no work?
1 parent 46fe7d4 commit e8689ee

File tree

3 files changed

+77
-1
lines changed

3 files changed

+77
-1
lines changed

src/PowerShellEditorServices.Protocol/LanguageServer/Configuration.cs

+50
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,54 @@ public class DidChangeConfigurationParams<TConfig>
1818
{
1919
public TConfig Settings { get; set; }
2020
}
21+
22+
/// <summary>
23+
/// Class to encapsulate the request type. This is a Server -> Client request
24+
/// https://microsoft.github.io/language-server-protocol/specification#workspace_configuration
25+
/// </summary>
26+
class WorkspaceConfigurationRequest
27+
{
28+
//RequestType<TParams, TResult, TError, TRegistrationOptions> : AbstractMessageType
29+
public static readonly
30+
RequestType<WorkspaceConfigurationParams, object, object, object> Type =
31+
RequestType<WorkspaceConfigurationParams, object, object, object>.Create("workspace/configuration");
32+
}
33+
34+
public class WorkspaceConfigurationParams
35+
{
36+
public WorkspaceConfigurationParamItem[] items { get; set; }
37+
}
38+
39+
public class WorkspaceConfigurationParamItem
40+
{
41+
public string scopeUri { get; set; }
42+
public string section { get; set; }
43+
}
44+
45+
// public class RunspaceChangedEvent
46+
// {
47+
// public static readonly
48+
// NotificationType<RunspaceDetails, object> Type =
49+
// NotificationType<RunspaceDetails, object>.Create("powerShell/runspaceChanged");
50+
// }
51+
52+
// public class RunspaceDetails
53+
// {
54+
// public PowerShellVersion PowerShellVersion { get; set; }
55+
56+
// public RunspaceLocation RunspaceType { get; set; }
57+
58+
// public string ConnectionString { get; set; }
59+
60+
// public RunspaceDetails()
61+
// {
62+
// }
63+
64+
// public RunspaceDetails(Session.RunspaceDetails eventArgs)
65+
// {
66+
// this.PowerShellVersion = new PowerShellVersion(eventArgs.PowerShellVersion);
67+
// this.RunspaceType = eventArgs.Location;
68+
// this.ConnectionString = eventArgs.ConnectionString;
69+
// }
70+
// }
2171
}

src/PowerShellEditorServices.Protocol/Server/LanguageServer.cs

+19
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,25 @@ protected async Task HandleDidChangeConfigurationNotificationAsync(
665665
DidChangeConfigurationParams<LanguageServerSettingsWrapper> configChangeParams,
666666
EventContext eventContext)
667667
{
668+
669+
//SendRequestAsync<TParams, TResult, TError, TRegistrationOptions>(RequestType<TParams, TResult, TError, TRegistrationOptions> requestType, TParams requestParams, bool waitForResponse)
670+
// return this.SendRequestAsync(
671+
// InitializeRequest.Type,
672+
// initializeParams,
673+
// true);
674+
675+
// Trigger a workspace level configuration retrieval
676+
this.messageSender.SendRequestAsync(
677+
WorkspaceConfigurationRequest.Type,
678+
new WorkspaceConfigurationParams {
679+
items = new WorkspaceConfigurationParamItem[] {
680+
new WorkspaceConfigurationParamItem() { section = "files.exclude" },
681+
new WorkspaceConfigurationParamItem() { section = "search.exclude" }
682+
}
683+
},
684+
false
685+
);
686+
668687
bool oldLoadProfiles = this.currentSettings.EnableProfileLoading;
669688
bool oldScriptAnalysisEnabled =
670689
this.currentSettings.ScriptAnalysis.Enable.HasValue ? this.currentSettings.ScriptAnalysis.Enable.Value : false;

src/PowerShellEditorServices/Workspace/Workspace.cs

+8-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ public class Workspace
5353
/// Gets or sets the root path of the workspace.
5454
/// </summary>
5555
public string WorkspacePath { get; set; }
56+
/// <summary>
57+
/// TODO
58+
/// </summary>
59+
public List<string> ExcludedFileGlobs { get; set; }
5660

5761
#endregion
5862

@@ -67,6 +71,7 @@ public Workspace(Version powerShellVersion, ILogger logger)
6771
{
6872
this.powerShellVersion = powerShellVersion;
6973
this.logger = logger;
74+
this.ExcludedFileGlobs = new List<string>();
7075
}
7176

7277
#endregion
@@ -245,6 +250,8 @@ public void CloseFile(ScriptFile scriptFile)
245250
/// <param name="scriptFile">Contains the details and contents of an open script file</param>
246251
/// <returns>A scriptfile array where the first file
247252
/// in the array is the "root file" of the search</returns>
253+
254+
// TODO: This should probably honor the files.exclude
248255
public ScriptFile[] ExpandScriptReferences(ScriptFile scriptFile)
249256
{
250257
Dictionary<string, ScriptFile> referencedScriptFiles = new Dictionary<string, ScriptFile>();
@@ -337,7 +344,7 @@ public IEnumerable<string> EnumeratePSFiles(
337344
WorkspacePath,
338345
maxDepth,
339346
this.IsDotNetFrameWork() ? s_psFileExtensionsDotNetFramework : s_psFileExtensions,
340-
ignoreReparsePoints,
347+
true,
341348
this.logger
342349
);
343350
var result = matcher.Execute(fsFactory.RootDirectory);

0 commit comments

Comments
 (0)