Skip to content

Commit a54344c

Browse files
committed
d TODOS
1 parent 5153848 commit a54344c

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

src/PowerShellEditorServices.Protocol/Server/LanguageServer.cs

+9
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,9 @@ await this.RunScriptDiagnosticsAsync(
757757
}
758758
}
759759

760+
// NEED TO CHECK FILE GLOBBING HERE!!
761+
// This is the handler for textDocument/definition - https://microsoft.github.io/language-server-protocol/specification#textDocument_definition
762+
// It searches the workspace for a function reference, which is then used as the definition
760763
protected async Task HandleDefinitionRequestAsync(
761764
TextDocumentPositionParams textDocumentPosition,
762765
RequestContext<Location[]> requestContext)
@@ -780,6 +783,7 @@ protected async Task HandleDefinitionRequestAsync(
780783
await editorSession.LanguageService.GetDefinitionOfSymbolAsync(
781784
scriptFile,
782785
foundSymbol,
786+
// Probably something here...
783787
editorSession.Workspace);
784788

785789
if (definition != null)
@@ -796,6 +800,9 @@ await editorSession.LanguageService.GetDefinitionOfSymbolAsync(
796800
await requestContext.SendResultAsync(definitionLocations.ToArray());
797801
}
798802

803+
// NEED TO CHECK FILE GLOBBING HERE!!
804+
// This is the handler for textDocument/References - https://microsoft.github.io/language-server-protocol/specification#textDocument_references
805+
// It searches the workspace for a function reference
799806
protected async Task HandleReferencesRequestAsync(
800807
ReferencesParams referencesParams,
801808
RequestContext<Location[]> requestContext)
@@ -813,7 +820,9 @@ protected async Task HandleReferencesRequestAsync(
813820
FindReferencesResult referencesResult =
814821
await editorSession.LanguageService.FindReferencesOfSymbolAsync(
815822
foundSymbol,
823+
// Probably something here...
816824
editorSession.Workspace.ExpandScriptReferences(scriptFile),
825+
// Probably something here...
817826
editorSession.Workspace);
818827

819828
Location[] referenceLocations = s_emptyLocationResult;

src/PowerShellEditorServices/Language/LanguageService.cs

+2
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ public async Task<FindReferencesResult> FindReferencesOfSymbolAsync(
337337
fileMap[scriptFile.FilePath] = scriptFile;
338338
}
339339

340+
// Probably something here...
340341
foreach (string filePath in workspace.EnumeratePSFiles())
341342
{
342343
if (!fileMap.Contains(filePath))
@@ -451,6 +452,7 @@ public async Task<GetDefinitionResult> GetDefinitionOfSymbolAsync(
451452
if (foundDefinition == null)
452453
{
453454
// Get a list of all powershell files in the workspace path
455+
// Probably something here...
454456
IEnumerable<string> allFiles = workspace.EnumeratePSFiles();
455457
foreach (string file in allFiles)
456458
{

src/PowerShellEditorServices/Workspace/Workspace.cs

+1
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ public void CloseFile(ScriptFile scriptFile)
265265
/// in the array is the "root file" of the search</returns>
266266
public ScriptFile[] ExpandScriptReferences(ScriptFile scriptFile)
267267
{
268+
// TODO: This should probably honor the files.exclude
268269
Dictionary<string, ScriptFile> referencedScriptFiles = new Dictionary<string, ScriptFile>();
269270
List<ScriptFile> expandedReferences = new List<ScriptFile>();
270271

0 commit comments

Comments
 (0)