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

If a file in the workspace has syntax errors, all files fail. #54

Open
shadycuz opened this issue Sep 13, 2021 · 1 comment
Open

If a file in the workspace has syntax errors, all files fail. #54

shadycuz opened this issue Sep 13, 2021 · 1 comment

Comments

@shadycuz
Copy link
Contributor

If I have two files open, a.groovy and b.groovy, and I make a syntax error in a.groovy like:

Path test = new Path('test.txt')
test.

When I switch to b.groovy then nothing works.

Here is what the trace says.

[Trace - 4:56:06 AM] Sending request 'textDocument/hover - (9)'.
Params: {
    "textDocument": {
        "uri": "file:///home/shadycuz/repos/dsty/jenkins-std-lib/src/org/dsty/os/Path.groovy"
    },
    "position": {
        "line": 22,
        "character": 6
    }
}


[Trace - 4:56:06 AM] Received response 'textDocument/hover - (9)' in 3ms.
Result: {
    "contents": {
        "kind": "markdown"
    }
}

For textDocument/completion, I actually get some useful information :

[Trace - 5:06:52 AM] Sending request 'textDocument/completion - (39)'.
Params: {
    "textDocument": {
        "uri": "file:///home/shadycuz/repos/dsty/jenkins-std-lib/src/org/dsty/os/Path.groovy"
    },
    "position": {
        "line": 298,
        "character": 27
    },
    "context": {
        "triggerKind": 1
    }
}


[Trace - 5:06:52 AM] Received notification 'textDocument/publishDiagnostics'.
Params: {
    "uri": "file:///home/shadycuz/repos/dsty/jenkins-std-lib/jobs/os/path/path_example.groovy",
    "diagnostics": [
        {
            "range": {
                "start": {
                    "line": 93,
                    "character": 4
                },
                "end": {
                    "line": 93,
                    "character": 5
                }
            },
            "severity": 2,
            "message": "Unexpected input: '... CONTENTS OF THE FILE I REMOVED\n test.\\n\\n\\n    }' @ line 94, column 5."
        },
        {
            "range": {
                "start": {
                    "line": 93,
                    "character": 4
                },
                "end": {
                    "line": 93,
                    "character": 5
                }
            },
            "severity": 2,
            "message": "Unexpected input: '... CONTENTS OF THE FILE I REMOVED\n  test.\\n\\n\\n    }' @ line 94, column 5."
        }
    ]
}

maybe this is desired behavior? Not sure. I will eventually look into this.

@franzherzog
Copy link

Same here.
Do you had the chance to look into it ?

I cannot fix the "unexpected input" so easy because it lives in a external plugin 😮‍💨

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

No branches or pull requests

2 participants