Skip to content

Commit

Permalink
[Bug Fix] - reference returns too many matches (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
noklam authored Sep 18, 2024
1 parent 844d135 commit 5fea15b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
- `Select Environment` actions now update the run environment instead of base.
- Modified status bar to show both environments, i.e.`base + local`, and `base` is no longer selectable.
- Fixed a minor bug where status bar showing incorrect text, i.e. it shows `prod` insteadf of `base + prod`.
- Fixed a bug where "Find reference" return too many matches for catalog dataset, it returns only exact matches now.
- Fixed a bug where namespace dataset navigation is not working properly
- Fixed a bug where navigating on nested parameters should go to the top level key.


# 0.1.0
- Expanded pipeline discovery to support `*pipeline*.py` patterns and improved handling of nested subdirectories.
- Add new extension setting `Kedro: Environment` to change the configuration environment.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ The extension follows Kedro [pipeline autodiscovery mechanism](https://docs.kedr
## Visualisation with Kedro-Viz
To visualize your Kedro project using Kedro-Viz in Visual Studio Code, follow these steps:

1. **Open the Command Palette**:
1. **Open the Command Palette**:
Press `Cmd` + `Shift` + `P` (on macOS) or `Ctrl` + `Shift` + `P` (on Windows/Linux).

2. **Run Kedro-Viz**:
Expand All @@ -80,7 +80,7 @@ Use `Cmd` (Mac)/ `Ctrl` (Window) + `Click` or `F12` to trigger `Go to Definition
- Use the shortcut `Shift` + `F12`
![find reference](assets/lsp-find-reference.gif)

**Note:** You can find pipeline reference in all the files containing "pipeline" in their names, even in nested subdirectories.
**Note:** You can find pipeline reference in all the python files under `<package_name>/pipelines`
```
- pipelines
- sub_pipeline
Expand Down
4 changes: 2 additions & 2 deletions bundled/tool/lsp_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,12 +383,12 @@ def references(
if not pipeline_dir.is_dir():
continue
# Use glob to find files matching the pattern recursively
pipeline_files = glob.glob(f"{pipeline_dir}/**/*pipeline*.py", recursive=True)
pipeline_files = glob.glob(f"{pipeline_dir}/**/*.py", recursive=True)
for pipeline_file in pipeline_files:
# Read the line number and match keywords naively
with open(pipeline_file) as f:
for i, line in enumerate(f):
if word in line:
if f'"{word}"' in line:
result.append((Path(pipeline_file), i))

locations = []
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Kedro",
"displayName": "Kedro",
"description": "A Kedro VSCode Extension.",
"version": "0.2.0-rc1",
"version": "0.2.0-rc3",
"preview": false,
"serverInfo": {
"name": "Kedro",
Expand Down

0 comments on commit 5fea15b

Please sign in to comment.