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
syntax: requirements: add syntax highlight code for requirements.txt files #3183
base: master
Are you sure you want to change the base?
Conversation
3cbd57e
to
307bfdd
Compare
I think it is too broad file name |
It think Pipfile.lock also one candidate for auto-detect |
The |
The file falls into the header match of json files in version 2.0.13 of the micro, micro/runtime/syntax/json.yaml Lines 3 to 5 in 68d88b5
However, in the version of the last master commit this does not happen for me, @dustdfg could you confirm this? I don't know if it would be worth opening an issue. |
Maybe something is wrong on my side but it doesn't work on my side and one more thing. Instead of |
Even with a header, detection is not done, I will look at other cases later to confirm and open an issue about it if someone doesn't do it first. But regarding the PR, I believe that adding syntaxhighlt to the python package dependency files would be very useful. Maybe one thing or another was left without highlt but once it already exists it can be improved. |
The file detection was changed with #2819. |
Ok but... It doesn't work at least for json. It isn't detected as json {
"_meta": {
"hash": {
"sha256": "d09f41c21ecfb3b019ace66b61ea1174f99e8b0da0d39e70a5c1cf2363d8b88d"
},
"pipfile-spec": 6,
"requires": {},
"sources": [
{
"name": "pypi",
"url": "https://pypi.org/simple",
"verify_ssl": true
}
]
}
} |
@dustdfg The changes to file type detection were:
Now the case in which the file name Pipfile.lock that begins the text filetype: "foo"
detect:
filename: "\\.lock$"
rules:
- include: "toml" and a syntax file like filetype: "bar"
detect:
filename: "\\.lock$"
rules:
- include: "python" In this case the file has two types, |
Well, I don't know how you came to the conclusion that it will be |
True, the file type would be Pipfile.lock will only be able to match the signature on the day that the I confess that I find the behavior of Perhaps documentation of the known scenarios in which
This is wrong, |
Here I do not fully agree. Definitely the documentation can be improved, check...nobody is perfect. Here we can only define proper |
Adding support for syntax highlighting of requirements.txt files