tststs / atom-ternjs

JavaScript code intelligence for atom with tern.js and autocomplete-plus
MIT License
627 stars 76 forks source link

Do not show Rename command on grammrs other from javascript #196

Open sadovnychyi opened 8 years ago

sadovnychyi commented 8 years ago

When I'm editing python file: image

tststs commented 8 years ago

I am not sure, if this is possible.

PhiLhoSoft commented 8 years ago

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.

sadovnychyi commented 8 years ago

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.

PhiLhoSoft commented 8 years ago

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.

sadovnychyi commented 8 years ago

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