YarnSpinnerTool / YarnSpinner

Yarn Spinner is a tool for building interactive dialogue in games!
https://yarnspinner.dev
MIT License
2.3k stars 201 forks source link

Language Server Command Data Not Loading #361

Closed Bryan-Legend closed 10 months ago

Bryan-Legend commented 1 year ago

The VS Code plugin is not recognizing even built in commands. Is it currently broken?

image

I've reported this here instead of https://github.com/YarnSpinnerTool/VSCodeExtension because the language server is in this repo and that seems to be where the issue is.

I tried adding https://github.com/YarnSpinnerTool/YarnSpinner/blob/main/YarnSpinner.LanguageServer/src/Server/Documentation/BuiltInFunctionsAndCommands.ysls.json to the same folder as my .yarn files and it had no effect. Note that that file is missing "Language" properties and does not pass schema validation.

I've also created an attached custom .ysls.json file for my game and it is not getting loaded either when I place it in the same folder as my .yarn files. Metroidvania.ysls.json.txt

I've tried both release and pre-release channels of the VS Code extension. I'm on release 2.2.5 of YarnSpinner.

pappleby commented 1 year ago

Do you mind sharing the yarn spinner extension settings you have currently set? I think there might be a bug with the logic to merge info from .cs files and commands with "Language": "csharp" in ysls.json files (lsp code here). One way to see if that's happening is to change the language on a couple commands from csharp to text and check if those commands autosuggest. (I was able to recreate with yarnspinner.CSharpLookup disabled but wasn't able to pin down if it's a combination of that and other settings)

That error text for wait is also pretty strange, do you get the correct info text when BuiltInFunctionsAndCommands.ysls.json is removed?

Bryan-Legend commented 1 year ago

Do you mind sharing the yarn spinner extension settings you have currently set? I think there might be a bug with the logic to merge info from .cs files and commands with "Language": "csharp" in ysls.json files (lsp code here). One way to see if that's happening is to change the language on a couple commands from csharp to text and check if those commands autosuggest. (I was able to recreate with yarnspinner.CSharpLookup disabled but wasn't able to pin down if it's a combination of that and other settings)

That error text for wait is also pretty strange, do you get the correct info text when BuiltInFunctionsAndCommands.ysls.json is removed?

First, thank you for your help! I really appreciate it.

I've got no extension settings set. I just tried a fresh install of VS code on a new machine (using ninite.com for the installer) with no settings set in VS Code or the extension. I installed the yarn spinner extension v2.2.106, then created a simple Test.yarn file and the wait command was not recognized. Is a yarnproject file required for a .yarn file to get command definitions?

image

I will try playing with the language types but I've not seen any sign that any ysls is being loaded. Could you maybe add a log to the extension log when a ysls file is loaded.

Bryan-Legend commented 1 year ago

Here's a view of the Yarn Spinner output. image

pappleby commented 1 year ago

Thanks for the additional info, that narrows things down considerably! One other thing to check, are you opening individual files or are you opening a folder? I'm able to recreate when I make individual files directly. The error handling / logging could be updated to make this more obvious but most of the language server features depend on a folder/workspace being available (code where it gives up if that's the case).

(comparison screenshot of file vs folder) image

Bryan-Legend commented 1 year ago

Yep. Open Folder fixed the problem! My custom command file even loaded!

On Sat, May 13, 2023 at 1:16 PM Peter Appleby @.***> wrote:

Thanks for the additional info. One other thing to check, are you opening individual files or are you opening a folder? I'm able to recreate when I make individual files directly. The error handling / logging could be updated to make this more obvious but most of the language server features depend on a folder/workspace being available (code where it gives up if that's the case https://github.com/YarnSpinnerTool/YarnSpinner/blob/main/YarnSpinner.LanguageServer/src/Server/Workspace/Workspace.cs#LL50C24-L50C24 ).

(comparison screenshot of file vs folder) [image: image] https://user-images.githubusercontent.com/408888/238152843-dae9abd9-45b5-4e64-9fa7-6a8472481b08.png

— Reply to this email directly, view it on GitHub https://github.com/YarnSpinnerTool/YarnSpinner/issues/361#issuecomment-1546733879, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHAUOEAVPZC56WYVSF5DUDXF7M2VANCNFSM6AAAAAAX47ZOF4 . You are receiving this because you authored the thread.Message ID: @.***>

desplesda commented 10 months ago

This is fixed as a result of 205e32b, 86a3c32d16124bebd6a622ab210539fe75a16c66, and 611c07a3d7423ab03122c3bb167286e084f47ba3.

Basically:

Thanks for the issue and for the discussion, all!