Skip to content

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

@shadycuz

Description

@shadycuz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions