-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
DocumentFilter does not work for dockerfiles #878
Comments
@PeterJausovec Just to clarify, you have a filter like this |
Yes, filter like the one below works fine: However, if I try to use a filter for Dockerfile - e.g. |
I'd say that's because The properties of the document filter must all match so that the filter matches (logical AND). You can either change the pattern (maybe |
Yes, I know it doesn't - I have a separate document filter that's for dockerfile only and its pattern is |
Check the file here: https://github.com/Microsoft/vscode-docker/blob/master/dockerExtension.ts. If I add the pattern to |
This seems to be a problem with our glob matcher |
@jrieken I don't see how a pattern of |
I am not trying to match docker file to the docker compose pattern. Check the source file I referenced above. |
Sorry, I am not getting it. Can you point to the exact line in that file? |
For docker-compose files I am using the pattern below. This works fine. I was trying to use the pattern However, using the pattern |
@PeterJausovec please confirm these steps and will in the uri of your document
|
I added this: If I open a file named |
so it does seems to be glob related. please try using just this |
I tried |
ok. thanks for the heads-up |
Ok I get it, our glob matcher is case sensitive. There is currently no option to test ignoring case. I think the easiest would be to lowercase the file name when passing into the glob call @jrieken |
I am unsure if making stuff lower-case is desirable... |
If a user can provide multiple document filters for the same kind, the solution is to just provide as many glob patterns as needed to catch the casing too. |
yeah. you can do |
I can add a flag to glob to ignore casing, since its just a RegEx in the end it should be easy. |
(that is, it would be an option, I dont want to enable this for any glob) |
unless the flag is in the glob expression itself, it will be the same as me lower-casing the string first I guess |
Right, since glob patterns are not RegExp syntax, there is no syntax from what I remember to form a case-insensitive glob. Would it make sense to allow to set this flag from the side of the extension? {pattern: '**/lowercase', ignoreCase: true} |
I would say case doesn't matter; since Docker users will probably have more than 1 dockerfile, our idea was to provide the syntax coloring and all that magic for files that are named |
Needs more thinking. Tend towards not doing this. |
We've updated our yo docker tools to use docker.debug /docker.release to enable developers to compose up multiple environments. This means our scaffolding is generating assets that hide the docker editor features. Is it possible to get this in the January 2016 milestone? |
CC @chrisdias |
@SteveLasker, @PeterJausovec Is it that you guys want to contribute a language service for docker files or do you want to add specific features for certain docker files - those that match a name pattern? Can you provide some samples, like |
We own the docker extension for VS Code (https://github.com/microsoft/vscode-docker) and as I mentioned earlier, we would like to provide support for files that match the pattern |
So what you guys actually want is to be able to map more filenames to the language |
That is then not the document filter, but the language mapping as defined in |
@alexandrudima, @bpasero Do we already support some sort of globbing in the filename-to-language mapping? |
Just wanted to check on the status of this. We'd really like to close this item out and promote the extension. Sent from my phone
|
@SteveLasker I am still waiting for answers regarding adding a |
Are you looking for input from us or the underlying implementation? Sent from my phone
|
@SteveLasker, @PeterJausovec Please answer (1) or (2). |
@jrieken we do not support glob patterns for registering file names to languages currently. The code that decides which mode to load given a file name is https://github.com/Microsoft/vscode/blob/master/src/vs/editor/common/modes/languageExtensionPoint.ts#L451 |
closing in favour of #1851 |
We want our docker extension to support yml and docker files when they are named like ‘docker-compose-dev.yml’ or ‘dockerfile-dev’ etc. Using the DocumentFilter pattern
**/docker-compose*.yml
I was able to get this to work, however DocumentFilter**/dockerfile*
does not work – I don’t even get syntax coloring.The text was updated successfully, but these errors were encountered: