Skip to content

Commit

Permalink
Correctly detect action methods where the attrs are fully qualified
Browse files Browse the repository at this point in the history
  • Loading branch information
desplesda committed Sep 18, 2023
1 parent a21622f commit 8a15600
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ Smart variables can be accessed anywhere a regular variable would be used:
- Language Server: Improved the code-completion behaviour to provide better filtering when offering command completions, in both jump commands and custom commands.
- Language Server: Fixed character names being incorrectly recognised when the colon is not part of the line
- Moved Yarn's built-in functions (for example, 'dice' and 'floor') to Yarn Spinner's core library. Previously, they were implemented in the client game code (for example, the Unity runtime.)
- Fixed an error in the language server that would fail to detect `YarnCommand`- and `YarnFunction`-tagged methods if their attributes were fully-qualified (e.g. `Yarn.Unity.YarnCommand`)

### Removed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ public static IEnumerable<Action> ParseActionsFromCode(string text, Uri uri)
{
foreach (var attribute in list.Attributes)
{
var name = attribute.Name.ToString();
string name;
if (attribute.Name is QualifiedNameSyntax qualifiedName) {
name = qualifiedName.Right.ToString();
} else {
name = attribute.Name.ToString();
}

if (name.EndsWith("Attribute"))
{
name = name.Remove(name.LastIndexOf("Attribute"));
Expand Down

0 comments on commit 8a15600

Please sign in to comment.