MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / Open

Method Open

pkg/lsp/documents.go:137–147  ·  view source on GitHub ↗

Open adds a document to the manager. This method is called when the client sends a textDocument/didOpen notification. It stores the initial document state including URI, language, version, and content. Parameters: - uri: Document URI (e.g., "file:///path/to/query.sql") - languageID: Language ident

(uri, languageID string, version int, content string)

Source from the content-addressed store, hash-verified

135// If a document with the same URI already exists, it will be replaced with
136// the new content and version.
137func (dm *DocumentManager) Open(uri, languageID string, version int, content string) {
138 dm.mu.Lock()
139 defer dm.mu.Unlock()
140 dm.documents[uri] = &Document{
141 URI: uri,
142 LanguageID: languageID,
143 Version: version,
144 Content: content,
145 Lines: splitLines(content),
146 }
147}
148
149// Update updates a document's content.
150//

Callers 15

TestDocumentManagerFunction · 0.95
TestHandler_DidChangeFunction · 0.80
TestHandler_CompletionFunction · 0.80
TestHandler_HoverFunction · 0.80
TestHandler_FormattingFunction · 0.80
TestSnippetCompletionsFunction · 0.80
BenchmarkHandler_HoverFunction · 0.80

Calls 1

splitLinesFunction · 0.70

Tested by 15

TestDocumentManagerFunction · 0.76
TestHandler_DidChangeFunction · 0.64
TestHandler_CompletionFunction · 0.64
TestHandler_HoverFunction · 0.64
TestHandler_FormattingFunction · 0.64
TestSnippetCompletionsFunction · 0.64
BenchmarkHandler_HoverFunction · 0.64