Git Product home page Git Product logo

Comments (2)

madskjeldgaard avatar madskjeldgaard commented on June 6, 2024 2

This is good feedback; I'll have to adjust the docs to make this clearer. At the moment, setting values in the quickfix relies on having a "diagnostics" field on the result object, which you would typically set using an output parser (see the docs on parsing output). In your example, you're running the command, nothing is parsing the output, then you have two components looking for diagnostics, but that value hasn't been set. All this assumes that you want to extract certain lines as build errors, warnings, or similar.

If you instead want to dump all output into the quickfix, have a look at #4. It has a draft API for two ways to accomplish that. Feedback is welcome (encouraged, even). I have been and will be super busy for some weeks (moving and other life events), but I'll be cleaning up that API and merging it as soon as I am able.

Thanks a lot Steve! With your inspiration I managed to do what I wanted to do (which is an amazing thing to be able to do!!!!).

For posterity:

overseer.register_template({
		name = "piobuild",
		builder = function(params)
			return {
				cmd = {'pio'},
				args = {"run", "--verbose"},
				name = "piobuild",
				cwd = "",
				env = {},
				components = {
					"default",
					{"on_output_parse", parser = {
						-- Put the parser results into the 'diagnostics' field on the task result
						diagnostics = {
							-- Extract fields using lua patterns
							{
								"extract",
								"^([^%s].+):(%d+):(%d+): (.+)$",
								"filename",
								"lnum",
								"col",
								"text"
							},
						}
					}},
					"on_result_diagnostics",
					{"on_result_diagnostics_quickfix", {
						open = true
					}}
				},
				metadata = {},
			}
		end,
		desc = "Build a platformio project",
		tags = {overseer.TAG.BUILD},
		params = { },
		priority = 50,
		condition = {
			filetype = {"c", "cpp", "ino", "h", "hpp", "ini"},
			callback = function(search)
				return isdir(search.dir .. "/.pio")
			end
		},
	})

from overseer.nvim.

stevearc avatar stevearc commented on June 6, 2024

This is good feedback; I'll have to adjust the docs to make this clearer. At the moment, setting values in the quickfix relies on having a "diagnostics" field on the result object, which you would typically set using an output parser (see the docs on parsing output). In your example, you're running the command, nothing is parsing the output, then you have two components looking for diagnostics, but that value hasn't been set. All this assumes that you want to extract certain lines as build errors, warnings, or similar.

If you instead want to dump all output into the quickfix, have a look at #4. It has a draft API for two ways to accomplish that. Feedback is welcome (encouraged, even). I have been and will be super busy for some weeks (moving and other life events), but I'll be cleaning up that API and merging it as soon as I am able.

from overseer.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.