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

Case sensitivity with file extensions affects syntax highlighting #11327

Closed
Bobloblaw74329479279 opened this issue Jun 6, 2020 · 3 comments · Fixed by #16096
Closed

Case sensitivity with file extensions affects syntax highlighting #11327

Bobloblaw74329479279 opened this issue Jun 6, 2020 · 3 comments · Fixed by #16096

Comments

@Bobloblaw74329479279
Copy link

Bobloblaw74329479279 commented Jun 6, 2020

  • Sourcegraph version: 3.16.1
  • Platform information: Ubuntu 20.04

Steps to reproduce:

  1. Add a repo that has .CPP or .H files
  2. Browse to the file.

Expected behavior:

The source file should be colorful and have syntax highlighting.

Actual behavior:

The entire source file is all gray. Sourcegraph needs to do a case insensitive check on the extension to determine the correct language for syntax highlighting.

@eseliger
Copy link
Member

Thanks for reporting! Please see #13007 for progress on this :)

@slimsag
Copy link
Member

slimsag commented Nov 23, 2020

Closing as duplicate of #13007 - will look into this soon.

@slimsag slimsag closed this as completed Nov 23, 2020
slimsag added a commit that referenced this issue Nov 23, 2020
…ng to syntect_server

syntect_server expects lowercase filepath extensions only in https://github.com/sourcegraph/syntect_server#supported-file-extensions
technically, it is being correct here because the actual syntax definitions describe exactly
which file extensions they should match in a case sensitive manner. However, in practice
this is not ideal because there is not usually an overlap of case-sensitivity in file extensions
describing different syntaxes, and it is somewhat common for users to find they have e.g. `.CPP`
and `.cpp` files for whatever reason in their repos. Thus, we lowercase file extensions before
sending the request to syntect_server.

Fixes #13007

Fixes #11327
slimsag added a commit that referenced this issue Nov 24, 2020
…ing to syntect_server (#16096)

* internal/highlight: always normalize filepath extensions before sending to syntect_server

syntect_server expects lowercase filepath extensions only in https://github.com/sourcegraph/syntect_server#supported-file-extensions
technically, it is being correct here because the actual syntax definitions describe exactly
which file extensions they should match in a case sensitive manner. However, in practice
this is not ideal because there is not usually an overlap of case-sensitivity in file extensions
describing different syntaxes, and it is somewhat common for users to find they have e.g. `.CPP`
and `.cpp` files for whatever reason in their repos. Thus, we lowercase file extensions before
sending the request to syntect_server.

Fixes #13007

Fixes #11327
@slimsag
Copy link
Member

slimsag commented Nov 26, 2020

@Bobloblaw74329479279 Just wanted to let you know, this has been fixed in the latest insiders build, on Sourcegraph.com, and will be in our next release Sourcegraph v3.23 on Dec 20th.

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