Skip to content

Conversation

@kshitijgetsac
Copy link
Contributor

Summary

Fixes signature help active parameter highlighting issue where the wrong parameter was being highlighted during function call completion.

Problem

When typing inside a function parameter (e.g., np.array([1], dtype=), the signature help incorrectly highlighted the next parameter (copy) instead of the current one being typed (dtype).

Root Cause

The bug was caused by setting the active_parameter field at both:

  1. The SignatureHelp level (correct - indicates which parameter globally)
  2. The individual SignatureInformation level (incorrect - should be None)

According to the LSP specification, active_parameter should only be set at the SignatureHelp level to indicate which parameter is currently active across all signature overloads.

Changes Made

  • Removed the active_parameter calculation from create_signature_information function in lsp.rs
  • Removed unused arg_index parameter from create_signature_information
  • Updated the call site in get_signature_help_at to not pass arg_index
  • Updated test expectations in signature_help.rs to check active_parameter at the correct level

Testing

  • Code compiles successfully
  • All existing tests pass (including 6 updated signature help tests)
  • Code follows the LSP specification for signature help

Fixes #1417

@meta-cla
Copy link

meta-cla bot commented Nov 3, 2025

Hi @kshitijgetsac!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@aaron-ang
Copy link
Contributor

Hi @kshitijgetsac, I don't think your patch fixes the issue. I checked out your branch and built the LSP locally. It still fails with the example provided in the issue

Screenshot 2025-11-02 at 10 31 58 PM
@meta-cla meta-cla bot added the cla signed label Nov 3, 2025
@meta-cla
Copy link

meta-cla bot commented Nov 3, 2025

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@kshitijgetsac
Copy link
Contributor Author

@aaron-ang thanks for letting me know , appreciate the help.

@kshitijgetsac
Copy link
Contributor Author

The issue was fixed by @aaron-ang and my implementation did not work

@kshitijgetsac kshitijgetsac deleted the 1417 branch November 3, 2025 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants