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)
| 135 | // If a document with the same URI already exists, it will be replaced with |
| 136 | // the new content and version. |
| 137 | func (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 | // |