Update debug.lua
This commit is contained in:
		
							parent
							
								
									1a27472331
								
							
						
					
					
						commit
						8b2cff995a
					
				| 
						 | 
				
			
			@ -35,7 +35,56 @@ return {
 | 
			
		|||
      
 | 
			
		||||
      -- You can provide additional configuration to the handlers,
 | 
			
		||||
      -- see mason-nvim-dap README for more information
 | 
			
		||||
      -- handlers = {},
 | 
			
		||||
      -- In below way also we can setup debugger for python
 | 
			
		||||
      --[[
 | 
			
		||||
      handlers = {
 | 
			
		||||
          python = function(source_name)
 | 
			
		||||
            dap.adapters.python = {
 | 
			
		||||
              type = "executable",
 | 
			
		||||
              command = "/usr/bin/python3", -- use "which python" command and provide the python path
 | 
			
		||||
              args = {
 | 
			
		||||
                "-m",
 | 
			
		||||
                "debugpy.adapter",
 | 
			
		||||
              },
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            dap.configurations.python = {
 | 
			
		||||
              {
 | 
			
		||||
                type = "python",
 | 
			
		||||
                request = "launch",
 | 
			
		||||
                name = "Launch file",
 | 
			
		||||
                program = "${file}", -- This configuration will launch the current file if used.
 | 
			
		||||
                console= "integratedTerminal",
 | 
			
		||||
              },
 | 
			
		||||
              {
 | 
			
		||||
                name= "Pytest: Current File",
 | 
			
		||||
                type= "python",
 | 
			
		||||
                request= "launch",
 | 
			
		||||
                module= "pytest",
 | 
			
		||||
                args= {
 | 
			
		||||
                    "${file}",
 | 
			
		||||
                    "-sv",
 | 
			
		||||
                    "--log-cli-level=INFO",
 | 
			
		||||
                    "--log-file=tc_medusa.log"
 | 
			
		||||
                },
 | 
			
		||||
                console= "integratedTerminal",
 | 
			
		||||
              },
 | 
			
		||||
              {
 | 
			
		||||
                name= "Profile python: Current File",
 | 
			
		||||
                type= "python",
 | 
			
		||||
                request= "launch",
 | 
			
		||||
                module= "cProfile",
 | 
			
		||||
                args= {
 | 
			
		||||
                    "-o",
 | 
			
		||||
                    "/tmp/profile.dat",
 | 
			
		||||
                    "${file}"
 | 
			
		||||
                }
 | 
			
		||||
                console= "integratedTerminal",
 | 
			
		||||
              },
 | 
			
		||||
            }
 | 
			
		||||
          end,
 | 
			
		||||
        },
 | 
			
		||||
       --]]
 | 
			
		||||
 | 
			
		||||
      -- You'll need to check that you have the required things installed
 | 
			
		||||
      -- online, please don't ask me how to install them :)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue