See microsoft/vscode-languageserver-node#1383 .
In language server onDefinition() is not called. According to the above issue this is because VS-Code does only call definition completion on word tokens. I would like though to also show definition completion for operators like "++" and so forth.
Would it be possible to add somehow the support to call onDefinition also on non-operators?
It would be fine enough if there is added a new language server property which allows to declare a list of tokens that should trigger definition completion although they are not text tokens. Maybe something like:
additionalDefinitionTokens = ['++', '--', '+', ... ]
3条答案
按热度按时间cs7cruho1#
你是指
ctrl+hover
吗?还是ctrl+click
?当
language-configuration.json
设置"wordPattern"
匹配时,才会调用ctrl+hover
下划线(并悬停)。默认情况下,它是\w+
。yh2wf1be2#
是的,我的意思是ctrl+悬停。
brccelvz3#
当前的cpp配置文件中,特定地忽略了所有非单词字符。在vscode/extensions/cpp/language-configuration.json文件的第27行,可以尝试修改"wordPattern",以解决这个问题。但是,
"wordPattern"
也用于符号高亮、基本的智能感知等功能。或许VSCode可以为definitionProvider()
添加一个triggerRegex
,以覆盖默认的"wordPattern"
正则表达式,就像completionProvider()
有triggerCharacters
一样。