-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable l1-builtin-info test #673
Conversation
b206948
to
09c6472
Compare
b0cfbbf
to
ba16090
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm minded for us to spend a bit of time trying to work out why directory caching doesn't work here, since it seems like the fundamental unit that we should be able to capture. Failing that, can we push down to the load and do it at the file level?
Yeh I'll have a fresh look today. Maybe sleeping on it will have helped. |
ba16090
to
a79523a
Compare
Found the problem with caching, it was only if "compiler" option was set. Fixed to use directory caches and added a comment as to why we don't cache if compiler is set. |
} | ||
} | ||
|
||
func (host *yamlLanguageHost) loadTemplate(directory string, compilerEnv []string) (*ast.TemplateDecl, syntax.Diagnostics, error) { | ||
if host.template != nil && host.compiler == "" { | ||
return host.template, host.diags, nil | ||
// We can't cache comppiled templates because at the first point we call loadTemplate (in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/comppiled/compiled/
|
||
return host.template, diags, nil | ||
if host.compiler != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth either adding a shouldCache
method or even just a cache
method that internalise this check/provide a single place we can document it.
This enables the l1-builtin-info test. As we're now running multiple templates with the same
yamlLanguageHost
we can't globally cache the template in loadTemplate anymore.Instead we cache by the program directory. For normal runs there will only be the one program directory, and for conformance test we know each program will be in its own unique directory.