-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Global cache for documents + top level jsonnet objects (#153)
* Global cache for documents + top level jsonnet objects Closes #133 There are two caches currently: - One for protocol documents. This one is instantiated by the server and maintained up-to-date as documents are opened, changed, and closed. - One for jsonnet objects. This one is a global var and is only added to. Modified objects are never removed/modified from the cache. By merging the two caches, we can expand the first cache's behavior to also invalidate modified objects from the global cache when a document is changed. * Simplify processing args (#154) Instead of carrying a `cache` and `vm` around on each function, create a `Processor` struct to contain those * Fix linting
- Loading branch information
1 parent
4c756e3
commit 6f0feae
Showing
15 changed files
with
185 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package processing | ||
|
||
import ( | ||
"github.com/google/go-jsonnet" | ||
"github.com/grafana/jsonnet-language-server/pkg/cache" | ||
) | ||
|
||
type Processor struct { | ||
cache *cache.Cache | ||
vm *jsonnet.VM | ||
} | ||
|
||
func NewProcessor(cache *cache.Cache, vm *jsonnet.VM) *Processor { | ||
return &Processor{ | ||
cache: cache, | ||
vm: vm, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.