-
Notifications
You must be signed in to change notification settings - Fork 62
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
Completion: add support for keywords like public, class, etc. #21
Comments
I don't think that completion for keywords like |
Except for the keyword like public, class, etc, some situations about the completion for local variable also return null, like the following cases. Case 1:
In the Case 1, deleting the code snippet Case 2:
In Case 2, deleting the last Is there any standard about the completion rules? Or there are some code snippets that I can debug to find its completion rules? Since the project is developed based on many jar packages, it is hard to locate the completion rule of the LSP server. |
Yes, syntax errors can cause completion to fail. The language server uses the Groovy compiler, which expects to receive valid syntax. The language server has a few simple workarounds for basic syntax errors, but it is not comprehensive. Your syntax needs to be mostly correct, including proper brackets for things like classes and methods. The completion code may be found here in Some workarounds for bad syntax may be found here (see the |
To test the completion function of the server, I run the java file
groovy-language-server/src/test/java/net/prominic/groovyls/GroovyServicesCompletionTests.java
and successfully output the result. For example, when I let the input content be:The position (3, 10) will return the label
localVar
.However, when I let the input content be:
The position (0, 4) return null,which I think it should return the label
class
.And when I let the input content be:
The position (1, 7) also return null, which I think it should return the label
public
.Such situation that the completion result is null is common. So I want to consult why these cases happen and how can I get the ideal completion results.
Looking forward for your answers, thanks!
The text was updated successfully, but these errors were encountered: