-
Notifications
You must be signed in to change notification settings - Fork 133
Conversation
@@ -878,6 +885,9 @@ class bcd(abc): | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or, maybe calling EnqueueItem
twice really changes something, but that isn't expected either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AnalysisQueue.Start/Stop works OK, no need to double load/open
|
||
public event EventHandler AnalysisStarted; | ||
public event EventHandler AnalysisComplete; | ||
public event EventHandler AnalysisAborted; | ||
public event EventHandler<UnhandledExceptionEventArgs> UnhandledException; | ||
|
||
public int Count => _ppc.Count; | ||
public void Start() => _queueEnabled.Set(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I did it in tests, will move to main line.
|
||
await server.WaitForCompleteAnalysisAsync(CancellationToken.None); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
self
that is from the class definitionself
navigates to the class definition