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

Only look at parent when line and cursor indents match #989

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

50Wliu
Copy link

@50Wliu 50Wliu commented Sep 21, 2024

What does this PR do?

Given

steps:
- task: PowerShell@2
  |

We should be completing properties for the object that task is a part of, not the list under steps.

Previously, the parent algorithm would see that the current indentation == the configured indentation and incorrectly choose the parent list as the "real" closest node, despite the cursor clearly being more indented than the list.

Now, we also verify that the indentation of the current node equals the cursor indentation before deciding to look at the parent.

What issues does this PR fix or reference?

N/A, I caught this when trying to catch azure-pipelines-language-server back up with yaml-language-server.

Is it tested? How?

Added a unit test and confirmed that all tests pass.

Given

steps:
- task: PowerShell@2
  |

We should be completing properties for the object that `task` is a part of, not the list under `steps`.

Previously, the parent algorithm would see that the current indentation == the configured indentation and incorrectly choose the parent list as the "real" closest node,
despite the cursor clearly being more indented than the list.

Now, we also verify that the indentation of the current node equals the cursor indentation before deciding to look at the parent.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant