protobuflab / protobuf-langserver

MIT License
0 stars 1 forks source link

Create a workspace snapshot data type. #5

Closed NTaylorMullen closed 5 years ago

NTaylorMullen commented 5 years ago

Workspace snapshots represent the state of the workspace at a certain point in time. Ideally it'd be great to use Roslyn's workspace as a motivation but their workspace is tied too strictly to their types so we'll need to make our own. A workspace snapshot changes overtime, for instance when you add a file to the workspace the previous workspace instance no longer equals the new one (they're immutable).

This issue doesn't track creating/updating snapshots its reason is to provide a common type that other infrastructure bits can use to make decisions.

Basic structure of a workspace snapshot

// VersionStamp is a Roslyn type
VersionStamp Version { get; }

// Dependent on https://github.com/protobuflab/protobuf-langserver/issues/4
IReadOnlyList<DocumentSnapshotType> Documents { get; }

// Might need some helper methods here to enable a parser to find imports and friends.

A workspace snapshot is immutable.

ryanbrandenburg commented 5 years ago

https://github.com/protobuflab/protobuf-langserver/commit/7a94c93ae341bba915c066d88ff7a219ee1b766f