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

Fixes signature help bug with default arguments in VSCode #284

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

ncordon
Copy link
Collaborator

@ncordon ncordon commented Nov 7, 2024

Before

After

Copy link

changeset-bot bot commented Nov 7, 2024

🦋 Changeset detected

Latest commit: 798d0bc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@neo4j-cypher/language-support Patch
@neo4j-cypher/language-server Patch
@neo4j-cypher/react-codemirror-playground Patch
@neo4j-cypher/react-codemirror Patch
@neo4j-cypher/schema-poller Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

});

const argsString = argDescriptions.map((arg) => arg.label).join(', ');
const signature = `${name}(${argsString})`;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ensures the signature is computed with whatever is returned in the argument descriptions

@ncordon ncordon changed the title Fixes signature help bug with VSCode Fixes signature help bug with default arguments in VSCode Nov 7, 2024

return SignatureInformation.create(
signature,
description,
...argumentDescription.map((arg) => ({
label: `${arg.name} :: ${arg.type}`,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that the highlighting on the signature gets done matching against this. If the signature of a specific argument includes a default value (e.g = ms) but here we didn't have it, then it wasn't been highlighted in blue.

@ncordon ncordon merged commit bccf518 into main Nov 7, 2024
4 checks passed
@ncordon ncordon deleted the fix-signature-help-bug branch November 7, 2024 09:41
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.

2 participants