Repository navigation
Navigation and tooltip on self - #251
Conversation
| var fobUri = TestData.GetTempPathUri("fob.py"); | ||
| var oarUri = TestData.GetTempPathUri("oar.py"); | ||
| using (var server = await CreateServerAsync(PythonVersions.LatestAvailable3X)) { | ||
| await server.LoadFileAsync(fobUri); |
There was a problem hiding this comment.
Server.DidOpenTextDocument calls the same AddFileAsync as LoadFileAsync (ProjectFiles.GetEntry is a simple dictionary lookup):
https://github.com/Microsoft/python-language-server/blob/39a17b1a8aefed9ee18d904ceff2d3c447f0f060/src/LanguageServer/Impl/Implementation/Server.cs#L192
So if these loads change anything in test results, it is not because of the code flow, but because of the timings.
There was a problem hiding this comment.
Or, maybe calling EnqueueItem twice really changes something, but that isn't expected either.
There was a problem hiding this comment.
There is known problem with files being analyzed while other files are still being added. I am going to get my AnalysisQueue.Start/Stop change and see if that works better.
There was a problem hiding this comment.
AnalysisQueue.Start/Stop works OK, no need to double load/open
| public event EventHandler<UnhandledExceptionEventArgs> UnhandledException; | ||
|
|
||
| public int Count => _ppc.Count; | ||
| public void Start() => _queueEnabled.Set(); |
There was a problem hiding this comment.
It looks like we can replace pair of Start and Stop with IDisposable Pause using CountdownDisposable from RTVS: https://github.com/Microsoft/RTVS/blob/master/src/Common/Core/Impl/Disposables/CountdownDisposable.cs
There was a problem hiding this comment.
OK. I did it in tests, will move to main line.
| await server.SendDidOpenTextDocument(uri2, text2); | ||
| } | ||
|
|
||
| await server.WaitForCompleteAnalysisAsync(CancellationToken.None); |
There was a problem hiding this comment.
Ok, these changes make tests pass, but when we make changes to LanguageServer so that it doesn't load all the files in the root directory and subdirectories, these tests will become irrelevant to the product behavior, cause there will be no waiting.
There was a problem hiding this comment.
Even then the analysis will still have to be completed fully on the loaded set and importing mechanism will be loading files that are referenced, even if they are not open. Basicalle, to make that case work we may need to use AST to fugure out what else to load besides the file being opened.
Navigation and tooltip on self
Fixes #22
selfthat is from the class definitionselfnavigates to the class definition