-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
feat(lsp): cache jsxImportSource automatically #21687
feat(lsp): cache jsxImportSource automatically #21687
Conversation
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.
@dsherret any more comments?
if let Some(config_file) = self.config.maybe_config_file() { | ||
if let Ok((compiler_options, _)) = config_file.to_compiler_options() { | ||
if let Some(compiler_options_obj) = compiler_options.as_object() { | ||
if let Some(jsx_import_source) = |
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.
Nitpick, but all of this should be simplified using let else
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.
Probably it could just be extracted out to a separate method?
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.
In this case IMO it's more readable like this, I don't want to add more methods for this because it's going to be moved for #21029.
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.
LGTM!
if let Some(config_file) = self.config.maybe_config_file() { | ||
if let Ok((compiler_options, _)) = config_file.to_compiler_options() { | ||
if let Some(compiler_options_obj) = compiler_options.as_object() { | ||
if let Some(jsx_import_source) = |
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.
Probably it could just be extracted out to a separate method?
Fixes #20582.
Fixes #21725.
When a
deno.json
file is loaded, readcompilerOptions.jsxImportSource
and queue a task to cache it.