Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Ignore root and dot in search paths #962

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/LanguageServer/Impl/Implementation/Server.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ public async Task<InitializeResult> InitializeAsync(InitializeParams @params, Ca
) {
// TODO: Remove this split once the extension is updated and no longer passes the interpreter search paths directly.
// This is generally harmless to keep around.
SearchPaths = @params.initializationOptions.searchPaths.Select(p => p.Split(';', StringSplitOptions.RemoveEmptyEntries)).SelectMany().ToList(),
SearchPaths = @params.initializationOptions.searchPaths
.Select(p => p.Split(';', StringSplitOptions.RemoveEmptyEntries)).SelectMany()
.Where(p => p != "/" && p != ".")
.ToList(),
TypeshedPath = @params.initializationOptions.typeStubSearchPaths.FirstOrDefault()
};

Expand Down