我的语言服务的Parser.cs文件中的GetService DTE请求 [英] GetService DTE request in Parser.cs file of my language service

查看:50
本文介绍了我的语言服务的Parser.cs文件中的GetService DTE请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在我的托管语言服务的parser.y/parser.cs文件中尝试执行以下操作,并且理解我在GetService上遇到错误.

I am trying to do the following in my parser.y/parser.cs file of my managed language sercice and understandebly I get an error on GetService.

 

DTE dte =( ) typeof ( )));

DTE dte = (DTE)this.GetService(typeof(DTE));

 

Array activeProjects =( )dte.ActiveSolutionProjects;

Array activeProjects = (Array)dte.ActiveSolutionProjects;

 

项目 activeProj =( )dte.ActiveDocument.ProjectItem.ContainingProject;

我的问题是Parser类无法使用Getservice,我想知道是否有任何方法可以访问DTE,或者是否有任何其他方法可以访问parser.cs/parser.y中的活动项目. /p>

Project activeProj = (Project)dte.ActiveDocument.ProjectItem.ContainingProject;

My problem is that Getservice is not availabe to the Parser class and I was wondering if there is any way to access DTE, or is there any other way to access the active project within the parser.cs/parser.y .


感谢

推荐答案



DTE服务名称为SDTE,以下语句可能没问题.

Hi,

The  DTE service name is SDTE, The following  statement may be OK.

DTE dte = this.GetService(typeof(SDTE)) as DTE;
 	

谢谢
kaku

Thanks
kaku


这篇关于我的语言服务的Parser.cs文件中的GetService DTE请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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