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

Inconsistent behavior between search and sidebar when modeline overrides language specified by extension #60580

Open
varungandhi-src opened this issue Feb 16, 2024 · 2 comments
Labels
team/search-platform Issues owned by the search platform team

Comments

@varungandhi-src
Copy link
Contributor

varungandhi-src commented Feb 16, 2024

Related items:

Search query in screenshot, file in screenshot

One possible fix here would be that once we have a high performance API for fetching file contents (Slack discussion)

we can also do content-based language detection for the icons and ensure consistent behavior.

As a quick spot check, I went through ~10 different files which have a C++ modeline but a C extension, and all of them seem to actually be valid C and not using any C++ features. So I'm not sure why they got marked as C++ with the modeline. 🤷🏽 However, I'd argue that the discrepancy is still confusing.

/cc @sourcegraph/search-platform

@varungandhi-src varungandhi-src added team/code-search Issues owned by the code search team graph/language-detection Inference of languages from filenames, file contents etc. labels Feb 16, 2024
@jtibshirani
Copy link
Member

As a tactical fix, I wonder if we should remove the modeline detection in our go-enry wrapper? I'd be really curious to understand how much it helps in practice.

@varungandhi-src
Copy link
Contributor Author

I don't think we should remove the modeline detection because people use that a bunch in practice. Here's an example query for Python.

@camdencheek camdencheek added team/search-platform Issues owned by the search platform team and removed team/code-search Issues owned by the code search team labels May 1, 2024
@mmanela mmanela added the Migrated label May 6, 2024 — with Linear
@eseliger eseliger removed the Migrated label May 21, 2024
@camdencheek camdencheek removed the graph/language-detection Inference of languages from filenames, file contents etc. label May 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
team/search-platform Issues owned by the search platform team
Projects
None yet
Development

No branches or pull requests

5 participants