Giter VIP home page Giter VIP logo

atom-file-types's People

Contributors

execjosh avatar holyjak avatar in-in avatar knuthelland avatar samselikoff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

atom-file-types's Issues

What would be the rule for a .babelrc + json file ?

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:

  • .babelrc
  • .eslintrc
  • .remarkrc

Are they recognized as babelrc type, or without type ?
Thank you for your help.

Atom.Object.defineProperty.get is deprecated.

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)

Failed to activate the file-types package

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

Stack Trace

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

Commands

Config

{
  "core": {
    "themes": [
      "one-dark-ui",
      "solarized-dark-syntax"
    ],
    "disabledPackages": [
      "symbols-view"
    ]
  },
  "file-types": {
    "variables": "source.css.less",
    "overrides": "source.css.less"
  }
}

Installed Packages

# 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.

config not working at all

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?

Make option for case sensitivity

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

How to get list of current assignments of file-type extension to grammars?

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 :)

Add tie-breaker logic for similar extensions

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.

Matchers with a . break when restoring settings with sync-settings

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.

Associate '_spec.rb' with RSpec

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?

unable to match a file without an extension

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"

Scopes for C++ and Objective-C++ are changing

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.

Am I doing something wrong?

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"

Good plugin, bad example.

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.

Request : conkyrc

Could you add support for conky's in your future development

.conkyrc

Thanks
erik

Package.activateConfig is deprecated.

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)

Match against whole path instead of only basename

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?

Cucumber step files

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

Plugin fails to apply configured syntax highlighting when opening files via CTRL-P

OS: Ubuntu 14.04

  1. CTRL-P
  2. Find a file you've not opened during the session
  3. Custom syntax highlighting is not working according to configuration

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.

Workspace.getEditors is deprecated.

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.Object.defineProperty.get is deprecated.

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)

Atom.Object.defineProperty.get is deprecated.

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)

path.basename is deprecated.

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)

TextEditor.on is deprecated.

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)

Atom.Object.defineProperty.get is deprecated.

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)

nothing works

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.

Readme is very confusing

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

GrammarRegistry.on is deprecated.

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)

Slow startup

30ms is unusually long, considering my other packages range from 1ms to 5ms.

File type configuration is ignored.

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.

Bash-like Globbing

QUESTIONS for the COMMUNITY

What say ye?

  • Is RegExp overkill?
  • Would bash-like globbing be a better way to configure your file types?
  • How could we transition from the current way of configuring?

"I'm verklempt. Speak amongst yourselves."


My thoughts:

  • Bash-like globbing is simple
  • It is easy and familiar to specify and understand
  • A breaking change is probably fine as long as most people know about it ahead of time
    • Need some kind of notification inside the package, probably

Deprecated Atom APIs will be removed June 1st

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:

  1. 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.
  2. 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
  3. Use Workspace::getTextEditors instead
  4. Call GrammarRegistry::onDidAddGrammar instead
  5. The atom.syntax global is deprecated. Use atom.grammars instead.
  6. Use TextEditor::onDidChangePath instead
  7. Use Workspace::onDidAddTextEditor instead

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!

text.html.php

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);

Atom.Object.defineProperty.get is deprecated.

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)

Atom.Object.defineProperty.get is deprecated.

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)

syntax config.cson

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!

xml syntax colouring not changing

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.

Failed to activate the file-types package

  1. Update from 0.189 to 0.190

Atom Version: 0.190.0
System: Mac OS X 10.10.2
Thrown From: file-types package, v0.3.0

Stack Trace

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

Commands

Config

{
  "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"
  }
}

Installed Packages

# 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

Extensions listing command raises an error

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"))
  • OS: Linux
  • Atom: 1.26.1

Can I avoid auto rewrite/format of rules ?

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 ?

Kit files

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'

How to install it.

Hi could you please add installation note.
I tried installing apm install atom-file-types.It doesn't install.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.