Open sadovnychyi opened 8 years ago
I am not sure, if this is possible.
From Tern site: "Tern is a stand-alone code-analysis engine for JavaScript.". It doesn't pretend to work on other languages!
Atom has a Refactor package that aims to be language-agnostic. Eg. it requires a js-refactor package to work on JS code. Perhaps it has something for Python.
I'm not looking for a way to use rename on different languages, I want this JS related command to be hidden on different grammars. Atom does support grammar-specific commands, you just have to add specific selector for each command you create.
Ah, sorry for misunderstanding your request, which is legitimate: reduce noise. Well, I notice Tern's context menu is not there on non-JS files, for example. On the other hand, if you take a command from an official Atom package, like MarkdownPreview, it appears in the Command Palette even in non-Markdown files. So, as @tststs said, maybe it is not possible.
I do have python related "rename" command in autocomplete-python, and it does not shows this command in non-python files. As for me, this is important. Since I will never use it outside of python files.
https://github.com/sadovnychyi/autocomplete-python/blob/master/lib/provider.coffee#L113-L115
When I'm editing python file: