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

When implementing a Zed extension, path_suffixes doesn't support dots (ex: filename.cf.sub) #10997

Open
1 task done
olehermanse opened this issue Apr 25, 2024 · 2 comments
Open
1 task done
Labels
defect [core label] extension infrastructure Feedback for extensions APIs, creation, management, etc

Comments

@olehermanse
Copy link
Contributor

olehermanse commented Apr 25, 2024

Check for existing issues

  • Completed

I found this other issue which seems almost the same, except it talks about wildcards:

#8466

Describe the bug / provide steps to reproduce it

My extension:

https://github.com/olehermanse/zed-cfengine

Is not highlighting some of our test files which use the .cf.sub extension:

https://github.com/cfengine/core/blob/d7227da3cb47cbe8b6079559acac3cb6374f1a10/tests/acceptance/run_with_server.cf.sub

Even though I added it to the path_suffixes:

olehermanse/zed-cfengine@f854236

As a programmer, I can understand why Zed would consider the extension / suffix anything after the last ., however as a user / extension author, I'd expect what I tried to do to "just work". Essentially, I'd expect the logic for path_suffixes to match any files which end with one of those strings (even if one of those strings include a .).

Workaround: I guess I could add just sub to path_suffixes to make it work for myself, but that doesn't "feel right" as it would conflict with any other language files which might end in .sub.

Environment

Zed: v0.131.7 (Zed)
OS: macOS 14.4.1
Memory: 32 GiB
Architecture: x86_64

@olehermanse olehermanse added admin read Pending admin review defect [core label] triage Maintainer needs to classify the issue labels Apr 25, 2024
@d1y
Copy link
Contributor

d1y commented Apr 25, 2024

I believe this PR #10960 can promote this matter

@JosephTLyons JosephTLyons added extension infrastructure Feedback for extensions APIs, creation, management, etc and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Apr 25, 2024
@claytonrcarter
Copy link
Contributor

I have a similar issue working on a lang extension for Laravel Blade files, which use the suffix .blade.php. Using path_suffixes = ["blade.php"] doesn't work as Zed still opens these files as just PHP. There was limited discussion on the original extensions tracking issue, and it was suggested that using the longest matching suffix could be 1 way to disambiguate which extension/language to use for a given file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect [core label] extension infrastructure Feedback for extensions APIs, creation, management, etc
Projects
None yet
Development

No branches or pull requests

4 participants