0

In VSCode you can ctrl-click some word, like types and variables names, and it will underline the word while hovering, and then go to the definition when you click.

How does it decide which words are clickable?

Timmmm
  • 88,195
  • 71
  • 364
  • 509
  • 1
    Any function, object, variable, that has been defined is clickable, normal strings, numbers etc which do not have any reference aren't clickable – tHeSiD Jun 17 '20 at 13:27
  • Decided by whether definition providers give results, https://code.visualstudio.com/api/references/vscode-api#DefinitionProvider – Lex Li Jun 17 '20 at 13:45
  • @tHeSiD: Yes but the question is how does VSCode decide which bits of text *are* functions, objects or variables? – Timmmm Jun 17 '20 at 15:44
  • @LexLi: I don't think that can be right - Go To Definition takes way longer than the underline hover. – Timmmm Jun 17 '20 at 15:46
  • Actually, it does seem determined by whether or not you return `null`. But then I don't understand how it is able to underline everything quickly in Rust for example, but when you actually click it it takes several seconds to find the definition. – Timmmm Jun 17 '20 at 16:05
  • @Timmmm you can read how the language server in vscode works, that is the one deciding the semantics https://code.visualstudio.com/api/language-extensions/overview – tHeSiD Jun 17 '20 at 17:03
  • Yeah it doesn't say unfortunately. – Timmmm Jun 17 '20 at 19:02

0 Answers0