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

language client/server doesn't reload PPJ files on change #94

Open
rjstone opened this issue Oct 14, 2019 · 3 comments
Open

language client/server doesn't reload PPJ files on change #94

rjstone opened this issue Oct 14, 2019 · 3 comments
Assignees
Labels
bug Something isn't working language service

Comments

@rjstone
Copy link
Contributor

rjstone commented Oct 14, 2019

Describe the bug

Actually this is only a problem if the .PPJ file is in the workspace root (separate folder, not in the game directory) and possibly only for skyrimse.

I'm unsure if this is a bug or an enhancement request but... there's some code here in LanguageClient.ts:

        this._fsWatcher = workspace.createFileSystemWatcher('**/*.{flg,ppj,psc}');
        this._client = new BaseClient(
            options.game.toString(),
            {
                command: options.toolPath,
                args: toCommandLineArgs(options.toolArguments),
            },
            {
                outputChannel: options.outputChannel,
                documentSelector: [
                    { scheme: 'file', language: 'papyrus' },
                    { scheme: 'file', language: 'papyrus-project' },
                ],
                synchronize: {
                    fileEvents: this._fsWatcher,
                    configurationSection: 'papyrus',
                },
            }
        );

That makes it look like the intention is to watch for changes in .PPJ files but the language server doesn't reload those files when they are edited and saved.

To Reproduce
Steps to reproduce the behavior:

  1. Open a workspace with a PPJ file.
  2. Change/add/delete an import or source path.
  3. Changes don't take effect in the project explorer. You have to close and reopen the workspace to get them picked up.
@rjstone rjstone added the bug Something isn't working label Oct 14, 2019
@rjstone rjstone added language service game: skyrim se Issue pertains specifically to Skyrim Special Edition labels Oct 14, 2019
@rjstone
Copy link
Contributor Author

rjstone commented Oct 14, 2019

It's possible this should just be "wontfix" because I'm not sure it makes sense to support PPJ files for skyrimse anyway. Nothing else for skyrim/se uses them, and if these things are just stored in the .code-workspace config they can be easily inserted into build task configs in tasks.json. That would make project generation easier too.

Basically I'm suggesting just adding Source Folder and Import Folder (As ; delimited list) to the config since you have to pass these to sse papyruscompiler anyway. FO4 could potentially use either option (I'm not sure it hurts to allow this to be used for FO4 too) but FO4 uses probably want to just use the PPJ since that's the FO4 way of doing things and the compiler will actually read that.

@joelday
Copy link
Owner

joelday commented Oct 14, 2019

@rjstone Changing a PPJ should still cause projects to reload, IMO.

@joelday
Copy link
Owner

joelday commented Oct 14, 2019

https://github.com/joelday/papyrus-lang/blob/master/src/DarkId.Papyrus.Server/WorkspaceManager.cs#L107 Isn't handling change events. There currently isn't a way to tell a specific associated project instance to reset itself. I think it would be reasonable to reset all projects when one project changes, though.

@joelday joelday added good first issue Good for newcomers and removed game: skyrim se Issue pertains specifically to Skyrim Special Edition good first issue Good for newcomers labels Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working language service
Projects
None yet
Development

No branches or pull requests

2 participants