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

Issue executing example #1

Open
didos36 opened this issue Mar 19, 2018 · 7 comments
Open

Issue executing example #1

didos36 opened this issue Mar 19, 2018 · 7 comments

Comments

@didos36
Copy link

didos36 commented Mar 19, 2018

Hello,

As a beginner with Xtext LSP integration, i'm currently to play with this example, and I'm hitting some strange issues.

  1. For instance, after lauching the demo in vscode, and editing a file named b.mydsl with this content:
    `package foo {

    entity Bar {

    op test() : String {
    ""
    }
    }

}`

i'm getting this error message:
"The type Bar is already defined in b.mydsl."

Here is a trace I'm getting from LSP protocol if I'm not wrong.

[Trace - 15:43:47] Received notification 'textDocument/publishDiagnostics'. Params: { "uri": "file:///xxxxxx/git/xbase-languageserver-example/demo/src/b.mydsl", "diagnostics": [ { "range": { "start": { "line": 2, "character": 11 }, "end": { "line": 2, "character": 14 } }, "severity": 1, "code": "org.eclipse.xtext.xbase.validation.IssueCodes.duplicate_type", "message": "The type Bar is already defined in b.mydsl." } ] }

  1. When i'm editing package name, generation happened after each hitting keyboard, and as a result I'm getting a directory tree corresponding to each intermediate package name, I mean, to enter a package name like 'name1', I will get a folder named as 'n' then 'na' then 'nam','name', and finally 'name1"

Do you have any clue that can help me?

@cdietrich
Copy link
Owner

  1. you can disable the generator by binding a IGenerator that does nothing
  2. i assume the validation needs to be adopted for that (see UniqueClassNameValidator)

will have a look at both points when i have time. (likely next week)

cdietrich added a commit that referenced this issue Mar 19, 2018
Signed-off-by: Christian Dietrich <christian.dietrich@itemis.de>
@cdietrich
Copy link
Owner

@didos36
Copy link
Author

didos36 commented Mar 20, 2018

Thanks a lot! That was quite fast.

I've checkout cd_issue1 branch, did a gradle clean startCode, but I'm still getting same error:

[Trace - 07:11:33] Received notification 'textDocument/publishDiagnostics'. Params: { "uri": "file:///c%3A/Users/xxxxx/git/xbase-languageserver-example/demo/src/test2.mydsl", "diagnostics": [ { "range": { "start": { "line": 2, "character": 11 }, "end": { "line": 2, "character": 22 } }, "severity": 1, "code": "org.eclipse.xtext.xbase.validation.IssueCodes.duplicate_type", "message": "The type SuperEntity is already defined in test2.mydsl." } ] }

At the begining, I got some error related to duplicate type definition, like SuperEntity is already defined in SuperEntity.java file, but those one disappeared after installer Java extension in vscode. Your fix seems related to this error if I'm correct.

In addition, it seems quite unstable, for instance, sometime if I'm update Entity Name, nothing

@cdietrich
Copy link
Owner

Are you sure you really rebuilt everything on the new branch?

Did you debug the validator. This could be an encoding issue too.

Unfortunately I don’t have a windows machine to debug myself for the next few days

First I saw the same issue but after my fix it works but I am not sure if my fix works on windows

@didos36
Copy link
Author

didos36 commented Mar 28, 2018

Hello,

Yes I'm sure I've built everything on branch 'cd_issue1' with a gradle clean startCode.

Just to be sure we are talking about the same error, the error message is : "message": "The type SuperEntity is already defined in test2.mydsl." so related to test2.mydsl file extension not java extension.

@cdietrich
Copy link
Owner

cdietrich commented Mar 28, 2018

As I said: this needs to be debugged . Maybe you can change the validation to print both complete uris in the message

@cdietrich
Copy link
Owner

could be eclipse/xtext-core#528
can you please test with 2.14.0-SNAPSHOT (should be in the sonatype oss repo at https://oss.sonatype.org/content/repositories/snapshots/)

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