Closed TheMartianLife closed 7 months ago
I think the way we fix this is to keep track of all const
string variables encountered while doing the check, and then use that information to resolve these to string literals when building the list of Yarn action methods. Doing it this way means we don't need to invoke the entire compilation and can stay entirely within the domain of walking the syntax trees.
At the moment we're not sure whether this will need to be limited to a per-file check, or if we will be able to do it across the entire project.
What is the current behavior?
If a command is registered with a variable as the name, the variable name becomes the suggested value in command completions rather than the variable value. This would likewise affect any computed value, such as if the command name argument were set to a concatenated or interpolated string.
Please provide the steps to reproduce, and if possible a minimal demo of the problem:
Upon typing
<<command_
in Yarn, there will be no completion suggestion as instead it has registered “STRING_VARIABLE” as the command name.Where I think the issue comes from:
/YarnSpinnerTool/YarnSpinner/YarnSpinner.LanguageServer/src/Server/Workspace/CSharpFileData.cs