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

Add some more details to the plugins docs #913

Merged

Conversation

josephjunker
Copy link
Collaborator

This adds some additional information on plugins. If the note on the diagnostics availability in early build steps is too much detail I can remove it.

docs/plugins.md Outdated
@@ -323,6 +323,8 @@ export default function () {
};
```

Note that creating diagnostics requires that `BscFile` objects are available. This means that diagnostics cannot be recorded in the `beforeProgramCreate` and `afterProgramCreate` steps.
Copy link
Member

@TwitchBronBron TwitchBronBron Sep 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't quite true. You can push diagnostics to the program itself with program.addDiagnostics(), but you would need to add a "fake" file. I'm doing this in util.ts as an example.

let diagnostic = {
    message: "Some diagnostic',
    code: 'some-code',
    file: {
        srcPath: configFilePath
    },
    range: util.createRange(1,2,3,4)
} as BsDiagnostic;

But yeah, this pattern isn't overly intuitive, but I don't think this paragraph is quite correct, so I'd say let's remove it, or add my above example as an alternative.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. I've removed this paragraph, because explaining it might be more confusing then not mentioning it at all.

Copy link
Member

@TwitchBronBron TwitchBronBron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for this!

@TwitchBronBron TwitchBronBron merged commit dc6c8c3 into rokucommunity:master Sep 27, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants