JetBrains / JetBrains/Grammar-Kit

Syntax error ruining the parsing of the rest of the file

Open
#282 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
771
Forks
137
Avg merge
11h 14m
Merged PRs (30d)
1

Description

Hi,

I'm really trying to wrap my head around pin and recover_while but I don't think I've been able to use it properly.

My issue is that I have a simple script e.g. like this:

```c#
function Foo() {}
````

Now I want to write function call above function Foo that refers to Foo:
```c#
Fo
function Foo() {}
```

I'd expect this to give me auto-completion in IntelliJ, but it doesn't because the syntax error that arises from the function call not being finished prevents the function Foo from being parsed properly.

I have tried using recover_while and pinning, and I can get it to report the correct error, but no matter what I try, the error will always break the parsing.

What functionality should I use to prevent the parsing from breaking down? Is it recover_while?

Contributor guide

No contributing guide indexed for this repository

Research direction

No file or test is named. Start by reviewing how Grammar-Kit handles pin and recover_while, then reproduce the incomplete `Fo` call in IntelliJ; done means the syntax error is reported while the later `function Foo() {}` remains parsed well enough for auto-completion.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, java
Domain
compilers, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.