Add new filetype extensions: - .babelrc -> JSON - .editorconfig -> Conf - Pipfile -> Conf - Pipfile.lock -> JSON - *.toml -> Conf - *.vue -> HTML You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/1720
-- Commit Summary --
* Add new filetype extensions
-- File Changes --
M data/filetype_extensions.conf (6)
-- Patch Links --
https://github.com/geany/geany/pull/1720.patch https://github.com/geany/geany/pull/1720.diff
I think you need to show that the filenames/extensions are in pretty common use for that fieltype, unusual ones shouldn't be added to the system filetype. Instead the intention is that the user can edit their own filetypes.extensions to add specific ones.
[TOML](https://github.com/toml-lang/toml) seems OK to me as it's a general purpose config format that's not language or framework-specific.
The others seem a bit esoteric to me.
It's the other way around. Files with those names and extensions are expected to have specific formats. If associated tools popularity amongst developers is is what you mean, then I don't have statistics about that. If GitHub stars of these tools are to be considered, then it would be (at the time of writing): - .babelrc -> [24,702](/babel/babel) - .editorconfig -> [1,259](/editorconfig/editorconfig) - Pipfile -> [6,272](/pypa/pipenv) - Pipfile.lock -> [6,272](/pypa/pipenv) - *.toml -> [6,737](/toml-lang/toml) - *.vue -> [76,938](/vuejs/vue)
IMHO, if a file is expected to have specific format, it can safely be added to default format list. It improves user experience too, btw.
@0rzech you might do better if you made proper links to the applications that use those extensions/files. Not sure what most of them are hence the query of why they should be added. The only well known one is TOML as @codebrainz noted.
@elextr I have already linked repositories with applications and libraries which use those extensions. Just click on each star count.
@0rzech those links only work in github, thats why I said "proper" links.
AFAICT :
`.babelrc` is the initialisation file for a particular application, not a language filetype
`.editorconfig` is a config file that does not work (last time I heard) with Geany, so it would be kind of confusing to add it to the extensions.
Json5 is a non-standard extension of json, how well is it supported by the JS in Geany?
`Pipfile` and `Pipfile.lock` are certainly part of the Pipenv tool mentioned from Python.org, but IIUC they are not user edited files, pipenv manages them, so the few people who want/need to directly edit them can add to their personal `filetypes.extensions`.
TOML as noted above is a language so appropriate for a filetype, though maybe it could have its own custom filetype.
`.vue` is a particular JS framework, not a language of its own, so people who use that framework can add it to their own `filetypes.extensions`.
@elextr
those links only work in github, thats why I said "proper" links.
I had no chance to deduce that.
.babelrc is the initialisation file for a particular application, not a language filetype
I don't see the problem. It is formatted in `JSON5` and I would expect Geany to properly handle that fact by default.
.editorconfig is a config file that does not work (last time I heard) with Geany, so it would be kind of confusing to add it to the extensions.
It is formatted in `TOML` and I would expect Geany to properly handle that fact by default as well. I can edit such file for other collaborators in my project, who don't happen to use Geany.
Json5 is a non-standard extension of json, how well is it supported by the JS in Geany?
It is a strict subset of JS, as written in repository I gave you link to.
Pipfile and Pipfile.lock are certainly part of the Pipenv tool mentioned from Python.org, but IIUC they are not user edited files, pipenv manages them, so the few people who want/need to directly edit them can add to their personal filetypes.extensions.
`Pipfile` is definitely to be edited by humans. It's just that command line tool is able to edit it as well. `Pipfile.lock` is indeed generated automatically, but when opened for inspection in Geany, it is unnecessarily raw, even though being written in JSON format.
TOML as noted above is a language so appropriate for a filetype (...)
.vue is a particular JS framework, not a language of its own, so people who use that framework can add it to their own filetypes.extensions.
If something is JSON, then it should be considered JSON by editor. Same for other file types. This is what extension system is for, so that we can pin different extensions to the same file type.
This division to "languages" and "non-languages" seems artificial and harmful. Managing file types by hand is tedious and unnecessary. If a file is known to be of particular type, why not associate it with that type by default?
@elextr
those links only work in github, thats why I said "proper" links.
I'm sorry, but I had no chance to deduce that.
.babelrc is the initialisation file for a particular application, not a language filetype
I don't see the problem. It is formatted in `JSON5` and I expect editor to properly handle that fact by default.
.editorconfig is a config file that does not work (last time I heard) with Geany, so it would be kind of confusing to add it to the extensions.
It is formatted in `TOML` and I expect editor to properly handle that fact by default as well. I can edit such file for other collaborators in my project, who don't happen to use Geany.
Json5 is a non-standard extension of json, how well is it supported by the JS in Geany?
It is a strict subset of JS, as written in repository I gave you link to.
Pipfile and Pipfile.lock are certainly part of the Pipenv tool mentioned from Python.org, but IIUC they are not user edited files, pipenv manages them, so the few people who want/need to directly edit them can add to their personal filetypes.extensions.
`Pipfile` is definitely to be edited by humans. It's just that command line tool is able to edit it as well. `Pipfile.lock` is indeed generated automatically, but when opened for inspection in Geany, it is unnecessarily raw, even though being written in JSON format.
TOML as noted above is a language so appropriate for a filetype (...)
.vue is a particular JS framework, not a language of its own, so people who use that framework can add it to their own filetypes.extensions.
If something is JSON, then it should be considered JSON by editor. Same for other file types. This is what extension system is for, so that we can pin different extensions to the same file type.
This division to "languages" and "non-languages" seems artificial and harmful. Managing file types by hand is tedious and unnecessary. If a file is known to be of particular type, why not associate it with that type by default?
This division to "languages" and "non-languages" seems artificial and harmful. Managing file types by hand is tedious and unnecessary. If a file is known to be of particular type, why not associate it with that type by default?
Yes the division is artificial, and it would be great to add everything from every application to the extensions, but its not a no-cost exercise. Each pattern in the extensions list has to be tested against the filename when opening every file that can't have its filetype determined from contents (which is most of them). For each individual filename pattern that is added for every application, all the users who did NOT use that application still pay the cost to check the pattern. There are thousands (maybe slight exaggeration :) of JS frameworks and Python frameworks and other applications and so on. I would prefer to discriminate against them ALL rather than have to pick winners to keep the costs of the extensions checks in control, and not have all users (especially me:) pay the cost for tons of stuff they don't use.
Also some notes on the ones that are possible filetypes:
TOML is not currently a Geany filetype, how well the `.conf` filetype (which is essentially Windows `.ini` format) will handle it is unknown but its probably the closest. So expecting it to work may be disappointing.
Your JSON5 filetype specifies a json5 tag parser that does not exist in Geany.
I don't know if the lexer for JS is JS5, and there is no json5 tag parser, thats why I asked about how well JSON5 will work. Again expecting it to work may be disappointing.
In both the cases above adding extensions that don't map to filetypes that work well is making a promise that can't be kept, and just causes user frustration and bug reports that can't be fixed.
@elextr I understand your concerns. Well, maybe the regex cost seems a bit exaggerated. ;) Or maybe regex could be replaced with some `ends_with` equivalent to compare speeds? In any case, I'm closing this PR.
Closed #1720.
@0rzech its actually a file glob, not a regex, and I would expect the time is more likely spent in compiling the pattern, not matching it, since its normal use is against directories full of files not one at a time like this use. Sure its exaggerated to worry about one, ten, 100 but where to stop? And as I said picking favourites is probably not something Geany should do.
Its a glob, not `ends_with`, because some patterns are not actually extensions, eg `makefile.*`
@elextr Please do not call these "favourites", because they are not that and I've never used such argument.
Pipenv is
the officially recommended Python packaging tool from [Python.org](https://packaging.python.org/tutorials/managing-dependencies/#managing-depen...) [[source](/pypa/pipenv/blob/master/README.rst)]
EditorConfig aims at helping
developers define and maintain consistent coding styles between different editors and IDEs. [[source](http://editorconfig.org/)]
JSON5 and TOML are filetypes of their own. All of these are hardly my personal favourites or something.
The only file types being framework-dependent are those from Vue.js and Babel, two projects several dozen times more popular on GitHub than Geany itself. Again, not a matter of some kind of personal preference.
Besides, I already wrote I understand your arguments. The "glob" one just looks like premature optimization in the form of not adding these types, because in the future performance may drop, but it's not my project and I'm not forcing anything. As you can see, the PR is already closed.
I hope you won't mind if I refrained from further discussion. Case is closed and it makes no sense to spend any more time on it. ;)
PS. I didn't spot those `makefile.*` entries earlier.
@elextr Please do not call these "favourites", because they are not that and I've never used such argument.
Pipenv is
the officially recommended Python packaging tool from [Python.org](https://packaging.python.org/tutorials/managing-dependencies/#managing-depen...) [[source](/pypa/pipenv/blob/master/README.rst)]
EditorConfig aims at helping
developers define and maintain consistent coding styles between different editors and IDEs. [[source](http://editorconfig.org/)]
JSON5 and TOML are filetypes of their own. All of these are hardly my personal favourites or something.
The only file types being framework-dependent are those from Vue.js and Babel, two projects several dozen times more popular on GitHub than Geany itself. Again, not a matter of some kind of personal preference.
Besides, I already wrote I understand your arguments. The "glob" one just looks like premature optimization in the form of not adding these types, because in the future performance may drop, but it's not my project and I'm not forcing anything. As you can see, the PR is already closed.
I hope you won't mind if I refrained from further discussion. Case is closed and we're better off spending time on something else. ;)
PS. I didn't spot those `makefile.*` entries earlier.
@elextr Please do not call these "favourites", because they are not that and I've never used such argument.
Pipenv is
the officially recommended Python packaging tool from [Python.org](https://packaging.python.org/tutorials/managing-dependencies/#managing-depen...) [[source](/pypa/pipenv/blob/master/README.rst)]
EditorConfig aims at helping
developers define and maintain consistent coding styles between different editors and IDEs. [[source](http://editorconfig.org/)]
JSON5 and TOML are file types of their own. All of these are hardly my personal favourites or something.
The only file types being framework-dependent are those from Vue.js and Babel, two projects several dozen times more popular on GitHub than Geany itself. Again, not a matter of some kind of personal preference.
Besides, I already wrote I understand your arguments. The "glob" one just looks like some premature optimization in the form of not adding these types, because in the future performance may drop, but it's not my project and I'm not forcing anything. As you can see, the PR is already closed.
I hope you won't mind if I refrained from further discussion. Case is closed and we're better off spending time on something else. ;)
PS. I didn't spot those `makefile.*` entries earlier.
@elextr Please do not call these "favourites", because they are not that and I've never used such argument.
Pipenv is
the officially recommended Python packaging tool from [Python.org](https://packaging.python.org/tutorials/managing-dependencies/#managing-depen...) [[source](/pypa/pipenv/blob/master/README.rst)]
EditorConfig aims at helping
developers define and maintain consistent coding styles between different editors and IDEs. [[source](http://editorconfig.org/)]
JSON5 and TOML are file types of their own. All of these are hardly my personal favourites or something.
The two remaining files are those from Vue.js and Babel projects, both several dozen times more popular on GitHub than Geany itself. Again, not a matter of some kind of personal preference.
Besides, I already wrote I understand your arguments. The "glob" one just looks like some premature optimization in the form of not adding these types, because in the future performance may drop, but it's not my project and I'm not forcing anything. As you can see, the PR is already closed.
I hope you won't mind if I refrained from further discussion. Case is closed and we're better off spending time on something else. ;)
PS. I didn't spot those `makefile.*` entries earlier.
Not intending to reopen the discussion, but just to note you have misunderstood my use of "choosing favourites", if Geany added one framework and then refused another it would be the __project__ choosing its favourite, which is something the project should not do as it may be taken as an endorsement of one over another.
Ok, got it. You're affraid of having `.babelrc`, `.anotherrc`, `.somethingelserc`, `.metoorc` etc. Perhaps it is better to leave it as is then.
Ok, got it. You're affraid of having something like `.babelrc`, `.anotherrc`, `.somethingelserc`, `.metoorc` etc. Perhaps it is better to leave it as is then. ;)
Ok, got it. You're affraid of ending up with something like `.babelrc`, `.anotherrc`, `.somethingelserc`, `.metoorc` etc. Perhaps it is better to leave it as is then. ;)
Thanks for clarification and Merry Christmas!
Yes, exactly, sorry previous explanations were not clear, and seasons greetings as well.
github-comments@lists.geany.org