Instantiation views #1028
Replies: 2 comments
-
Prior art for something similar: Cevelop's Template Information View. |
Beta Was this translation helpful? Give feedback.
-
Another example of something that's sort of prior art for this: one of the source transformations CppInsights (also available as a VSCode extension) performs is insert all implicit instantiations of templates in a given translation unit into the source code. CppInsight's way of printing the source code of an implicit instantiation is basically what I envisioned for instantiation views. The implementation, available at https://github.com/andreasfertig/cppinsights, could be a useful guide for us. |
Beta Was this translation helpful? Give feedback.
-
One item that's long been on my C++ editor wishlist is a feature I'll call instantiation views, which I'll describe here.
An instantiation view is a code view showing an implicit instantiation of a template.
General behaviour
Ways to open an instantiation view
foo
with an argument of typeint
) goes to its instantiation view (e.g.foo<int>
), not the template definition.I haven't thought through how this feature would be realized in an LSP world. (Would instantiation views need to be represented as their own documents in the LSP model?) Possibly they'd need a bit tighter client/server integration than LSP was designed for.
Feedback/thoughts are welcome.
Beta Was this translation helpful? Give feedback.
All reactions