下記の件はupdate builtin functions by cm3 · Pull Request #72 · atom/language-pythonでマージされて修正済みです
range
とか min
とか len
は色づけされているのに str
が色づけされてないのはなぜ?
atom/package.json at ecd04446434e47c505d7f1d3d8cb0fb76e91aa64 · atom/atom · GitHub に依存が書かれているlanguage-python/python.cson at master · atom/language-python · GitHubの問題だと思う。
str を検索すると、builtin_functions
ではなく、builtin_types
とmagic_function_names
に入っている。後者は正確には __str__
関数が入っているので関係ない。(行が長くて見にくいが、例えば冒頭が'match': '(?x)\\b(__(?:...
となっている)
このファイルは、syntaxes/Python.json → grammars/python.json → grammars/python.cson となっており、str の扱いに関しては initial commit language-python/Python.json at a57f00e3e42c9e73356bd25faada3e864e7bd348 · atom/language-python · GitHub から変化なく、その元は、TextMate のものだ。python.tmbundle/Python.tmLanguage at master · textmate/python.tmbundle · GitHub
そしてそのファイルの中で builtin_functions が追加されたのは* Improved handling of class/function defintions. Keywords are now mark... · textmate/python.tmbundle@29b0f6b · GitHub のコミットであり、そこにはやはり str は含まれておらず、next や print も含まれていないことやコミット日時からして python 2.5 時代のものだと推測される。ちなみに str も 2.5 では既に含まれているが。というわけで、現状の関数を元に一括追加してもいい気もする。
ちなみにユーザディレクトリ以下のAppData\Local\atom\app-0.192.0\resources\app\node_modules\language-python\grammars\python.json
にそのような変更を加えたところ問題なく起動し、期待通り動いた。
たぶんプルリク送る時間が無いけれど、Contributing to Atom見ながら時間あれば。
追記:30分後
...とか思ってたらですね、後ろでAtomがアップデートして、\resources\app\node_modules\language-python\grammars\python.json
なんて無くなったわけですよ!!!!
コマンドプロンプトから、apm install language-python
ってやると
The language-python package is bundled with Atom and should not be explicitly installed. You can run `apm uninstall language-python` to uninstall it and then the version bundled with Atom will be used. Installing language-python to C:\Users\User\.atom\packages done
文句言いながらもやってくれる。そこで、このpackages
フォルダ内のファイルを同様にいじりました。
- Add support to highlight function names by ElDeveloper · Pull Request #10 · atom/language-python いいね
- Issues · atom/language-python まだ報告はされていないみたい
- Windows環境でAtom - Qiita あ、そうか、ショートカットも使えない…!→AppData\Local\atom\bin\atom.cmd のショートカット作ればいいよ!
因みに、Community と Core で反映がずれるんだな。前者は Github の merge 後すぐに反映された。