Skip to content

Preserve file names for language detection#81

Open
iliazeus wants to merge 2 commits intoryu1kn:masterfrom
iliazeus:38-language-modes
Open

Preserve file names for language detection#81
iliazeus wants to merge 2 commits intoryu1kn:masterfrom
iliazeus:38-language-modes

Conversation

@iliazeus
Copy link
Copy Markdown

VSCode is able to detect and apply language modes automatically, looking at (among other things) file extensions. This PR makes it so the ContentProvider URIs preserve extensions of their source files. That enables VSCode to set language modes by default.

@iliazeus
Copy link
Copy Markdown
Author

Resolves #38

@pawk3k
Copy link
Copy Markdown

pawk3k commented Aug 4, 2024

I can add one more why we need this ?
In case of someone using https://semanticdiff.com/, file extension is needed to better understand how to calculate diff for better visibility @ryu1kn , could you please take a look into it 🙏

@iliazeus
Copy link
Copy Markdown
Author

iliazeus commented Apr 7, 2025

@ryu1kn can you please review this PR? This is the single feature I miss from this extension.

@ryu1kn
Copy link
Copy Markdown
Owner

ryu1kn commented Apr 2, 2026

Apologies for not attending the PR for years @iliazeus . Also thanks for the additional context @pawk3k .

The concern i had here is that since partial diff can grab arbitrary portion of code to compare, the part extracted may not be well-formed, and get red squiggles, which can be noisy.

image

I've just tried your branch. It looks like this. Since it's just red squiggles, probably it's not too bad, and users would know what they're doing. I'm happy to introduce this as a toggled feature. Something like partialDiff.enableFileTypeRecognition (boolean, default false)?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants