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

Ability to add extra file extensions for a specific type #4994

Closed
1 task done
noozo opened this issue Feb 23, 2023 · 6 comments
Closed
1 task done

Ability to add extra file extensions for a specific type #4994

noozo opened this issue Feb 23, 2023 · 6 comments
Labels
enhancement [core label] language An umbrella label for all programming languages syntax behaviors

Comments

@noozo
Copy link

noozo commented Feb 23, 2023

Check for existing issues

  • Completed

Describe the feature

I would love for the settings to allow specifying non-standard file extensions to a particular type. For example:

  • (Elixir) Surface (.sface) files as the HTML type
  • mix.lock as JSON type
  • Dockerfile as Docker type (unsure this one is actually supported in Zed yet)

As a side note, it would be lovely if Elixir support included the ability to syntax highlight sigil content, including surface (~F, ~H), as most Phoenix Live View code includes rendered HTML inside sigils and it currently looks sad and hard to code.

If applicable, add mockups / screenshots to help present your vision of the feature

image

image

@noozo noozo added enhancement [core label] triage Maintainer needs to classify the issue labels Feb 23, 2023
@noozo
Copy link
Author

noozo commented Feb 28, 2023

Partially related to: #5822

@JosephTLyons JosephTLyons added language An umbrella label for all programming languages syntax behaviors and removed triage Maintainer needs to classify the issue labels Mar 6, 2023
@JosephTLyons
Copy link
Collaborator

Hey @noozo, would either of these (or both) help to solve this issue for you? Having a settings area to apply one language's syntax highlighting to another:

@mpassell
Copy link

Associating specific files or types of files with a given language/language server seems to be covered by #5178, but not your Elixir-specific requests.

@noozo
Copy link
Author

noozo commented Jul 13, 2023

There's two parts to this:

  • One, ability to associate, for instance .sface (Surface) as elixir/liveview (so that we would get syntax highlighting like we do in the sigil ~H (means we have HTML code inside an .ex file, as in LiveView)
  • Two, ability to support other sigils, like Surface's ~F which is a variation of LiveView's ~H.

@noozo
Copy link
Author

noozo commented Nov 2, 2023

@JosephTLyons

@JosephTLyons JosephTLyons transferred this issue from zed-industries/community Jan 24, 2024
@JosephTLyons
Copy link
Collaborator

Hey @noozo, we now have support for this. You can add this setting to your settings.json file and map whatever you'd like:

"file_types": {
    "JSON": ["flake.lock"],
    "JSONC": ["**/.zed/**/*.json", "**/zed/**/*.json", "**/Zed/**/*.json", "tsconfig.json"]
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement [core label] language An umbrella label for all programming languages syntax behaviors
Projects
None yet
Development

No branches or pull requests

3 participants