execjosh / atom-file-types Goto Github PK
View Code? Open in Web Editor NEWSpecify additional file types for languages.
Home Page: https://atom.io/packages/file-types
License: MIT License
Specify additional file types for languages.
Home Page: https://atom.io/packages/file-types
License: MIT License
Hi,
I was just wondering how I could apply JSON file type to all ".{something}rc" files. (Except from manually chosing it each time.)
For example:
Are they recognized as babelrc type, or without type ?
Thank you for your help.
atom.workspaceView is no longer available.
In most cases you will not need the view. See the Workspace docs for
alternatives: https://atom.io/docs/api/latest/Workspace.
If you do need the view, please use atom.views.getView(atom.workspace)
,
which returns an HTMLElement.
Atom.Object.defineProperty.get (~\AppData\Local\atom\app-0.179.0\resources\app\src\atom.js:54:11)
Object.activate (~\.atom\packages\file-types\lib\file-types.coffee:24:20)
Hi,
I just updated my OS and after restarting I got this error.
Atom Version: 0.190.0
System: Mac OS X 10.10.3
Thrown From: file-types package, v0.3.0
Failed to activate the file-types package
At undefined is not a function
TypeError: undefined is not a function
at /Users/andreaascari/.atom/packages/file-types/lib/file-types.coffee:25:33
at Config.module.exports.Config.observeKeyPath (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app/src/config.js:544:7)
at Config.module.exports.Config.observe (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app/src/config.js:126:21)
at Object.module.exports.activate (/Users/andreaascari/.atom/packages/file-types/lib/file-types.coffee:21:34)
at Package.module.exports.Package.activateNow (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app/src/package.js:225:19)
at /opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app/src/package.js:206:30
at Package.module.exports.Package.measure (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app/src/package.js:152:15)
at Package.module.exports.Package.activate (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app/src/package.js:199:14)
at PackageManager.module.exports.PackageManager.activatePackage (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app/src/package-manager.js:435:21)
at /opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app/src/package-manager.js:419:29
{
"core": {
"themes": [
"one-dark-ui",
"solarized-dark-syntax"
],
"disabledPackages": [
"symbols-view"
]
},
"file-types": {
"variables": "source.css.less",
"overrides": "source.css.less"
}
}
# User
atom-ctags, v2.6.1
autocomplete-plus, v2.11.0
color-picker, v1.7.0
file-type-icons, v0.5.4
file-types, v0.3.0
language-scala, v1.1.0
linter, v0.12.0
linter-less, v0.3.1
linter-scalac, v0.3.3
minimap, v4.7.6
vim-mode, v0.44.0
# Dev
No dev packages
Thanks in advantage.
So I have the following in my config.cson
"file-types":
"jsx(inc)?$": "source.js"
"style": "source.shell"
but it doesn't seem to work at all; jsx
still open as plain text.
Also, it often randomly removes quotes also like this
"file-types":
"jsx(inc)?$": "source.js"
style: "source.shell"
What could be the problem?
My company uses .PRC or .prc to denote SQL stored procedures, but the casing is not consistent. If I put in
PRC: "source.sql"
Then it works for .PRC files but not .prc
If I put in
PRC: "source.sql"
prc: "source.sql"
Then it works for neither .PRC or .prc
What's the easiest way to find where, by default, file extensions are associated to a grammar file name?
To be honest, all I want to know is what the heck is the grammar file name for Github flavored markdown...I'm trying to do something like this:
"file-types":
"html.md.erb": "text.github-markdown" # this doesn't work..what name should I use instead?
But I should probably know more of the internals of the Atom system :)
Make a namespace for matchers.
e.g.
"file-types":
"debug": false
"patterns":
"ex_em_el": "text.xml"
Is it possible to support the following:
for e.g:
'file-types':
'css.liquid': 'source.css'
'scss.liquid': 'source.css.scss'
'liquid': 'text.html.basic'
Currently, with the above setting, files ending in .css.liquid and .scss.liquid will show up as HTML. I'm guessing this is because the final line overrides the previous.
Here's my config:
'file-types':
'cjsx': 'cjsx.coffee'
cjsx files are still rendered as plaintext.
Relevant issue in sync-settings: Broken settings on restore when using a . in property names #358
Seems that dot is used internally to separate config value paths, which causes certain filename matchers to break.
From config.cson
"file-types":
html: "text.html.js"
"^[^\\.]+$": "source.shell" (A: Original regex, doesn't work)
"^[\\w\\d\\-_]+$": "source.shell" (B: New regex, works)
I noticed this when config.cson kept breaking after sync when I used regex A. After switching to regex B everything works as expected.
Can't really say what should be done to maximize compatibility, but I thought you'd like to be informed.
Hello!
I'm trying to do this association but have no idea what is going wrong. My config:
"file-types":
'_spec\.rb$': 'source.rspec'
rb: "source.ruby"
Any suggestions?
what would the pattern be to match these files? I can't seem to get any to work. They do not have extensions.
Dockerfile-one
Dockerfile-two
I have tried this: "^Dockerfile*$": "source.dockerfile"
In the next release of Atom (v0.166), the scope names for C++ and Objective-C++ will change from source.c++
and source.objc++
to source.cpp
and source.objcpp
. This is being done to work around some issues with CSS classes containing '+' characters. You may want to update your README with the new scopes. I thought I'd leave it to you rather than submit a PR because I'm not sure if you want to mention the old scope names for backward-compatibility purposes or not.
Thanks for maintaining this package!
Refs atom/language-c#54.
Hi,
I'm trying to customize how Atom matches my Ansible files.
In my config.cson I have this, but it doesn't work at all.
Is there something that I'm missing?
"file-types":
".*/*_vars/.*.yml$": "source.ansible"
".*/.*ansible.*/.*.yml$": "source.ansible"
".*/ansible.cfg$": "source.ansible"
".*/environments/.*.yml$": "source.ansible"
".*/group_vars/.*": "source.ansible"
".*/host_vars/.*": "source.ansible"
".*/hosts$": "source.ansible"
".*/roles/.*.yml$": "source.ansible"
".*/tasks/.*.yml$": "source.ansible"
Why the example is bad? Because 'text.html.htmlbars' not exists in most atom.
Use 'string(or something else)': 'text.html.basic'
shuold be better.
Could you add support for conky's in your future development
.conkyrc
Thanks
erik
Use a config schema instead. See the configuration section
of https://atom.io/docs/latest/hacking-atom-package-word-count and
https://atom.io/docs/api/latest/Config for more details
Package.activateConfig (/usr/share/atom/resources/app.asar/src/package.js:247:11)
Package.activateNow (/usr/share/atom/resources/app.asar/src/package.js:218:14)
<unknown> (/usr/share/atom/resources/app.asar/src/package.js:203:30)
Package.measure (/usr/share/atom/resources/app.asar/src/package.js:147:15)
Forgive me if this functionality already exists and I just don't understand how I would go about it utilizing it.
I am using Ansible and some of the files are in Ansible's YAML format, but do not have an extension or I do not want it to default to using the base YAML syntax.
I am basically looking for the functionality that exists in the ApplySyntax plugin for Sublime. A direct example would be: http://jamie.ideasasylum.com/2014/08/ansible-syntax-highlighting-sublime/
Is this currently possible with this package? If so, how would I go about duplicating the settings as depicted in that link?
I've tried to hack your plugin match anything at the end of a file path, but my coffeescript/nodejs chops are very basic. How would you go about handling a cucumber step file whose file extension is unconventional?
For example, file_name_steps.rb
OS: Ubuntu 14.04
If I then set the grammar by hand, close the file, then re-open, the syntax is highlighted corrently (for the single file).
So basicly, I have to reload the editor or manually set the grammar in order to fix the problem every time I open a file I've not previously opened via CTRL-P.
Use Workspace::getTextEditors instead
Workspace.getEditors (/Users/willkd9/Applications/Atom.app/Contents/Resources/app.asar/src/workspace.js:977:7)
<unknown> (/Users/willkd9/.atom/packages/file-types/lib/file-types.coffee:21:6)
Config.observeKeyPath (/Users/willkd9/Applications/Atom.app/Contents/Resources/app.asar/src/config.js:555:7)
Config.observe (/Users/willkd9/Applications/Atom.app/Contents/Resources/app.asar/src/config.js:135:21)
Object.activate (/Users/willkd9/.atom/packages/file-types/lib/file-types.coffee:19:27)
Package.activateNow (/Users/willkd9/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:238:19)
atom.workspaceView is no longer available.
In most cases you will not need the view. See the Workspace docs for
alternatives: https://atom.io/docs/api/latest/Workspace.
If you do need the view, please use atom.views.getView(atom.workspace)
,
which returns an HTMLElement.
Atom.Object.defineProperty.get (/Applications/Atom.app/Contents/Resources/app/src/atom.js:54:11)
Object.activate (/Users/vaeum/.atom/packages/file-types/lib/file-types.coffee:24:20)
Users will need to escape dots (i.e., .
should become \\.
).
atom.workspaceView is no longer available.
In most cases you will not need the view. See the Workspace docs for
alternatives: https://atom.io/docs/api/latest/Workspace.
If you do need the view, please use atom.views.getView(atom.workspace)
,
which returns an HTMLElement.
Atom.Object.defineProperty.get (/Applications/Atom.app/Contents/Resources/app/src/atom.js:55:11)
Object.activate (/Users/vaeum/.atom/packages/file-types/lib/file-types.coffee:24:20)
This is the output from deprecation-cop:
Arguments to path.basename
must be strings
path.basename (/usr/share/atom-beta/resources/app.asar/src/electron-shims.js:31:10)
Object._tryToSetGrammar (/home/duncan/.atom/packages/file-types/lib/file-types.coffee:118:18)
<unknown> (/home/duncan/.atom/packages/file-types/lib/file-types.coffee:87:24)
<unknown> (/usr/share/atom-beta/resources/app.asar/src/workspace.js:334:16)
Function.module.exports.Emitter.simpleDispatch (/usr/share/atom-beta/resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
Emitter.emit (/usr/share/atom-beta/resources/app.asar/node_modules/event-kit/lib/emitter.js:129:28)
Use TextEditor::onDidChangePath instead
TextEditor.on (/Users/willkd9/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:2978:11)
<unknown> (/Users/willkd9/.atom/packages/file-types/lib/file-types.coffee:27:24)
WorkspaceView.eachEditorView (/Users/willkd9/Applications/Atom.app/Contents/Resources/app.asar/src/workspace-view.js:90:9)
Object.activate (/Users/willkd9/.atom/packages/file-types/lib/file-types.coffee:24:34)
Package.activateNow (/Users/willkd9/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:238:19)
<unknown> (/Users/willkd9/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:219:30)
The atom.syntax global is deprecated. Use atom.grammars instead.
Atom.Object.defineProperty.get (~\AppData\Local\atom\app-0.179.0\resources\app\src\atom.js:320:11)
Object.activate (~\.atom\packages\file-types\lib\file-types.coffee:32:20)
After I installed this package, I closed and restarted many times but the package name did not appear in the Packages Tab and everywhere else.
For example, you can associate .ex_em_el with text.xml in your config.cson as follows:
'file-types': 'ex_em_el': 'text.xml'
huh? does this associate an imaginary syntax called 'ex_em_el' with a single file called .xml
? Or does it make the .ex_em_el extension open as if it's a file called text.xml
? In which case what's the text.
for? sorry if I'm being dumb, I just want to make atom interpret the extension .extra
as a shell script
Call GrammarRegistry::onDidAddGrammar instead
GrammarRegistry.on (/Users/willkd9/Applications/Atom.app/Contents/Resources/app.asar/node_modules/first-mate/lib/grammar-registry.js:213:16)
Object.activate (/Users/willkd9/.atom/packages/file-types/lib/file-types.coffee:32:27)
Package.activateNow (/Users/willkd9/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:238:19)
<unknown> (/Users/willkd9/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:219:30)
Package.measure (/Users/willkd9/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:163:15)
Package.activate (/Users/willkd9/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:211:14)
30ms
is unusually long, considering my other packages range from 1ms
to 5ms
.
#47 introduced a warning that could be pretty annoying for people who just want to stay as-is for the time-being.
Trying to figure out what goes on the right side of the matcher ... is there a list of all filetypes for Atom?
I assume I'm just misunderstanding how to configure this plugin, but just in case, I add the following to my config.cson
:
'*':
...
'file-types':
'dhtml': 'text.html.django'
This appears to have no impact: atom continues to open *.dhtml
files as plaintext.
The text.html.django
scope is indeed in the list when I run Object.keys(atom.syntax.grammarsByScopeName).sort().join('\n')
from the console.
I'm using file-types
version 0.3.0
and atom
version 0.170.0
.
Note: A subset of this functionality is now available directly in Atom--see Customizing Language Recognition in the Flight Manual.
just a thanks.
QUESTIONS for the COMMUNITY
What say ye?
"I'm verklempt. Speak amongst yourselves."
My thoughts:
Atom will no longer load this package after June 1st without changes. There are a couple deprecations on the latest version (0.3.0
) of this package:
atom.views.getView(atom.workspace)
, which returns an HTMLElement.Visit https://gist.github.com/benogle/6d09e295c84b717ef9b4 and search for your package name to see up-to-date deprecations.
If this package has been replaced by another package or functionality in core, please reply with this information.
See atom/atom#6867 for more info. Thanks!
It's seems that only work if I have the html tag. How can I use only php code like:
$var = 1;
var_dump($var);
The atom.syntax global is deprecated. Use atom.grammars instead.
Atom.Object.defineProperty.get (/Applications/Atom.app/Contents/Resources/app/src/atom.js:325:11)
Object.activate (/Users/vaeum/.atom/packages/file-types/lib/file-types.coffee:32:20)
It's hard to reproduce; but, there are some instances where a grammar cannot be gotten. This looks to be an issue where the logic is run before the grammars have actually been loaded.
The atom.syntax global is deprecated. Use atom.grammars instead.
Atom.Object.defineProperty.get (/Applications/Atom.app/Contents/Resources/app/src/atom.js:316:11)
Object.activate (/Users/vaeum/.atom/packages/file-types/lib/file-types.coffee:32:20)
the syntax for in ~/.atom/config.cson
seems to have changed slightly (is this maybe new in atom 1.0?). taking the example given for .ex_em_el
files should be:
"file-types":
ex_em_el: "text.xml"
Thanks for the package! Very usefull when working with lots of custom file extentions!
Non-functional code in config.cson:
"*":
"file-types":
jhtml: "text.html"
I have atom 1.0.0, and file-types 0.4.1. my config file looks like this:
"*":
"file-types":
".launch": "text.xml"
".xacro": "text.xml"
".urdf": "text.xml"
".gazebo": "text.xml"
"exception-reporting":
userId: "c859a6a7-7ce0-1619-7719-08d25700646d"
welcome:
showOnStartup: false
editor:
fontSize: 12
invisibles: {}
core: {}
These extensions are not showing up as xml in atom.
Atom Version: 0.190.0
System: Mac OS X 10.10.2
Thrown From: file-types package, v0.3.0
Failed to activate the file-types package
At undefined is not a function
TypeError: undefined is not a function
at /Users/peter/.atom/packages/file-types/lib/file-types.coffee:25:33
at Config.module.exports.Config.observeKeyPath (/Applications/Atom.app/Contents/Resources/app/src/config.js:544:7)
at Config.module.exports.Config.observe (/Applications/Atom.app/Contents/Resources/app/src/config.js:126:21)
at Object.module.exports.activate (/Users/peter/.atom/packages/file-types/lib/file-types.coffee:21:34)
at Package.module.exports.Package.activateNow (/Applications/Atom.app/Contents/Resources/app/src/package.js:225:19)
at /Applications/Atom.app/Contents/Resources/app/src/package.js:206:30
at Package.module.exports.Package.measure (/Applications/Atom.app/Contents/Resources/app/src/package.js:152:15)
at Package.module.exports.Package.activate (/Applications/Atom.app/Contents/Resources/app/src/package.js:199:14)
at PackageManager.module.exports.PackageManager.activatePackage (/Applications/Atom.app/Contents/Resources/app/src/package-manager.js:435:21)
at /Applications/Atom.app/Contents/Resources/app/src/package-manager.js:419:29
{
"core": {
"disabledPackages": [
"package-generator",
"metrics",
"feedback",
"deprecation-cop",
"background-tips",
"linter-flake8",
"terminal-panel",
"autocomplete-plus-jedi",
"tabs",
"tree-view"
],
"projectHome": "/Users/peter/Documents/Workspace",
"audioBeep": false,
"themes": [
"unity-ui",
"atom-dark-syntax"
]
},
"file-types": {
"html": "text.html.jinja"
}
}
# User
atom-jinja2, v0.5.0
autoclose-html, v0.15.0
autocomplete-plus, v2.9.0
autocomplete-plus-python-jedi, v0.2.5
file-types, v0.3.0
linter, v0.12.0
linter-pep8, v0.1.0
project-manager, v1.15.5
sublime-tabs, v0.5.2
unity-ui, v2.0.5
# Dev
No dev packages
Hello,
the following command:
console.log(Object.keys(atom.grammars.grammarsByScopeName).sort().join("\n"))
raises the following error:
VM1337:1 Uncaught TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at <anonymous>:1:20
I had some luck with this command:
console.log(Object.keys(atom.grammars.textmateRegistry.grammarsByScopeName).sort().join("\n"))
file-types plugin is really usful for me. Thank you :)
But mostly, probably when start or terminate Atom or open setting screen,
my file-types rules will be overwritten.
I'm using regexp rule that will be disabled if order is changed.
Like this diff:
@@ -18,15 +18,22 @@
"file-types":
- ct: "source.sql"
- ".sql.job$": "source.sql"
".job$": "source.yaml"
+ ".sql.job$": "source.sql"
+ ct: "source.sql"
So can I avoid auto rewrite/format of rules ?
i'd like to open kit files in atom and have them render as HTML, don't think i set it up right in my config.cson file
'file-types':
'.kit': '.html'
Hi could you please add installation note.
I tried installing apm install atom-file-types.It doesn't install.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.