Add all root project env files to ImportantFiles#9289
Add all root project env files to ImportantFiles#9289haidubogdan wants to merge 2 commits intoapache:masterfrom
Conversation
|
Just checking if the mime update is too extensive, and if it's ok for you to have all env files under ImportantFiles for web projects. |
mbien
left a comment
There was a problem hiding this comment.
looks good to me but I have limited experience regarding php.
maybe @matthiasblaesing could take a quick look
matthiasblaesing
left a comment
There was a problem hiding this comment.
The matching is too broad. For example "test.env.js" or "test.env.ini" will also be matched and instead of being correctly handled as their correct mimetype env will occupy them.
I think it would be good to split the two different problems into different PRs. The change to the grammar makes sense to me. The broad mime type squatting does not.
ide/languages.env/src/org/netbeans/modules/languages/env/EnvLanguage.java
Outdated
Show resolved
Hide resolved
|
Thank you @matthiasblaesing . |
Not sure that I get what you mean. The problem with .env files from my POV is, that they are an ad-hoc solution combined with a bad naming convention. From my POV it would much more sense to call the shown .env files What might be acceptable for the substring matcher would be to move the mimetype mapping far down and let it be considered last/late. That might need adjustment to other modules (the LSP integrations currently have a very high position, so this might need to be lowered). |
|
The existing My issue was with ".test" file extensions, I noticed that there are Symfony php Projects which use I agree it is a bad naming convention, a bit confusing to find a pattern, but maybe we can find a balanced solution that can work for most of the IDE users. |
a33a91f to
3ec3cce
Compare
Closes apache#9229 - additional coloring lexer fix for single quoted string with slash - adjust env file resolver to match files starting in ".env." - exclude files with lexer and errors extension from env mime type
3ec3cce to
3752cca
Compare
|
@matthiasblaesing could you help me with a feedback on the updates regarding the removal of mime-resolver.xml and correcting the mime association from files having the second element of env in their name ... to filenames starting with ".env." ? |
matthiasblaesing
left a comment
There was a problem hiding this comment.
I think this is primarly important because of the lexer fix.
The mime-resolver is broad, but non-declarative mime resolvers are checked after declarative ones, so side effects should be minimal as most normal resolvers are consulted first.
The imporant files implementation will not pick up files added after the project was loaded. Before this PR ".env" would have been resolves, that is broken by this change.
|
Ok, so I don't know if you are referring to this. |
|
Yes that is what I mean. The important files mechanism (or the support class) in the currently used form supports only a static list of files. From a quick lock a different implementation is doable, but definitely out of scope for a late PR. So I suggest to add ".env" even if is not present, that way we at least don't get a regression. I assume that only present files are actually shown. A comment should be added that documents that the implementation fails for files added inside the same session. |
|
Thank you for the observation. So, I've moved the code handling the env mime files detection in the |
|
I found other issues which are a result of how extension detection is handled. |
|
This still does not work reliably. There is no trigger for updating the file list. This code: ensures, that file events touching files with the name The code that handles that is here: and here: From my POV for this use case you'd need to create your own The problem that can be observed with the current implementation is this: I can double click on |
|
Thank you, |




Closes #9229
.env.in the filenameColoring fix for single quoted string
There was a escape done on slash inside strings, which created a small coloring issue.
Before:
After:
File association
Before:
.env.local.demowas not under env mime typeAfter:
^Add meaningful description above
Click to collapse/expand PR instructions
By opening a pull request you confirm that, unless explicitly stated otherwise, the changes -
Please make sure (eg.
git log) that all commits have a valid name and email address for you in the Author field.If you're a first time contributor, see the Contributing guidelines for more information.
If you're a committer, please label the PR before pressing "Create pull request" so that the right test jobs can run.
PR approval and merge checklist:
If this PR targets the delivery branch: don't merge. (full wiki article)