Add telemetry for imports#4736
Conversation
| }); | ||
|
|
||
| function emitDocEvent(code: string, ev: EventEmitter<TextDocument>) { | ||
| const textDoc = createDocument(code, 'foo.py', 1, TypeMoq.Times.atMost(100), true); |
There was a problem hiding this comment.
TypeMoq.Times.atMost(100) [](start = 58, length = 25)
The 100 is not actually meaningful here is it? There is a Times.max that would express "any amount is ok" if that was the intent here. #ByDesign
There was a problem hiding this comment.
That's what I wanted. Didn't find it. #ByDesign
There was a problem hiding this comment.
Intellisense says otherwise? Is it liternally Times.max? #ByDesign
There was a problem hiding this comment.
Looks like I was reading the type wrong. The max and min are internal implementation details. I honestly don't see a way to express "any number of times" which is a bit funky but the best we can do I guess.
In reply to: 265220960 [](ancestors = 265220960)
Codecov Report
@@ Coverage Diff @@
## master #4736 +/- ##
=======================================
- Coverage 77% 77% -<1%
=======================================
Files 447 449 +2
Lines 21472 21978 +506
Branches 3527 3586 +59
=======================================
+ Hits 16444 16792 +348
- Misses 5024 5181 +157
- Partials 4 5 +1
|
| expect(Reporter.properties).to.deep.equal([{ import: 'scipy' }]); | ||
| }); | ||
|
|
||
| // That's probably enough different variants of code to verify nothing is wonky. |
There was a problem hiding this comment.
// That's probably enough different variants of code to verify nothing is wonky. [](start = 3, length = 81)
Couple to consider if you want. You can have an import inside a function so it would be indented with leading whitespace. Also it violates PEP8, but via the definition you can multi import with , so like import numpy, pandas works. #Resolved
|
|
||
| // Activate import tracking | ||
| const importTracker = serviceManager.get<IImportTracker>(IImportTracker); | ||
| importTracker.activate(); |
There was a problem hiding this comment.
This looks like it has the possibility of blowing up our extension activation time. It's line by line regex on every open document. #Resolved
There was a problem hiding this comment.
Yeah I should at least check for python files and maybe limit the number of lines to say 1000.
In reply to: 265227058 [](ancestors = 265227058)
Add more tests for commas and such
For #4718
package-lock.jsonhas been regenerated by runningnpm install(if dependencies have changed)