Skip to content
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

Support inlay hints #117

Open
HKalbasi opened this issue Nov 15, 2022 · 4 comments
Open

Support inlay hints #117

HKalbasi opened this issue Nov 15, 2022 · 4 comments

Comments

@HKalbasi
Copy link

Inlay hints add additional inline information to source code, like inferred types and parameter names, which language servers can provide. Supporting them in scip (and sourcegraph) would be great.

@varungandhi-src
Copy link
Contributor

I was talking about this with @olafurpg earlier today, and probably the right thing to do here is to attach extra information to source ranges, or occurrences, depending on the exact details. SCIP could encode the information at the semantic level -- track whether the information is an inferred type, a parameter name, or in languages like C++ an implicit conversion. Different UIs could potentially render it differently, e.g. as inlay hints, or as something else.

The other thing to be careful of here is ideally, we would have support for richer structure, e.g. so that we can potentially support clicks, hovers etc instead of just rendering a plain string.

Right now, we're focused on working on different indexers, and this would also require some design and frontend work for the end-to-end experience. Overall, I feel like this feature would be useful for C++ too (and maybe other languages with type inference/method chaining patterns), so it would be nice to support this in the future.

@michaelpj
Copy link

I think generally being able to add some kind of unspecified additional annotations to ranges might be nice. Obviously having specified annotations is better, but for the use cases I'm thinking of where SCIP is used as an intermediary format between two tools that can coordinate closely (such as an indexer and language server for the same language), having an unspecified annotation type that can be used to pass application-specific information through might be quite handy.

@varungandhi-src
Copy link
Contributor

@michaelpj for that use case, I think it's probably best to use a fork (I'm guessing you're already doing that). That way, you can add more structure directly, instead of having to stuff everything into a catch-all byte buffer, and having a separate serialization/deserialization step for the byte buffer (per occurrence).

For structured data (and not catch-all fields) where the design has been relatively clear, we've been open to adding new fields to SCIP in the past that we're not yet using at Sourcegraph.

@michaelpj
Copy link

(I'm not using it at all yet, I'm just assessing :) )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants