-
Notifications
You must be signed in to change notification settings - Fork 8
feat: implement file and text search functionality with glob pattern support #22
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d0f3b9e
feat: implement file and text search functionality with glob pattern …
ethanyhou efa1e6b
feat: use EFS for file operations to avoid locking the workspace reso…
ethanyhou fd608a0
refactor: convert FindFilesParams, FindFilesResult, FindTextInFilesPa…
ethanyhou 54a0d47
Address comments.
ethanyhou 4d97a6e
fix: make regex search case insensitive in findTextInFiles
ethanyhou b5bbfb0
Address comments.
ethanyhou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...lot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/protocol/FindFilesParams.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT license. | ||
|
|
||
| package com.microsoft.copilot.eclipse.core.lsp.protocol; | ||
|
|
||
| /** | ||
| * Parameters for the {@code workspace/findFiles} request. Used by the language server to ask the client to search for | ||
| * files matching a glob pattern under a given base URI (e.g. a semanticfs workspace folder). | ||
| * | ||
| * @param baseUri the base URI to search under (e.g. a semanticfs workspace folder) | ||
| * @param pattern the glob pattern to match file paths against | ||
| * @param maxResults the maximum number of results to return (optional) | ||
| */ | ||
| public record FindFilesParams(String baseUri, String pattern, int maxResults) { | ||
| } |
14 changes: 14 additions & 0 deletions
14
...lot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/protocol/FindFilesResult.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT license. | ||
|
|
||
| package com.microsoft.copilot.eclipse.core.lsp.protocol; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| /** | ||
| * Result of the {@code workspace/findFiles} request, containing URIs of files matching the glob pattern. | ||
| * | ||
| * @param uris the list of file URIs matching the glob pattern | ||
| */ | ||
| public record FindFilesResult(List<String> uris) { | ||
| } |
18 changes: 18 additions & 0 deletions
18
...lipse.core/src/com/microsoft/copilot/eclipse/core/lsp/protocol/FindTextInFilesParams.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT license. | ||
|
|
||
| package com.microsoft.copilot.eclipse.core.lsp.protocol; | ||
|
|
||
| /** | ||
| * Parameters for the {@code workspace/findTextInFiles} request. Used by the language server to ask the client to search | ||
| * for text (or a regex) in files under a given base URI. | ||
| * | ||
| * @param baseUri the base URI to search under (e.g. a semanticfs workspace folder) | ||
| * @param query the text or regex pattern to search for in files | ||
| * @param isRegexp whether the query is a regular expression | ||
| * @param includePattern an optional glob pattern to filter which files to search | ||
| * @param maxResults the maximum number of results to return (optional) | ||
| */ | ||
| public record FindTextInFilesParams(String baseUri, String query, Boolean isRegexp, String includePattern, | ||
| int maxResults) { | ||
| } |
25 changes: 25 additions & 0 deletions
25
...lipse.core/src/com/microsoft/copilot/eclipse/core/lsp/protocol/FindTextInFilesResult.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT license. | ||
|
|
||
| package com.microsoft.copilot.eclipse.core.lsp.protocol; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| /** | ||
| * Result of the {@code workspace/findTextInFiles} request, containing the list of matches. | ||
| * | ||
| * @param matches the list of text search matches | ||
| */ | ||
| public record FindTextInFilesResult(List<TextSearchMatch> matches) { | ||
|
|
||
| /** | ||
| * A single text search match. Field names mirror the CLS protocol. | ||
| * | ||
| * @param uri the URI of the file containing the match | ||
| * @param lineNumber the 1-based line number of the match within the file | ||
| * @param lineText the full text of the line containing the match | ||
| */ | ||
| public record TextSearchMatch(String uri, int lineNumber, String lineText) { | ||
| } | ||
|
|
||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.