-
Notifications
You must be signed in to change notification settings - Fork 234
Reduce allocations in the CodeLens providers #719
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
dccea93
d9d1d35
4d200bd
dc09c18
76d7aad
4136b56
4f7230f
66d976c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,7 +77,7 @@ private CodeLens[] GetPesterLens( | |
public CodeLens[] ProvideCodeLenses(ScriptFile scriptFile) | ||
{ | ||
var lenses = new List<CodeLens>(); | ||
foreach (var symbol in _symbolProvider.ProvideDocumentSymbols(scriptFile)) | ||
foreach (SymbolReference symbol in _symbolProvider.ProvideDocumentSymbols(scriptFile)) | ||
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. This only calls 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. I think so, yes. Why do you ask? 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. spoke to @SeeminglyScience about this. We're good |
||
{ | ||
if (symbol is PesterSymbolReference pesterSymbol) | ||
{ | ||
|
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.
I like. The rule for using
var
on my team is this - usevar
when the type of the RHS is obvious i.e. it's a literal, a new statement or type-cast. And also when required - anonymous types. Do not usevar
when the type is not obvious, which it usually isn't when invoking a method (or reading a property).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.
100% agreed on that rule!
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.
Also 100% agree!