Add some more details to the plugins docs#913
Merged
TwitchBronBron merged 4 commits intorokucommunity:masterfrom Sep 27, 2023
Merged
Add some more details to the plugins docs#913TwitchBronBron merged 4 commits intorokucommunity:masterfrom
TwitchBronBron merged 4 commits intorokucommunity:masterfrom
Conversation
docs/plugins.md
Outdated
| }; | ||
| ``` | ||
|
|
||
| Note that creating diagnostics requires that `BscFile` objects are available. This means that diagnostics cannot be recorded in the `beforeProgramCreate` and `afterProgramCreate` steps. |
Member
There was a problem hiding this comment.
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.
Collaborator
Author
There was a problem hiding this comment.
That makes sense. I've removed this paragraph, because explaining it might be more confusing then not mentioning it at all.
TwitchBronBron
approved these changes
Sep 23, 2023
Member
TwitchBronBron
left a comment
There was a problem hiding this comment.
Thanks so much for this!
TwitchBronBron
approved these changes
Sep 27, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.