Load a document #14
Labels
component: Rubberduck.Client
Issue involves RPC client/platform
component: Rubberduck.Core
Issue involves the Core library
feature: editor shell
Issues that relate to the editor shell
feature: workspace explorer
Issues that relate to the workspace explorer / sync panel
skill:xaml
Issues that involve XAML markup and WPF
Milestone
The server receives a
TextDocumentItem
with the notification:So this is where the server receives the
text
of the document at a givenversion
. ThelanguageId
should bevba
, to avoid clashing with "VB.NET"vb
. Theuri
points to a path relative to the workspace root.The string contains the complete file contents, including headings and attributes that are hidden in the VBIDE, so that's what we want to parse, and we'll want to quickly get a parse tree for it, cache it with the document
uri
andversion
as a key... and then sit on it for now - eventually the LSP server is going to send various notifications to the client, and we'll want to launch a semantic pass over all the parse trees and declarations, so having a parse tree associated to a specific version of a document URI is a very good starting point.This supposes something is holding this state in some (thread-safe) dictionary: we'll need to inject a service that's responsible for just that.
TextDocumentItem
to a parse tree, and to retrieve a parse tree for a given document URI and versionTextDocumentItem
.DidOpenHandler
classOmniSharp.Extensions.LanguageServer.Protocol.Document.DidOpenTextDocumentHandlerBase
; constructor-inject state serviceHandle
override; access the document from therequest
parameter (DidOpenTextDocumentParams
).CreateRegistrationOptions
override (specifyDocumentSelector
filters)Log successful execution of the handler at
INFO
level; exceptions can be caught, but must be rethrown to return an error result at the JSON-RPC level.The text was updated successfully, but these errors were encountered: