# basics-language-server

> Buffer, path, and snippet completions

Latest version **1.1.2** (published 2024-12-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install basics-language-server
pnpm add basics-language-server
yarn add basics-language-server
bun add basics-language-server
```

Provides the command `basics-language-server`.

## Health

**Score 30/100 (F)** — status: maintenance-mode.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2024-12-04 |
| First published | 2024-10-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=18.0.0 |
| Dependencies | 8 |
| Unpacked size | 47.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 76 |
| Author | antonk52 |
| Maintainers | antonk52 |
| Keywords | completion, language server, lsp |

## Links

- npm: https://www.npmjs.com/package/basics-language-server
- Repository: https://github.com/antonk52/basics-language-server
- Homepage: https://github.com/antonk52/basics-language-server#readme
- Issues: https://github.com/antonk52/basics-language-server/issues
- Funding: https://github.com/sponsors/antonk52
- npm.io page: https://npm.io/package/basics-language-server

## Dependencies (8)

- [fast-glob](https://npm.io/package/fast-glob.md) ^3.3.2
- [vscode-uri](https://npm.io/package/vscode-uri.md) ^3.0.8
- [superstruct](https://npm.io/package/superstruct.md) ^2.0.2
- [isbinaryfile](https://npm.io/package/isbinaryfile.md) ^5.0.2
- [jsonc-parser](https://npm.io/package/jsonc-parser.md) ^3.3.1
- [vscode-languageserver](https://npm.io/package/vscode-languageserver.md) ^9.0.1
- [vscode-languageserver-protocol](https://npm.io/package/vscode-languageserver-protocol.md) ^3.17.5
- [vscode-languageserver-textdocument](https://npm.io/package/vscode-languageserver-textdocument.md) ^1.0.12

## Recent versions

- 1.1.2 (latest) — 2024-12-04
- 1.1.1 — 2024-10-25
- 1.1.0 — 2024-10-25
- 1.0.2 — 2024-10-17
- 1.0.1 — 2024-10-12
- 1.0.0 — 2024-10-09
- 0.3.1 — 2024-10-08
- 0.3.0 — 2024-10-07
- 0.2.0 — 2024-10-06
- 0.1.0 — 2024-10-04

## README

# basics-language-server

Features:

* **Buffer completion** - complete words that are already in the buffer
* **Path completion** - complete file paths relative from buffer or absolute
* **Snippet completion** - complete custom snippets or from packages (like [friendly-snippets](https://github.com/rafamadriz/friendly-snippets))

To install:

```bash
npm install -g basics-language-server
```

## Usage with neovim

The server is available in [`nvim-lspconfig`](https://github.com/neovim/nvim-lspconfig). Start the server with 

```lua
require('lspconfig').basics_ls.setup({})
```

## Settings

```lua
require('lspconfig').basics_ls.setup({
    settings = {
        buffer = {
            enable = true,
            minCompletionLength = 4 -- only provide completions for words longer than 4 characters
            matchStrategy = 'exact', -- or 'fuzzy'
        },
        path = {
            enable = true,
        },
        snippet = {
            enable = false,
            sources = {} -- paths to package containing snippets, see examples below
            matchStrategy = 'exact', -- or 'fuzzy'
        },
    }
})
```

### Settings snippet sources

`snippet.sources` can be a string or a list of strings. The strings should be absolute paths (or globs that resolve to paths) to one of either:
- Directory containing snippets. Example: `'/home/user/snippets'` which contains `python.json`
- Directory containing `package.json` that defines per language snippets in a [VS Code extension API format](https://code.visualstudio.com/api/references/contribution-points#contributes.snippets).
- Path to `package.json` that defines per language snippets in a [VS Code extension API format](https://code.visualstudio.com/api/references/contribution-points#contributes.snippets).
- A json or jsonc file where its name is the language id and its content is snippets. Example: `'/home/user/snippets/python.json'`. See [VS Code example](https://code.visualstudio.com/docs/editor/userdefinedsnippets#_create-your-own-snippets) for format

---
_Source: https://npm.io/package/basics-language-server · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
