How can I get atom.io's “Go to Declaration” to really do that?

丶灬走出姿态 提交于 2019-12-08 14:28:03

问题


In atom.io, if I right click in "wrappedlabel" here:

<label class="wrappedlabel">"Be Kind to Animammals - Kiss a Duckbilled Platypus Today"</label>

...it teases me with "Go to Declaration"

Clicking does not take me to that class in the .css file in the project.

Is there a way to get this to actually work? If so, it would be an even sweeter suite. Having it tell me "Go to Declaration" and then leaving me hanging is better than telling me to "go to" [somewhere else], but still...


回答1:


"Go to declaration" works with symbols used in your project.

The feature requires ctags which need to be generated per project. This can be achieved with the command line or with an atom plugin (https://atom.io/packages/symbol-gen) .

You can follow this issue on github for further details




回答2:


  • In a terminal run

    apm install atom-ctags
    
  • Restart atom (sometimes twice)

  • Open a file in your project
  • Context menu - rebuild ctags
  • Go to declaration should now work for most places


来源:https://stackoverflow.com/questions/32083136/how-can-i-get-atom-ios-go-to-declaration-to-really-do-that

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!