File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -349,15 +349,26 @@ impl Extension for Java {
349349 language_server_id : & LanguageServerId ,
350350 worktree : & Worktree ,
351351 ) -> zed:: Result < Option < Value > > {
352- LspSettings :: for_worktree ( language_server_id. as_ref ( ) , worktree)
353- . map ( |lsp_settings| lsp_settings. settings )
354- . or ( self
352+ // FIXME(Valentine Briese): I don't really like that we have a variable
353+ // here, there're probably some `Result` and/or
354+ // `Option` methods that would eliminate the
355+ // need for this, but at least this is easy to
356+ // read.
357+
358+ let mut settings = LspSettings :: for_worktree ( language_server_id. as_ref ( ) , worktree)
359+ . map ( |lsp_settings| lsp_settings. settings ) ;
360+
361+ if !matches ! ( settings, Ok ( Some ( _) ) ) {
362+ settings = self
355363 . language_server_initialization_options ( language_server_id, worktree)
356364 . map ( |initialization_options| {
357365 initialization_options. and_then ( |initialization_options| {
358366 initialization_options. get ( "settings" ) . cloned ( )
359367 } )
360- } ) )
368+ } )
369+ }
370+
371+ settings
361372 }
362373
363374 fn label_for_completion (
You can’t perform that action at this time.
0 commit comments