Skip to content
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

Testing terminal quick fix: contributed quick fixes are not working #164660

Closed
andreamah opened this issue Oct 25, 2022 · 4 comments
Closed

Testing terminal quick fix: contributed quick fixes are not working #164660

andreamah opened this issue Oct 25, 2022 · 4 comments
Assignees

Comments

@andreamah
Copy link
Contributor

andreamah commented Oct 25, 2022

Testing #164526

I have this under contributes in my extension's package.json:

"terminal": {
			"quickFixes": [
				{
					"id": "test",
					"commandLineMatcher": "cd",
					"linkToOpen": "http://google.ca/",
					"outputMatcher": {"lineMatcher": ".*No such file or directory.*", "anchor": "bottom", "offset":0, "length":2}
				},
		  ]
}

And running cd into an invalid directory isn't giving me the quick pick suggestion while the extension is active.
image

Let me know if I executed this wrong! An example somewhere would also be super helpful! :D

@meganrogge
Copy link
Contributor

I think this is probably because you don't specify any regex groups within your outputMatcher lineMatcher

@meganrogge
Copy link
Contributor

we require a group to be used within the linkToOpen or commandToRun

here's an example

{
				"id": "terminal-sample fix",
				"commandLineMatcher": "echo [^\\s]+",
				"outputMatcher":  {
					"lineMatcher": "(?<input>[^\\s]+) (?<inputtwo>[^\\s]+)",
					"anchor": "bottom",
					"length": 1,
					"offset": 0
				},
				"linkToOpen": "https://google.com/${group:input}${group:inputtwo}"
			},

@meganrogge
Copy link
Contributor

here's your example but using a group:

{
						"id": "test",
						"commandLineMatcher": "cd [^\\s]+",
						"linkToOpen": "http://google.ca/${group:fakename}",
						"outputMatcher": {"lineMatcher": ".*no such file or directory: (?<fakename>[^\\s]+)", "anchor": "bottom", "offset":0, "length":1}
	}

@andreamah
Copy link
Contributor Author

Works well on Linux with the capturing groups, thanks for the help!

@github-actions github-actions bot locked and limited conversation to collaborators Dec 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants