GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — id(web): detectLanguage lets a special-name stem override a known extension — justfile.rs highlights as Just, makefile.md as Makefile · Issue #721 · developing-today/code

id(web): detectLanguage lets a special-name stem override a known extension — justfile.rs highlights as Just, makefile.md as Makefile #721

New issue
Copy link
New issue
Copy link
Closed
#722
Closed
id(web): detectLanguage lets a special-name stem override a known extension — justfile.rs highlights as Just, makefile.md as Makefile#721
#722
Copy link
Assignees
dezren39
Labels
app/idPackage/app: id (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)

Description

@dezren39
dezren39
opened on Oct 24, 2026
Issue body actions

Summary

detectLanguage in pkgs/id/web/src/highlight.ts checks the file's stem against the special-filename table before it ever looks at the extension, so any file whose stem happens to be a special name is highlighted with the wrong language even when its extension unambiguously names another one.

Evidence (verified on main df38365, temporary vitest probe since removed)

highlight.ts:133-143 computes nameWithoutExt (basename minus its final extension) and returns FILENAME_TO_LANG[nameWithoutExt] before the extension lookup at highlight.ts:158-162.

Probe results against the real function:

filename returned correct
justfile.rs just rust
makefile.md makefile markdown
dockerfile.py dockerfile python
gemfile.json ruby json
vagrantfile.toml ruby toml
cmakelists.rs cmake rust
rakefile.ts ruby typescript

Controls that must keep working:

filename returned correct
Dockerfile.dev dockerfile dockerfile (extension unknown)
CMakeLists.txt cmake cmake (.txt has no language)
src/Dockerfile dockerfile dockerfile (no extension)

Why it matters

The editor picks the Shiki grammar solely from this function (filename-detected language, highlight.ts createSyntaxHighlightPlugin). A mis-detected file is highlighted with a completely unrelated grammar — e.g. documentation about a Makefile (makefile.md) or a Rust source file named after the tool it drives (justfile.rs). The special-name rule was only ever meant for files that are the special file (Dockerfile, Makefile, CMakeLists.txt, Dockerfile.dev); it should not override a known extension.

Acceptance criteria

  • When the basename's extension is present in EXT_TO_LANG, the extension wins over the stem special-name match (justfile.rs → rust, makefile.md → markdown, gemfile.json → json).
  • Special filenames still win when there is no extension (Dockerfile, Gemfile, src/Makefile) or the extension is unknown (Dockerfile.dev, CMakeLists.txt).
  • Dotfile handling (.env, .gitignore, .env.local, …) is unchanged.
  • New regression tests in highlight.test.ts cover at least the stem-vs-known-extension cases and the unknown-extension controls above; the existing detectLanguage suite passes unchanged.

Activity

  1. github-actions
    assigned
    dezren39
    on Oct 24, 2026
  2. dezren39
    added a commit that references this issue on Oct 24, 2026

    Merge pull request #722 from developing-today/creator/721-detect-lang…

    b78b180
  3. dezren39
    closed this as completedin #722on Oct 24, 2026
  4. developing-today-fleet commented on Nov 24, 2026

    @developing-today-fleet
    developing-today-fleetBot
    on Nov 24, 2026 – with developing.today fleet
    Contributor
    More actions

    AUDIT-7 Lane 2 slice 3 — closing evidence. Verified against the issue body and merged implementation PR(s):

    • PR #722 — fix(id/web): known extension wins over special-name stem in detectLanguage (#721) (merged 2026-10-24)

    The issue had zero comments in the fresh pre-action read; this comment records the missing close evidence.

  5. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.