Html 我怎样才能让 atom.io 的“转到声明”真正做到这一点?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32083136/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 18:06:00  来源:igfitidea点击:

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

htmlcssatom-editor

提问by B. Clay Shannon

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

在 atom.io 中,如果我在此处右键单击“wrappedlabel”:

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

单击不会将我带到项目中 .css 文件中的那个类。

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

有没有办法让它真正起作用?如果是这样,那将是一个更甜蜜的套房。让它告诉我“去宣言”然后让我悬着比告诉我“去”[其他地方]要好,但仍然......

采纳答案by Richard Dev

"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) .

该功能需要每个项目都需要生成的 ctags。这可以通过命令行或 atom 插件 ( https://atom.io/packages/symbol-gen) 来实现。

You can follow thisissue on github for further details

您可以在 github 上关注问题以获取更多详细信息

回答by Richard

  • 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
  • 在终端运行中

    apm install atom-ctags
    
  • 重启原子(有时两次)

  • 在你的项目中打开一个文件
  • 上下文菜单 - 重建 ctags
  • 转到声明现在应该适用于大多数地方