Actually fix restarting the LSP in :BuildDir job callback
This commit is contained in:
		
							parent
							
								
									d1f83a05b9
								
							
						
					
					
						commit
						2cd7d34375
					
				@ -31,9 +31,12 @@ function build.set_dir(dirname)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
      -- Restart clangd language server
 | 
					      -- Restart clangd language server
 | 
				
			||||||
      on_exit = function()
 | 
					      on_exit = function()
 | 
				
			||||||
        vim.cmd('LspStop')
 | 
					        -- This is a callback so doesn't run on the main thread which causes
 | 
				
			||||||
        vim.cmd('LspStart')
 | 
					        -- issues for running commands, so schedule that on the main thread.
 | 
				
			||||||
        echo('Build directory selected: ' .. dirname, 'DiagnosticInfo')
 | 
					        vim.schedule(function()
 | 
				
			||||||
 | 
					          vim.cmd('LspRestart')
 | 
				
			||||||
 | 
					          echo('Build directory selected: ' .. dirname, 'DiagnosticInfo')
 | 
				
			||||||
 | 
					        end)
 | 
				
			||||||
      end,
 | 
					      end,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      -- Display any error messages to the user
 | 
					      -- Display any error messages to the user
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user