This repository was archived by the owner on Apr 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 133
Async Indexer for new LanguageServer #558
Merged
Merged
Changes from 91 commits
Commits
Show all changes
128 commits
Select commit
Hold shift + click to select a range
b9b2554
IndexParser
brianbok cd1878d
Workspace Index Manage
brianbok 6a6a38d
Sorting using as configured on repo
brianbok 765653b
Removing unuseful empty property
brianbok b42d1f4
Moving directory reader to DirectoryInfo
brianbok 8a4d3d6
EnumerateFiles returns non-lazily
brianbok 33d768a
IndexParser throws FileNotFoundException
brianbok 1db8030
Events on files
brianbok 52dd812
Adding update event to index manager
brianbok 7c535c3
Async IndexParser
brianbok 05f3b4e
Async IndexManager
brianbok e5791d3
Check ArgumentNotNull using Diagnostics
brianbok b39ecf4
Async fixes
brianbok b767fbd
PythonVersions.LatestAvailable3X
brianbok 703de21
SymbolIndex fixes
brianbok af85966
SymbolIndex moving method from HierarchicalSymbol
brianbok 2c7dc2d
SymbolIndex corrections
brianbok 26bef41
SymbolIndex return style
brianbok 93d0464
Adding symbolIndex tests
brianbok c93c496
SymbolIndex return style
brianbok 28685c6
Using strings (plain path) instead of Uri
brianbok 0091933
More tests
brianbok c0a0387
More Uri to string type transforming
brianbok 6e4a0f5
Removing FileNotFoundException
brianbok 2e8ecdf
Single Line Return
brianbok 332358f
SymbolIndex Interface
brianbok 0048bf8
Fix AddRoot Test
brianbok 8f4343e
Disposing test fix
brianbok 36ed2e6
Blocking tests new fake
brianbok d58cc6b
Wait for AddRootTask in symbol querying
brianbok 2b3d450
Refactor tests and async add root
brianbok 36c6f85
Adding license header
brianbok a897585
TraverseBreadth variable rename
brianbok 7a2b9c3
deleting unused variable
brianbok b493294
Limiting API
brianbok fb7f8b3
Dispose test fixed
brianbok c4dcf23
Limiting API fix and styling
brianbok aedb206
Dispose testing
brianbok ac2098a
Merge branch 'master' into indexer
brianbok 1363efc
Moved everything into language server
brianbok d788f16
Tests refactor and connecting index to ls
brianbok 98c18aa
Adding file events
brianbok eb83604
async fix
brianbok 8b90ac7
Enumerable fix
brianbok fae4315
Delete copy of SymbolKind
brianbok d3f7da1
Revert "Delete copy of SymbolKind"
brianbok 9c0cb66
Deleting cast
brianbok 7d159bc
Async handling update of AST
brianbok a03c022
Versioned symbolindex
brianbok f6c854b
More versioned syncronization
brianbok 6cf5057
Removing event handler from doc
brianbok 4406a71
Safely executing matcher
brianbok ab650eb
Casting instead of 'as'
brianbok 2617c92
Cast
brianbok a62bf81
Returning on execute matcher
brianbok fa32e97
Adding empty workspace path check
brianbok b38e22b
Merge branch 'master' into indexer
brianbok 93e4d0d
Resolving race condition
brianbok 80d4d39
Async rename
brianbok 57d5ec8
Idling for index
brianbok 78f12c8
Adding delay to idling
brianbok 4a724c7
New async interface
brianbok 0f331c2
Passed more tests
brianbok d3b4761
Removing fields of test
brianbok 74e9bed
Passes every test again
brianbok 59bccd2
Working version
brianbok 0727619
Readonly fields
brianbok dc7b9eb
IndexParser refactoring
brianbok 935f6ba
IndexParser fixes
brianbok 6578616
No Tcs in IndexParser
brianbok e5bf1d8
Disposing streams
brianbok 108259f
Implementing tcs pattern
brianbok 1ff0935
PR comments fixes and typos
brianbok 0bc72c3
Rework of tcs in indexmanager
brianbok 2bba9dc
Delete unused variable
brianbok 9c5bb3a
Disposal check
brianbok 8de9f3a
TCS no reuse
brianbok e2bf0fe
Reorder layers
brianbok d04d375
Making interface for mostrecent symbols
brianbok f7f09fb
Copyright comments
brianbok 9952681
Unused var
brianbok 91b836c
Changin default delay
brianbok 29ecef7
Rename and style correct
brianbok 846f9a9
Getting rid of comment
brianbok 8b19e45
Fix limiting in workspace symbols query
brianbok bad44b1
Better disposal
brianbok 615e483
CancellationToken on querying
brianbok da29542
Walker walks annotated assignments
brianbok 5dd8e2c
Removing use of MaybeEnumerate in Traverse
brianbok 53766a6
Var instead of explicit Uri type
brianbok 5384825
Null check
brianbok 803b67f
max Concurrency handling
brianbok 66f7ae4
Merge branch 'master' into indexer
brianbok 8f704dd
Simple workspace querying
brianbok 17a9d0a
Simplifying disposing
brianbok 88ba453
Simplification
brianbok d9f8d57
Unused method
brianbok 2c60d4f
CancellationToken
brianbok 4825065
First state machine
brianbok fffb215
Tests for states of symbolIndex
brianbok 25b6590
Rename of state
brianbok 4a569ef
Comment on name of state
brianbok 08f6287
File Open FileSystem back to how it was
brianbok 05e711d
Server.Symbols
brianbok 9213ca7
Reference to deleted field
brianbok 0e3c42d
Extra new lines
brianbok 9fcdbe5
Extra spaces
brianbok 08858f0
Delete unused code
brianbok ccef536
Pattern matching in walker
brianbok d60b481
Merge branch 'master' into indexer
brianbok 121a8b0
Unused methods
brianbok c83112b
Using matcher for checking files in workspace
brianbok eba45f2
State machine changes
brianbok 3881c9c
Change exception type
brianbok 5b87d0f
Double releasing semaphore fix`
brianbok 58d5396
Removing continuewith in mostrecentdoc
brianbok 0ae25d8
Setting state, only one assignment per method
brianbok 8ef5750
Disposing index parser in symbol index
brianbok 14d3d90
Make includePatterns optional for match
brianbok a87deac
Not calling excludePatterns if unnecessary
brianbok 2ee4b55
Use of concurrent dictionary instead of lock on object
brianbok ad258cc
Const instead of static
brianbok 190f8a5
Merge branch 'indexer' of github.com:brianbok/python-language-server …
brianbok 4fb33db
IndexParser task creation in a cleaner way
brianbok 61039d5
Use of disposablebag everywhere`
brianbok 2a23b61
Delete unused fields and params
brianbok 6e44942
More disposablebag usage
brianbok 5485c9c
Unused imports
brianbok File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,9 +13,12 @@ | |
// See the Apache Version 2.0 License for specific language governing | ||
// permissions and limitations under the License. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using Microsoft.Extensions.FileSystemGlobbing; | ||
using Microsoft.Extensions.FileSystemGlobbing.Abstractions; | ||
|
||
namespace Microsoft.Python.Core.IO { | ||
public sealed class DirectoryInfoProxy : IDirectoryInfo { | ||
|
@@ -40,6 +43,27 @@ public IEnumerable<IFileSystemInfo> EnumerateFileSystemInfos() => _directoryInfo | |
.EnumerateFileSystemInfos() | ||
.Select(CreateFileSystemInfoProxy); | ||
|
||
public IEnumerable<IFileSystemInfo> EnumerateFileSystemInfos(string[] includeFiles, string[] excludeFiles) { | ||
Matcher matcher = new Matcher(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. #635, just for the reference. |
||
matcher.AddIncludePatterns(includeFiles.IsNullOrEmpty() ? new[] { "**/*" } : includeFiles); | ||
matcher.AddExcludePatterns(excludeFiles ?? Enumerable.Empty<string>()); | ||
PatternMatchingResult matchResult = SafeExecuteMatcher(matcher); | ||
return matchResult.Files.Select((filePatternMatch) => { | ||
var fileSystemInfo = _directoryInfo.GetFileSystemInfos(filePatternMatch.Stem).First(); | ||
return CreateFileSystemInfoProxy(fileSystemInfo); | ||
}); | ||
} | ||
|
||
private PatternMatchingResult SafeExecuteMatcher(Matcher matcher) { | ||
brianbok marked this conversation as resolved.
Show resolved
Hide resolved
|
||
var directoryInfo = new DirectoryInfoWrapper(_directoryInfo); | ||
for (var retries = 5; retries > 0; retries--) { | ||
try { | ||
return matcher.Execute(directoryInfo); | ||
} catch (Exception ex) when (ex is IOException || ex is UnauthorizedAccessException) { } | ||
} | ||
return new PatternMatchingResult(Enumerable.Empty<FilePatternMatch>()); | ||
} | ||
|
||
private static IFileSystemInfo CreateFileSystemInfoProxy(FileSystemInfo fileSystemInfo) | ||
=> fileSystemInfo is DirectoryInfo directoryInfo | ||
? (IFileSystemInfo)new DirectoryInfoProxy(directoryInfo) | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.