Skip to content

Commit 980c488

Browse files
committed
d TODOS
1 parent 85ebaad commit 980c488

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

src/PowerShellEditorServices.Protocol/Server/LanguageServer.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,9 @@ await this.RunScriptDiagnosticsAsync(
728728
}
729729
}
730730

731+
// NEED TO CHECK FILE GLOBBING HERE!!
732+
// This is the handler for textDocument/definition - https://microsoft.github.io/language-server-protocol/specification#textDocument_definition
733+
// It searches the workspace for a function reference, which is then used as the definition
731734
protected async Task HandleDefinitionRequestAsync(
732735
TextDocumentPositionParams textDocumentPosition,
733736
RequestContext<Location[]> requestContext)
@@ -751,6 +754,7 @@ protected async Task HandleDefinitionRequestAsync(
751754
await editorSession.LanguageService.GetDefinitionOfSymbolAsync(
752755
scriptFile,
753756
foundSymbol,
757+
// Probably something here...
754758
editorSession.Workspace);
755759

756760
if (definition != null)
@@ -767,6 +771,9 @@ await editorSession.LanguageService.GetDefinitionOfSymbolAsync(
767771
await requestContext.SendResultAsync(definitionLocations.ToArray());
768772
}
769773

774+
// NEED TO CHECK FILE GLOBBING HERE!!
775+
// This is the handler for textDocument/References - https://microsoft.github.io/language-server-protocol/specification#textDocument_references
776+
// It searches the workspace for a function reference
770777
protected async Task HandleReferencesRequestAsync(
771778
ReferencesParams referencesParams,
772779
RequestContext<Location[]> requestContext)
@@ -784,7 +791,9 @@ protected async Task HandleReferencesRequestAsync(
784791
FindReferencesResult referencesResult =
785792
await editorSession.LanguageService.FindReferencesOfSymbolAsync(
786793
foundSymbol,
794+
// Probably something here...
787795
editorSession.Workspace.ExpandScriptReferences(scriptFile),
796+
// Probably something here...
788797
editorSession.Workspace);
789798

790799
Location[] referenceLocations = s_emptyLocationResult;

src/PowerShellEditorServices/Language/LanguageService.cs

Lines changed: 2 additions & 0 deletions
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

Lines changed: 1 addition & 0 deletions
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)