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

"Find unused variables" found a variable that was used. #74

Open
Carman1982 opened this issue Jul 19, 2019 · 4 comments
Open

"Find unused variables" found a variable that was used. #74

Carman1982 opened this issue Jul 19, 2019 · 4 comments
Assignees
Labels

Comments

@Carman1982
Copy link

Describe the bug
Opened a DTS. Opened Variables at bottom. Clicked the "Find Unused Variables". Found that one of the variables was actually being used. Noticed that Find Variable References window did find the reference to the variable.

Version
Version

To Reproduce
Opened a DTS.
Opened Variables at bottom.
Clicked the "Find Unused Variables".
Found that one of the variables was actually being used.

Expected behavior
Not show variables being used.

Screenshots
Screen shot of Find Unused Variables window
image

Screen shot of the Find Variable References window
image

Additional context
Feels like the Find Unused Variables is not looking at Expressions on other variables?

@sqlgreen sqlgreen self-assigned this Aug 26, 2019
@sqlgreen sqlgreen added the bug label Aug 26, 2019
@sqlgreen
Copy link
Member

sqlgreen commented Aug 26, 2019

@Carman1982 thank you for reporting the issue and the great bug report. The matching logic would only handle the matching one variable in an expression (the first it found based on test order), which was OK for Find Variable References feature, but not so good for the Find Unused Variables.

Fix now in, and will look to do a release soon.

(Sorry for the slow response, different SSDT versions are just painful for extension development and I was a bit behind)

@Phil-Greenlight
Copy link

I have just encountered an analogous issue with parameters.

I have a project parameter which is referenced in a variable's expression (within the package being edited).

Find Unused Parameters identifies this parameter.

Find Parameter References does not appear to do anything at all. No popup window is displayed.

This is VS2017 targeting SQL Server 2017. BI Developer Extensions For Visual Studio 2019 - 2.3.7.

@cyprox972
Copy link

Is this problem supposed to be fixed? I still have the exact same problem as reported, running version 2.4.0 in VS 2017 with SQL Server Data Tools v15.1.62002.01090

@Phil-Greenlight
Copy link

I ended up writing my own routine for this. Check this link if you are interested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants