Skip to content

Commit

Permalink
feat: basic lsp state
Browse files Browse the repository at this point in the history
  • Loading branch information
benpueschel committed Jun 30, 2024
1 parent e39b7e5 commit e3b8310
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions analysis/state.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package analysis

type State struct {
// Map of document URIs to text contents
Documents map[string]string
}

func NewState() State {
return State{
Documents: make(map[string]string),
}
}

func (s *State) OpenDocument(uri string, text string) {
s.Documents[uri] = text
}

func (s *State) UpdateDocument(uri string, text string) {
// TODO: handle incremental updates
s.Documents[uri] = text
}

0 comments on commit e3b8310

Please sign in to comment.