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

[Feature Request] Support launchdarkly-react-client-sdk in Flags in this File feature #122

Open
SevenOutman opened this issue Sep 4, 2024 · 2 comments

Comments

@SevenOutman
Copy link

Hey team, thanks for making this tool!

Currently, if I'm in a file where I reference a flag from the deconstruction of useFlags() result, it does not appear in the Flags in this File panel. Any plan we support this?

import { useFlags } from 'launchdarkly-react-client-sdk';

function App() {
  const { myFlag } = useFlags() // Expect my-flag to be listed in the Flags in this File
}
@InTheCloudDan
Copy link
Collaborator

It's supported today! You can read look at this section of the docs https://docs.launchdarkly.com/home/observability/code-references#using-ld-find-code-refs-with-the-react-web-sdk which describes how to setup aliases.

tl;dr

add a .launchdarkly directory in the root of the repo. Then add a coderefs.yaml under it so it looks like .launchdarkly/coderefs.yaml and then in the file:

aliases:
  - type: camelcase

If you have any other feedback on the extension we'd appreciate it.

@SevenOutman
Copy link
Author

Hey @InTheCloudDan, thanks for your response! I tried the config and I can see flag info when I hover the specifier now. However the "Flags in this file" section is still empty.

image

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

No branches or pull requests

2 participants