Skip to content

Multiple server completion support#480

Closed
DanielViberg wants to merge 7 commits intoyegappan:mainfrom
DanielViberg:main
Closed

Multiple server completion support#480
DanielViberg wants to merge 7 commits intoyegappan:mainfrom
DanielViberg:main

Conversation

@DanielViberg
Copy link
Contributor

@DanielViberg DanielViberg commented Mar 16, 2024

  • Working mult server compl
  • Removed time measure prop
  • Tweaked LspResolver to be server id dependent
  • Fixed text complete server dependent
  • Reset tests

Purpose: Volar 2 support

Note, should propbably be tested by more people before being merged to main!

Config

{
      "name": "vue-ls",
      "filetype": ["vue"],
      "path": "vue-language-server",
      "args": ["--stdio"],
      "features": {
        "definition": true,
        "rename": true
      },
      "initializationOptions": {
          "typescript": {
              "tsdk": "../node/v20.11.0/lib/node_modules/typescript/lib"
          }
      },
    },
    {
      "name": "ts-ls",
      "filetype": ["typescript", "javascript", "vue"],
      "path": "typescript-language-server",
      "args": ["--stdio"],
      "features": {
        "documentFormatting": false,
        "definition": true,
        "rename": true
      },
      "initializationOptions": {
          "plugins":[
            {
              "name": "@vue/typescript-plugin",
              "location":".../node/v20.11.0/lib/node_modules/@vue/typescript-plugin",
              "languages": ["vue"]
            }
          ]
      }
   }

Status:

  • completions
    • auto imports
  • diagnostics
  • definitions (working in some cases, but not all)
  • references

@DanielViberg
Copy link
Contributor Author

I noticed need for cleanup, will update soon.

@DanielViberg
Copy link
Contributor Author

vuejs/language-tools#3925 (comment) Volar now does not need tsserver running in parallel. Parking this pr until future need.

@DanielViberg
Copy link
Contributor Author

DanielViberg commented Jan 10, 2025

The above configuraion now works using https://github.com/DanielViberg/lsp/tree/dev-refactor. Only for completions, diag and rename so far. I have not validated all logic yet.
@maximyurevich

@briancarbone
Copy link

I'm surprised rename can done with multiple language servers. I quite liked the solution here which explicitly resolves which completion source should be used given the syntactical context: #496. Ultimately, I think only diagnostics and completions need "layering"; the obvious cases are efm-langserver or @tailwindcss/language-server underneath something else. Are there other LSP features that would benefit from a layered approach?

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

Successfully merging this pull request may close these issues.

2 participants