File tree 2 files changed +6
-18
lines changed
src/PowerShellEditorServices/Services
2 files changed +6
-18
lines changed Original file line number Diff line number Diff line change @@ -867,19 +867,11 @@ private void PublishScriptDiagnostics(
867
867
fileLock . Release ( ) ;
868
868
}
869
869
870
-
871
- var uriBuilder = new UriBuilder
872
- {
873
- Scheme = Uri . UriSchemeFile ,
874
- Path = scriptFile . FilePath ,
875
- Host = string . Empty ,
876
- } ;
877
-
878
870
// Always send syntax and semantic errors. We want to
879
871
// make sure no out-of-date markers are being displayed.
880
872
_languageServer . Document . PublishDiagnostics ( new PublishDiagnosticsParams ( )
881
873
{
882
- Uri = uriBuilder . Uri ,
874
+ Uri = new Uri ( scriptFile . DocumentUri ) ,
883
875
Diagnostics = new Container < Diagnostic > ( diagnostics ) ,
884
876
} ) ;
885
877
}
Original file line number Diff line number Diff line change @@ -20,15 +20,11 @@ public class ScriptDocumentSymbolProvider : IDocumentSymbolProvider
20
20
IEnumerable < SymbolReference > IDocumentSymbolProvider . ProvideDocumentSymbols (
21
21
ScriptFile scriptFile )
22
22
{
23
- if ( scriptFile != null &&
24
- scriptFile . FilePath != null &&
25
- ( scriptFile . FilePath . EndsWith ( ".ps1" , StringComparison . OrdinalIgnoreCase ) ||
26
- scriptFile . FilePath . EndsWith ( ".psm1" , StringComparison . OrdinalIgnoreCase ) ) )
27
- {
28
- return FindSymbolsInDocument ( scriptFile . ScriptAst ) ;
29
- }
30
-
31
- return Enumerable . Empty < SymbolReference > ( ) ;
23
+ // If we have an AST, then we know it's a PowerShell file
24
+ // so lets try to find symbols in the document.
25
+ return scriptFile ? . ScriptAst != null
26
+ ? FindSymbolsInDocument ( scriptFile . ScriptAst )
27
+ : Enumerable . Empty < SymbolReference > ( ) ;
32
28
}
33
29
34
30
/// <summary>
You can’t perform that action at this time.
0 commit comments