Skip to content

Commit

Permalink
v0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
netmute committed Nov 21, 2024
1 parent 8f7d0d4 commit 2df80e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 25 deletions.
15 changes: 1 addition & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,4 @@

A Language Server Protocol (LSP) implementation using `ctags` for code completion and go-to definition.

This won't replace dedicated language servers. It is intended as a "better than nothing" polyglot language server for projects were configuring a dedicated lsp isn't worth your time.

## Features

- **Code Completion**: Offers suggestions based on `ctags` output.
- **Go to Definition**: Jump to definitions within project files.

## Installation

Ensure `universal-ctags` is installed:

```sh
brew install universal-ctags
```
This won't replace your dedicated language server, and it doesn't try to. The goal is to have a "better than nothing" language server that's trivial to setup for any language.
15 changes: 4 additions & 11 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,19 +217,12 @@ func getInstallInstructions() string {
}
}

// checkCtagsInstallation verifies that Universal Ctags is installed and available
// checkCtagsInstallation verifies that Universal Ctags is installed and supports required features
func checkCtagsInstallation() error {
cmd := exec.Command("ctags", "--version")
cmd := exec.Command("ctags", "--version", "--output-format=json")
output, err := cmd.Output()
if err != nil {
if _, ok := err.(*exec.ExitError); ok {
return fmt.Errorf("incorrect ctags version. Universal Ctags is required.\n%s", getInstallInstructions())
}
return fmt.Errorf("ctags command not found.\n%s", getInstallInstructions())
}

if !strings.Contains(string(output), "Universal Ctags") {
return fmt.Errorf("incorrect ctags version. Universal Ctags is required.\n%s", getInstallInstructions())
if err != nil || !strings.Contains(string(output), "Universal Ctags") {
return fmt.Errorf("ctags command not found or incorrect version. Universal Ctags with JSON support is required.\n%s", getInstallInstructions())
}

return nil
Expand Down

0 comments on commit 2df80e9

Please sign in to comment.