- 
                Notifications
    
You must be signed in to change notification settings  - Fork 150
 
feat: add Beta support for Inline Completion Request #886
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
feat: add Beta support for Inline Completion Request #886
Conversation
| 
           Adds the inline completion request as proposed for LSP 3.18 (https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#textDocument_inlineCompletion). I have added the Beta annotation as suggested in #856 but this makes tests fail because this dependency is not allowed. There are also some problems with the javadoc which I have not yet figured out. If you are interested in the PR, I would clean this up. Are you interested in the PR? In that case, since this is my first contribution to the project, do you see any problem in how I translated the spec to the Xtend file? Thanks  | 
    
| 
           Thanks so much @rubenporras to work on this issue. LSP4IJ (LSP support for IntelliJ) is super interested with that, we wait for this support redhat-developer/lsp4ij#643  | 
    
a7da334    to
    811ff81      
    Compare
  
    811ff81    to
    b196f8b      
    Compare
  
    | 
           @rubenporras Congratulations on your first contribution! It is really appreciated. I have already started a review.  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rubenporras I have completed the first round of review. If possible, please address review comments with a separate commit. Thank you for your time and effort!
        
          
                org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/Protocol.xtend
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/Protocol.xtend
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/Protocol.xtend
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/Protocol.xtend
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/Protocol.xtend
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/services/TextDocumentService.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/Protocol.xtend
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/Protocol.xtend
              
                Outdated
          
            Show resolved
            Hide resolved
        
      | 
           @pisv, thanks a lot for the thorough review. I have addressed all the comment but the ones about indentation being a bit off because I could not figure it out. I have also fixed the errors reported in the javadoc when running the gradle build. I still need advice on how to fix the problem with the Beta annotation. At the moment the annotation makes the Lsp4jArchitectureTest.testNoDependenyToGuava fail.  | 
    
| 
           I have been looking at Lsp4jArchitectureTest.testNoDependenyToGuava, and my proposal would be that to avoid the dependency we can declare our own Beta annotation in a new package org.eclipse.lsp4j.annotations. That should be straightforward.  | 
    
| 
           +1 for declaring our own   | 
    
| 
           @rubenporras Unfortunately, I will not be able to make another round of thorough review until next week. But rest assured that your work is much appreciated! Thank you.  | 
    
| 
           Thanks for the input. I have added another commit on top with an own Beta annotation. I will also not be available until next Tuesday. I guess you will enjoy the Easter time the same as I :).  | 
    
| 
           Thanks for the input. I have added another commit on top with an own Beta annotation. I will also not be available until next Tuesday. I guess you will enjoy the Easter time the same as I will :).  | 
    
        
          
                org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/Protocol.xtend
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/InlineCompletionTriggerKind.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/Protocol.xtend
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/Protocol.xtend
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/Protocol.xtend
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/services/TextDocumentService.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/services/TextDocumentService.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/Protocol.xtend
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                org.eclipse.lsp4j.jsonrpc/src/main/java/org/eclipse/lsp4j/jsonrpc/Beta.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
      There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rubenporras So, I've done my best to review your changes against the spec, and they look good to me now. In particular, I have verified that the mapping of the relevant spec constructs to LSP4J looks correct. Thank you for the great work! 👍
Let us wait for feedback from @jonahgraham regarding the Beta annotation...
        
          
                org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/Protocol.xtend
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/Protocol.xtend
              
                Outdated
          
            Show resolved
            Hide resolved
        
      | 
           @pisv , thanks for your review.  | 
    
| 
           @rubenporras Would you push the commit with the latest changes? :-) Thanks!  | 
    
          
 You mean, I should rebase, squash and push?  | 
    
| 
           No, I mean that you have resolved the three final nitpicks I left after the latest round of review, but have not pushed the changes yet, as far as I can see :-)  | 
    
| 
           Sorry, done by now  | 
    
| 
           Great, thank you!  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I approve this PR from my side, because all my comments have been properly addressed, but cannot merge it until @jonahgraham has an opportunity to review the current state and submit feedback. (By way of reminder, there is an open question about the Beta annotation.)
| 
           @jonahgraham ping on the feedback regarding the Beta annotation.  | 
    
| 
           @pisv , it looks like we cannot get the review from @jonahgraham. I propose that I change the javadoc comment to something more straight forward and sidestep the problem. Do you agree?  | 
    
| 
           (Sorry for being a little delinquent here - I have been unavailable for much of the last two months)  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if copying Beta source here is ok. It is trivial, so in that way I think it is ok, but adding the apache licensed file certainly complicates things.
Can we create our own Beta class (like @LSP4JBeta or @BetaLSP)?
| 
           @jonahgraham Hope you are doing well, and sorry for bothering you! Thank you for your helpful review. If I understood you correctly, the main thing about this annotation is that it needs to be implemented from scratch and contributed under the project's license. And, while the name of the annotation is probably not very important in this regard, you are proposing to choose a name different from the current  If I may still have your attention, another question about this PR or, rather, our next release in general is that would it be fine to have it merged as part of the   | 
    
          
 I am (enough) - and you aren't bothering me :-) 
 Yes on all accounts. Note that there is probably only one way to implement such an annotation, and that there are probably no IP issues with that one way of doing it, so I would expect that the "LSPBeta" or whatever it is called, may look a lot like guava's Beta. 
 Yes that was intention. 
 No, not really important. The idea of 1.0 release is that from that point forward we are going to be API versioned according to semantic versioning.  | 
    
| 
           Got it. Thanks a lot for the swift response, and all your comments!  | 
    
          
 I think as well there is not much to deviate other than from the comment. I think it should be enough if I write the javadoc from scratch. I would keep the name   | 
    
| 
           No objection from me to calling it Beta.  | 
    
| 
           I have renamed it to Draft, which in our case conveys better what it is  | 
    
          
 +1  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent! Thanks a lot for your contribution, @rubenporras 👍
No description provided.