This is an archive of the discontinued LLVM Phabricator instance.

[TableGen:LSP] Resolve "go-to-def" on a let field to the base definition
ClosedPublic

Authored by rriddle on Sep 20 2022, 1:48 AM.

Details

Summary

This allows for go-to-def on the a let field to resolve to the definition
of the base class. This is kind of like how C++ works with go-to-def
from use->def->decl, with the decl in this case being the base definition
of the field.

Depends on D134259

Diff Detail

Event Timeline

rriddle created this revision.Sep 20 2022, 1:48 AM
rriddle requested review of this revision.Sep 20 2022, 1:48 AM
jpienaar accepted this revision.Sep 25 2022, 6:20 AM
jpienaar added inline comments.
mlir/lib/Tools/lsp-server-support/SourceMgrUtils.h
37

SMRange is defined as half-open so contains here feels off. closureContains would be more accurate but may not be too specialized. containsOrLimit would be more direct.

I'm worries that this could be hiding off-by-one issues.

(I also appreciate that this is a pure move and we could look at follow on that is more mechanical)

This revision is now accepted and ready to land.Sep 25 2022, 6:20 AM
rriddle marked an inline comment as done.Sep 27 2022, 11:20 PM
rriddle added inline comments.
mlir/lib/Tools/lsp-server-support/SourceMgrUtils.h
37

Agreed. Fixed the comparison here, given that I don't think anything actually relies on the inclusive aspect of it.

This revision was automatically updated to reflect the committed changes.
rriddle marked an inline comment as done.