Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Feature request: hover results on clang #includes paths #21838

Closed
northyg opened this issue Jun 7, 2021 · 6 comments
Closed

Feature request: hover results on clang #includes paths #21838

northyg opened this issue Jun 7, 2021 · 6 comments

Comments

@northyg
Copy link
Contributor

northyg commented Jun 7, 2021

Feature request description

Filing this feature request on behalf of a customer. Essentially in this case C/C++ files are not showing their corresponding files because customer is using relative paths.

Example that doesn't work because of the path:
#include <../dir1/file.cc>

Because of this, the def/finds refs popup does not work.

It's my understanding that this functionality works in similar products to Sourcegraph, such as OpenGrok. Having this functionality would be incredibly useful!

@leahnp
Copy link

leahnp commented Nov 4, 2021

This is something that gets requested a lot at our firm, it would be great to get it in a future release

@lguychard
Copy link
Contributor

@northyg this came up in triage, and I'm trying to understand what the original issue is.

I'm a bit confused, because the issue title mentions supporting relative paths in .gitmodule, but the issue description mentions a relative path that would live in a source file (c/cpp #include directive). In neither case is the connection to the code intelligence popup super clear.

Is this about:

  1. Not being able to click through to submodules from the repository view / file tree when they are specified as relative paths in .gitmodule? (eg. the documented limitation from our docs that we currently do not support relative path setups for submodules, which is orthogonal from code intel).
  2. Not being able to see hovers / defs / refs for symbols that are defined in files imported with relative paths (and whose relative paths are in submodules?). If so, would that be with precise code intelligence (through lsif-clang?), or search-based intelligence?

Thanks!

@macraig
Copy link
Contributor

macraig commented Feb 1, 2022

@northyg @alexfogg resurfacing this thread as per @lguychard 's comment above it's a bit unclear where this should fall in terms of ownership. Thanks!

@DaedalusG
Copy link
Contributor

Giving this a quick refresher --

To re-summarize in languages like Java we can resolve hovers for imports, for example:
repo:^github\.com/elastic/elasticsearch$@985a2fb file:^server/src/main/java/org/elasticsearch/index/codec/CodecService\.java
(link)
Screenshot 2023-03-06 at 11 34 22 AM

What is desired here is the same behavior for C includes for example:
repo:^github\.com/tensorflow/tensorflow$ file:^tensorflow/core/graph/validate\.h
(link)

Here a hover on tensorflow/lite/core/c/common.h would ideally allow a user to jump to https://sourcegraph.com/github.com/tensorflow/tensorflow/-/blob/tensorflow/lite/core/c/common.h

Include
Screenshot 2023-03-06 at 11 41 27 AM

File to jump to
Screenshot 2023-03-06 at 11 42 13 AM

@varungandhi-src any chance you can provide insights about the feasibility of implementing this request?

@DaedalusG
Copy link
Contributor

Had a quick chat with Varun -- this feature is on the roadmap for planned work on scip-clang
sourcegraph/scip-clang#2

@DaedalusG DaedalusG changed the title Feature request: Support relative path in .gitmodules Feature request: hover results on clang #includes paths Mar 7, 2023
@varungandhi-src
Copy link
Contributor

varungandhi-src commented Apr 5, 2023

Fixed in sourcegraph/scip-clang#166. I will be publishing a scip-clang release next week, which (ahem) includes this.

Example: sourcegraph.com/github.com/ninja-build/ninja/-/blob/src/graph.h?L23:10-23:20#tab=references

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

No branches or pull requests

6 participants