David Sherret

Results 787 comments of David Sherret

Thanks @Gerrit0 for that suggestion! I didn't know about that. @HoldYourWaffle what do you think about updating this PR to use that API? It might be nice if it caches...

I think the closest thing is to use tsquery. See here: https://gist.github.com/dsherret/826fe77613be22676778b8c4ba7390e7 There's some past discussion in #585 and #351, but basically adding querying is something I don't want to...

The bug here is that it puts the jsdoc on the same line as where the declaration is, but since it has a leading token the ts compiler it doesn't...

Hmmm... that should be fixed. That said, you should check out [dprint](https://github.com/dprint/dprint) 😅

@nchanged could you post some before/after code that shows what you'd like to do? That way I can ensure I understand what you mean? Yeah, the `thenStatement` property in the...

@nchanged hmmm... I should probably add a `getBodyText()` method to `Block` (along with `setBodyText`). I think for now this workaround should work for you: ```ts node.replaceWithText(thenStatement.getChildSyntaxListOrThrow().getText({ trimLeadingIndentation: true })); ```

@nchanged What version of ts-morph are you using? https://github.com/dsherret/ts-morph/blob/9e4f07ddef7def316ed9601b3c78a1409c7aed01/lib/ts-morph.d.ts#L4504

Part of the reason this is occuring is because calling `getFirstChild()` on a source file will return its `SyntaxList`. See and select Options (in top right corner) > Tree mode...

I think the only way to do this would be to use `diagnostic.getStart()` and `diagnostic.getLength()` then use `sourceFile.getDescendantAtStartWithWidth(diagnostic.getStart(), diagnostic.getLength()` to try to get the Node.

This ties in with #355 and #410. The CLI itself doesn't really have any knowledge of the plugins, so there would need to be some way of configuring this (either...