d1y / dockerfile.zed

15 stars 5 forks source link

Dockerfile.prod and it's varieties are not getting detected. #1

Closed AquamanRanda closed 4 months ago

AquamanRanda commented 7 months ago

I have attached a screenshot of the issue:

CleanShot 2024-02-23 at 11 32 36

d1y commented 7 months ago

Yep. now only matches Dockerfile https://github.com/d1y/dockerfile.zed/blob/5fe1290d7ea20323e3305e28df8cb52d68ad9621/languages/dockerfile/config.toml#L3

d1y commented 7 months ago

I'm not sure whether fuzzy matching is possible in zed. vscode-docker's file matching is written like this: https://github.com/microsoft/vscode-docker/blob/main/package.json#L1518-L1520

image
sinlov commented 7 months ago

I'm not sure whether fuzzy matching is possible in zed. vscode-docker's file matching is written like this: https://github.com/microsoft/vscode-docker/blob/main/package.json#L1518-L1520 image

just config like this

path_suffixes = ["Dockerfile", "dockerfile", "s6"]
image
jianghoy commented 7 months ago

I'm not sure whether fuzzy matching is possible in zed. vscode-docker's file matching is written like this: https://github.com/microsoft/vscode-docker/blob/main/package.json#L1518-L1520 image

just config like this

path_suffixes = ["Dockerfile", "dockerfile", "s6"]
image

I believe here the problem is people uses 3(!) naming conventions for multiple Dockerfile files in the same directory:

*.Dockerfile
Dockerfile.*
*.dockerfile

And I believe it comes down to whether zed support matching by prefix, or better, some sort of regex or not.

d1y commented 7 months ago

AFAIK: regular matching is not supported yet

d1y commented 6 months ago

I believe this is the same thread: https://github.com/zed-industries/zed/issues/8466

rosingrind commented 5 months ago

I did work around this by adding to ~/.config/zed/settings.json:

{
  "file_types": {
    "Dockerfile": ["Dockerfile", "Dockerfile.local"]
  }
}

I think that's pretty and simple. Thanks for the extension!

channyein87 commented 5 months ago

I tried the below config and doesn't work for me. I have couple of Dockerfile-xyz files.

{
  "file_types": {
    "Dockerfile": ["Dockerfile", "Dockerfile-*"]
  }
}
d1y commented 5 months ago

I tried the below config and doesn't work for me. I have couple of Dockerfile-xyz files.

{
  "file_types": {
    "Dockerfile": ["Dockerfile", "Dockerfile-*"]
  }
}

https://github.com/zed-industries/zed/issues/10997#issuecomment-2077839161

d1y commented 4 months ago

I tried the below config and doesn't work for me. I have couple of Dockerfile-xyz files.

{
  "file_types": {
    "Dockerfile": ["Dockerfile", "Dockerfile-*"]
  }
}

Now it can work, and the main has merged this feature

obahareth commented 2 months ago

@d1y Thanks for merging this. Is the only option right now to add this to user settings, or is it possible to let path_suffixes handle this, e.g.

path_suffixes = ["Dockerfile", "Containerfile", "Dockerfile*"]