/tagls

Language server based on gtags

Primary LanguagePythonApache License 2.0Apache-2.0

tagls

PyPI Version !pyversions license PRs Welcome

tagls is a language server based on gtags.

Why I wrote it?

Almost all modern editors have great support to LSP, but language servers based on semantic are not always reliable (for example, in dynamic languages like Python).

On the other hand, the good old gtags has more comprehensive (sometimes verbose, though) result, but it is not the first class citizen of modern editors and is usually poorly supported.

A language server based on gtags can give you the best of both worlds.

Usage

Install tagls by pip3 install tagls and register it in your code editor. For example, in coc.nvim:

  "languageserver": {
    "tagls": {
      "command": "python3",
      "args": ["-m", "tagls"],
      "filetypes": [
        "c",
        "cpp",
        "python"
      ],
      "initializationOptions": {},
      "settings": {}
    }
  }

Supported

  • initialize (Auto create/update gtags tag files when opening a project in the editor)
  • textDocument/didSave (auto update gtags tag files when a file is updated)
  • textDocument/definition
  • textDocument/references
  • textDocument.documentSymbol
  • workspace/symbol

Todo

  • Per-feature configuration (e.g. disable every feature but 'textDocument/references')