A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/grafana/jsonnet-language-server/commit/b2443cf9b5ebacbc0e460ad84ee0f7c1ab1bd7f6 below:

Invalidate the whole "top level objects" cache (#155) · grafana/jsonnet-language-server@b2443cf · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+5

-7

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+5

-7

lines changed Original file line number Diff line number Diff line change

@@ -4,7 +4,6 @@ import (

4 4

"errors"

5 5

"fmt"

6 6

"os"

7 -

"path/filepath"

8 7

"strings"

9 8

"sync"

10 9

@@ -56,11 +55,9 @@ func (c *Cache) Put(new *Document) error {

56 55

c.docs[uri] = new

57 56 58 57

// Invalidate the TopLevelObject cache

59 -

for k := range c.topLevelObjects {

60 -

if strings.HasSuffix(k, filepath.Base(uri.SpanURI().Filename())) {

61 -

delete(c.topLevelObjects, k)

62 -

}

63 -

}

58 +

// We can't easily invalidate the cache for a single file (hard to figure out where the import actually leads),

59 +

// so we just clear the whole thing

60 +

c.topLevelObjects = make(map[string][]*ast.DesugaredObject)

64 61 65 62

return nil

66 63

}

Original file line number Diff line number Diff line change

@@ -105,7 +105,8 @@ func (s *Server) DidChange(_ context.Context, params *protocol.DidChangeTextDocu

105 105

}

106 106

}

107 107

}

108 -

return nil

108 + 109 +

return s.cache.Put(doc)

109 110

}

110 111 111 112

func (s *Server) DidOpen(_ context.Context, params *protocol.DidOpenTextDocumentParams) (err error) {

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4