Skip to content

feat: implement completion and inlineCompletion using LS

Tomas Vik requested to merge tv/2023-10/language-server-development into main

Description

This MR updates node version to the current VS Code version so we can link the language server project. It also documents how to develop VS Code Extension connected to the GitLab language server.

We had to change the way we bundle LS https://gitlab.com/gitlab-org/editor-extensions/gitlab-language-server-for-code-suggestions/-/merge_requests/62 and so we change the LS reference from main.js to main-bundle.js.

For this MR to work, you have to apply https://gitlab.com/gitlab-org/editor-extensions/gitlab-language-server-for-code-suggestions/-/merge_requests/62+ to the Language Server project.

However, since the Language Integration doesn't work at the moment (without this MR and https://gitlab.com/gitlab-org/editor-extensions/gitlab-language-server-for-code-suggestions/-/merge_requests/62), we can safely merge without syncing.

Related Issues

Relates to #1049 (closed)

How has this been tested?

I run the extension and LS in local development and tested that completion works.

  1. Make sure you have the following settings in your settings.json

    • Only one project can now have "gitlab.featureFlags.languageServer" set to true, because the LS now starts on a port and only one language server can be started on the system
    {
      "gitlab.featureFlags.languageServer":true,
      "gitlab.aiAssistedCodeSuggestions.enabled": true,
    }
    
  2. Go somewhere in your code and press ctrl + space

  3. see the suggestion

    image

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation
  • Chore (Related to CI or Packaging to platforms)
  • Test gap
Edited by Tomas Vik

Merge request reports