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

ArgumentOutOfRange exception when retrieving diagnostics when strings are used as statements #126

Open
waneck opened this issue Apr 24, 2024 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@waneck
Copy link

waneck commented Apr 24, 2024

Describe the bug
When strings are used as statements, an ArgumentOutOfRange exception is thrown when querying for diagnostics.

To Reproduce

using Loretta.CodeAnalysis.Lua;
using Loretta.CodeAnalysis;

var parseOptions = new LuaParseOptions(LuaSyntaxOptions.Lua51).WithDocumentationMode(DocumentationMode.Parse);

// parse
var lorettaAst = LuaSyntaxTree.ParseText(@"
""hello""
", parseOptions, "test.lua");

foreach (var exc in lorettaAst.GetDiagnostics()) // throws an ArgumentOutOfRange exception here
{
    Console.WriteLine(exc.ToString());
}

Expected behavior
A Diagnostic can be retrieved

Additional context
Loretta Version: Happens both on 0.2.13-nightly1 and 0.2.12

Add any other context about the problem here.

@waneck waneck added the bug Something isn't working label Apr 24, 2024
@GGG-KILLER GGG-KILLER added this to the v0.2.12 milestone Apr 26, 2024
@GGG-KILLER GGG-KILLER moved this to Todo in Language Support Apr 26, 2024
@GGG-KILLER GGG-KILLER self-assigned this Apr 26, 2024
@TheGreatSageEqualToHeaven
Copy link
Member

Sorry I've been busy I'll take a look at this the coming week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Todo
Development

No branches or pull requests

3 participants