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

export vscode glob implementation library #237304

Open
7sunarni opened this issue Jan 6, 2025 · 3 comments
Open

export vscode glob implementation library #237304

7sunarni opened this issue Jan 6, 2025 · 3 comments
Labels
feature-request Request for new features or functionality

Comments

@7sunarni
Copy link

7sunarni commented Jan 6, 2025

It's very useful to do some filters with include and exclude options when I do search/replace in vscode.
Image

And I want to develop a extension and I hope my extension has same behavior when do some filter to files like below .

...
function filter(links: vscode.Location[], include: string, exclude: string): vscode.Location[] {
	return links.filter(item => {
		let includeMatch = true;
		if (include && include !== '') {
			match = glob.match(include, item.uri.toString());
		}
		let excludeMatch = true;
		if (exclude && exclude !== '') {
			excludeMatch = !glob.match(exclude, item.uri.toString());
		}
		return includeMatch && excludeMatch;
	});
}
....

And I found the (vscode glob pattern document)[https://code.visualstudio.com/docs/editor/glob-patterns], it seems that vscode implement its glob pattern, and doesn't exported in its api? (or I don't find it)

So, could vscode export its glob api, and the extensions can behave same with the vscode.

@chrmarti
Copy link
Collaborator

chrmarti commented Jan 6, 2025

This is implemented in https://github.com/microsoft/vscode/blob/main/src/vs/base/common/glob.ts under the MIT license if you want to use it. It seems unlikely that we would add it to the extension API at the moment.

@chrmarti chrmarti added feature-request Request for new features or functionality and removed triage-needed labels Jan 6, 2025
@chrmarti chrmarti removed their assignment Jan 6, 2025
@vs-code-engineering vs-code-engineering bot added this to the Backlog Candidates milestone Jan 6, 2025
Copy link

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@7sunarni
Copy link
Author

7sunarni commented Jan 6, 2025

Yes. I noticed this file.

And this file import some files from the src/vs/base/common directory and those file also import other files and some from parent nls directory
so It need to copy whole directory to my project.
I thinks this may make its hard to catch up the update from the source.

So it can be very useful if it can import from the vscode base library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

2 participants