新编辑器API中的FileCodeModel [英] FileCodeModel in the new editor API

查看:92
本文介绍了新编辑器API中的FileCodeModel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我一直在尝试获取与下拉栏中显示的用户当前上下文位置相似的信息。让我们说插入符号位于命名空间C.D {}的方法A()中,我希望得到该信息。我们无法找到
如何直接访问该信息。

I have been trying to get similar information to what it is shown in the drop-down bar about the current context position of the user. Lets say the caret is in method A() of class B {} of namespace C.D {} I want to get that information. We couldnt find how to access that information directly.

我们尝试使用   FileCodeModel( http://msdn.mic rosoft.com/en-us/library/envdte.filecodemodel.codeelementfrompoint.aspx
但是当你没有选择要找到的正确组时抛出的ComException非常烦人并调试地狱(你不知道哪个是真正的ComException'以及那个方法抛出的那个)。

We tried using the CodeElementFromPoint method of the FileCodeModel (http://msdn.microsoft.com/en-us/library/envdte.filecodemodel.codeelementfrompoint.aspx) but the ComException thrown when you dont select the proper group to find is very annoying and makes debugging hell (you dont know which are real ComException' and which ones are thrown by that method).

我们尝试使用CodeElement上的二进制搜索来重新实现该代码,但对于大文件,它对于我们的目的来说仍然太慢(对于1400行文件平均为152ms) 。使用新的编辑器API有没有办法做到这一点?如何访问
编译器AST或其中间表示? 

We tried to reimplement that code using a binary search over the CodeElement but for big files it is still too slow for our purposes (average of 152ms for a 1400 lines file). Is there any way to do that with the new editor API? How about accessing the compiler AST or an intermediate representation of it? 

任何 提示都很有用。

Any hint would be useful.

问候, 
$
Federico

Regards, 
Federico

推荐答案

您好Federico,

感谢您的支持你的问题。

Hi Federico,
Thank you for your question.

我试图让熟悉这个话题的人参与进一步研究这个问题。可能会有一些时间延迟。感谢您的耐心等待。

I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.

感谢您的理解和支持。



祝你好运,¥ b $ b Lucy


Best regards,
Lucy


这篇关于新编辑器API中的FileCodeModel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆