-
-
Notifications
You must be signed in to change notification settings - Fork 216
Paris improvements forvscode and playground (WIP) #423
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
Merged
Merged
Changes from 10 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
bef788f
updated semantic token visitor to improve character highlighting
parisba b2ff70d
changes in support of new lsp
parisba 57b0534
changes for error handling
parisba b561608
vastly improving errors
parisba ecbaa2d
error handling mirpvements
parisba 8e93877
fixing highlighting errors
parisba 17d066f
Remove deprecated C# language server
parisba a70a1f3
Merge branch 'main' of github.com:YarnSpinnerTool/YarnSpinner into pa…
desplesda 9721d0d
Remove old language server csproj references from solution
desplesda ab393be
Only fail a test if it contains errors, not _any_ diagnostic
desplesda f736464
updates to nodemetadatavisitor per Jon's PR comments
parisba 5bedeb2
comment clarifying why we dont emit YS00001 implicit variable type co…
parisba 979ac45
big fancy central diagnostic descriptor which was already in flight w…
parisba 3bc5a87
Merge branch 'paris-improvements-forvscode-and-playground' of https:/…
parisba 6ecda60
fixing ys003 and node group comments to clarify
parisba d565e3d
more error work
parisba 1687ffa
Add format placeholder descriptions for diagnostic descriptors
desplesda ca9da28
Add regions to DiagnosticDescriptor
desplesda 25f3a26
Add additional error codes
desplesda 1822d67
Allow creating diagnostics via a DiagnosticDescriptor
desplesda 7d33795
Start making diagnostic generation use descriptors instead of raw str…
desplesda e444897
Fix runtime error due to duplicate placeholder error codes
desplesda e98a618
Document DiagnosticDescriptor.Create overloads
desplesda e1ff83a
Merge remote-tracking branch 'origin/paris-improvements-forvscode-and…
parisba 6b94440
Remove merge conflict marker
desplesda 7215041
Fix incorrect test
desplesda 6f73632
changes to support grouping options in VSCode
parisba 6e5a1ce
Merge branch 'paris-improvements-forvscode-and-playground' of https:/…
parisba dfccf51
Include source URIs in jumps
desplesda cbc3bbc
Temporarily skip TestLineCollisionTagging until perf fix for SyntaxVa…
desplesda fe7cc4c
Fix test failure in TestInterruptedLinesNotTagged
desplesda 62b8b91
Convert more compile errors to use DiagnosticDescriptor
desplesda c3a2deb
commenting out when from preview features..
parisba 8dc14e0
Merge branch 'paris-improvements-forvscode-and-playground' of https:/…
parisba f0aca49
fixes and tweaks in support of try/playgrounds/new lsp
parisba 7c66217
fixes in support of issues found in try
parisba 8c729b9
tweaks for try
parisba File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,130 @@ | ||
| // Copyright Yarn Spinner Pty Ltd | ||
| // Licensed under the MIT License. See LICENSE.md in project root for license information. | ||
|
|
||
| namespace Yarn.Compiler | ||
| { | ||
| using System.Collections.Generic; | ||
|
|
||
| /// <summary> | ||
| /// contains metadata about a node extracted during compilation for use by language server features | ||
| /// this is different from nodedebuginfo which is for instruction level debugging | ||
| /// </summary> | ||
| public class NodeMetadata | ||
| { | ||
| /// <summary> | ||
| /// the title of the node | ||
| /// </summary> | ||
| public string Title { get; set; } = string.Empty; | ||
|
|
||
| /// <summary> | ||
| /// the file uri where this node is defined | ||
| /// </summary> | ||
| public string Uri { get; set; } = string.Empty; | ||
|
|
||
| /// <summary> | ||
| /// all jump and detour destinations referenced from this node | ||
| /// </summary> | ||
| public List<JumpInfo> Jumps { get; set; } = new List<JumpInfo>(); | ||
|
|
||
| /// <summary> | ||
| /// all function names called within this node | ||
| /// </summary> | ||
| public List<string> FunctionCalls { get; set; } = new List<string>(); | ||
|
|
||
| /// <summary> | ||
| /// all command names called within this node (excludes flow control like if/else/endif) | ||
| /// </summary> | ||
| public List<string> CommandCalls { get; set; } = new List<string>(); | ||
|
|
||
| /// <summary> | ||
| /// all variable names referenced within this node | ||
| /// </summary> | ||
| public List<string> VariableReferences { get; set; } = new List<string>(); | ||
|
|
||
| /// <summary> | ||
| /// complexity score for node groups or negative one if not part of a group | ||
| /// calculated by the compiler based on when clauses | ||
| /// </summary> | ||
| public int NodeGroupComplexity { get; set; } = -1; | ||
|
|
||
| /// <summary> | ||
| /// character names found in dialogue lines within this node | ||
| /// extracted from lines matching the pattern charactername: dialogue | ||
| /// </summary> | ||
| public List<string> CharacterNames { get; set; } = new List<string>(); | ||
|
|
||
| /// <summary> | ||
| /// tags from the node tags header | ||
| /// </summary> | ||
| public List<string> Tags { get; set; } = new List<string>(); | ||
|
|
||
| /// <summary> | ||
| /// preview text from the first few lines of dialogue in the node | ||
| /// used for quick previews in ui | ||
| /// </summary> | ||
| public string PreviewText { get; set; } = string.Empty; | ||
|
|
||
| /// <summary> | ||
| /// number of shortcut options in this node | ||
| /// </summary> | ||
| public int OptionCount { get; set; } = 0; | ||
|
|
||
| /// <summary> | ||
| /// zero based line number where the node header starts (first three dashes) | ||
| /// </summary> | ||
| public int HeaderStartLine { get; set; } = -1; | ||
|
|
||
| /// <summary> | ||
| /// zero based line number where the title declaration is (title: nodename) | ||
| /// </summary> | ||
| public int TitleLine { get; set; } = -1; | ||
|
|
||
| /// <summary> | ||
| /// zero based line number where the node body starts (after second three dashes) | ||
| /// </summary> | ||
| public int BodyStartLine { get; set; } = -1; | ||
|
|
||
| /// <summary> | ||
| /// zero based line number where the node body ends (at or before three equals signs) | ||
| /// </summary> | ||
| public int BodyEndLine { get; set; } = -1; | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// information about a jump or detour from one node to another | ||
| /// </summary> | ||
| public class JumpInfo | ||
| { | ||
| /// <summary> | ||
| /// the title of the destination node | ||
| /// </summary> | ||
| public string DestinationTitle { get; set; } = string.Empty; | ||
|
|
||
| /// <summary> | ||
| /// whether this is a jump or a detour | ||
| /// </summary> | ||
| public JumpType Type { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// the source location of this jump statement in the file | ||
| /// used for precise error reporting (YS0002) | ||
| /// </summary> | ||
| public Range Range { get; set; } = Range.InvalidRange; | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// type of jump between nodes | ||
| /// </summary> | ||
| public enum JumpType | ||
| { | ||
| /// <summary> | ||
| /// a standard jump to another node | ||
| /// </summary> | ||
| Jump, | ||
|
|
||
| /// <summary> | ||
| /// a detour to another node that will return | ||
| /// </summary> | ||
| Detour | ||
| } | ||
| } | ||
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder whether it would be useful to store names alongside locations (i.e. paths and ranges), rather than simply the function identifier, and likewise for variables, nodes, etc. (Not a requirement, just a thought.)