I'm described as custom language service
I am now writing code for AuthoringScope ( ) My problem is in the GetDeclarations method.
The text of the current file can be used through ParseRequest.Text property, it gives me a list of all the methods and variables in my file, but how can I get the contents of other files Am I I need to get access to other file contents for the creation of AST tree of this file, but I do not know how I can do this.
Personally, I want to convert MPF "helper" class (like authoring cascade ) to Looks a little restrictive, and implementing everything manually (which, I accept, takes longer, but ultimately much more flexibility).
In any case, it sounds like your language (most!) Is the reliance between files at the semantic parsing level, this means that you have to either do the following:
A) Repeat several lessons at times, which can be slow in large projects
or b) maintain the global overall paras of files in a project, and change the files (or properties of the project) Time dynamically update Do you
b), of course, is very difficult, but almost certainly the best way to do it. After opening a simple framework through an NVDT, all projects will have to be searched, parsing them all (searching all files in each project, then through NVDT), and in some sort of index data structure Save something against it so that you can make inquiries faster (for meaning syntax highlighting, go to definition, etc.). Then you need to listen for changes everywhere and reparse appropriately - you will need to check for solutions open / close ( IVsSolutionEvents ), projects added / removed / nominated / unloaded / Loading ( is being edited file ( IVsTextViewCreationListener + ), the file is being edited / deleted / renamed ( IVsHierarchyEvents < / Code>),
if you choose) or b), you can change ( IVsUpdateSolutionEvents , IVsHierarchyEvents ). Still need to be able to check whether an editor has been opened in the editor (with potentially unsaved changes) or you can see that the file is already open in the document table running (but Do not forget to normalize the path by using Path.GetFullPath () first IVsRunningDocumentTable service, which will return a IntPtr in the document data, For a file that is a ITextBuffer It can be confused in providing that the text (and the entire buffer history!) Is included in the file. Of course, if it is not open then you will have to read it from disk.
No comments:
Post a Comment