You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(GH-879) Add filtering for CodeLens and References (#877)
* (GH-879) Add characterisation tests for Workspace.EnumeratePSFiles
Previosly there were no tests for the Workspace.EnumeratePSFiles method. This
commit adds tests for EnumeratePSFiles method using a set of static fixture
test files.
Note that the behaviour of EnumeratePSFiles changes depending on the .Net
Framework edition
* (GH-879) Use globbing when enumerating workspace files
Previously the Workspace.EnumeratePSFiles method could only filter files
based on file extension (*.ps1, *.psm1, *.psd1). However editor settings tend
to use file glob patterns, but Editor Services did not have a library that could
parse them.
This commit:
* Updates Editor Services to use the Microsoft.Extensions.FileSystemGlobbing
library
* Updated the build process to include the new FileSystemGlobbing DLL
* The FileSystemGlobbing library uses an abstract file system to search, not
an actual System.IO.FileSystem object. So to implement the same error handling
and maximum depth recursion, a WorkspaceFileSystemWrapperFactory is used to
create the Directory and File objects needed for the globbing library
The WorkspaceFileSystemWrapperFactory can filter on:
- Maximum recursion depth
- Reparse points (Note that these aren't strictly Symlinks on windows. There
are many other types of filesystem items which are reparse points
- File system extension
- Gracefully ignores any file access errors
* The EnumeratePSFiles has two method signatures. One with no arguments which
uses the Workspace object's default values and another where all arguments
must be specified when enumerating the files
* Adds tests for the EnumeratePSFiles method to ensure that it filters on glob
and recursion depth.
* (GH-879) Capture the editor settings and enforce file exclusions
Previously the EnumeratePSFiles method was modified to be able to use globbing
patterns to filter workspace files. This commit
* Modifies the LanguageServerSettings class to capture the 'files' and 'search'
Settings in order to determine the correct list of glob patterns to use when
searching. Currently the 'files.exclude' and 'search.exclude' are merged
together to generate the list of globs and then set the Workspace settings
appropriately
* Uses the 'search.followSymlinks' setting to determine whether to ignore
reparse points
Note that the LanguageClient must be configured to send these settings during
the didChangeConfiguration events otherwise it will default to include
everything.
* (GH-879) Do not normalise paths from EnumeratePSFiles
Previously the paths emitted by `EnumeratePSFiles` were normalised to use the
directory path separator appropriate for the platform. In particular on Windows
the paths emitted by the Microsoft.Extensions.FileSystemGlobbing library
contained both forward and backward slashes. However on inspection this is not
required as all the paths are converted to URIs when communicating over LSP, so
the normalisation is no longer required.
This commit removes the normalisation and updates the tests to reflect the new
paths.
0 commit comments