| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
|
||
| function updateReadonlyPropertyInitializerStatementConstructor(changeTracker: textChanges.ChangeTracker, file: SourceFile, constructor: ConstructorDeclaration, accessorName: AcceptedNameType, fieldName: AcceptedNameType) { | ||
| if (constructor.body) { | ||
| const initializerStatement = find(constructor.body.statements, (stmt => |
There was a problem hiding this comment.
An assignment to the private name can happen anywhere really and not just in expressionStatemetns, it can be in a comma expression nested in a call... you want to use FindAllReferences.getReferenceEntriesForNode here instead of searching the body yourself. a few notes:
Sorry, something went wrong.
| if (!constructor.body) return; | ||
| const { file, program, cancellationToken } = context; | ||
|
|
||
| const referenceEntries = mapDefined(FindAllReferences.getReferenceEntriesForNode(-1, originalName, program, [file], cancellationToken), entry => ( |
There was a problem hiding this comment.
use the position of the node in the file and not -1.
Sorry, something went wrong.
| if (!constructor.body) return; | ||
| const { file, program, cancellationToken } = context; | ||
|
|
||
| const referenceEntries = mapDefined(FindAllReferences.getReferenceEntriesForNode(constructor.pos, originalName, program, [file], cancellationToken), entry => ( |
There was a problem hiding this comment.
the position should be the position of the property reference you are looking for. i am surprised this even works..
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes #22143