mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-11-24 21:19:37 +00:00
Some checks failed
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / build-vsc-assets (push) Has been cancelled
tinymist::ci / build-vscode (push) Has been cancelled
tinymist::ci / build-vscode-others (push) Has been cancelled
tinymist::ci / publish-vscode (push) Has been cancelled
tinymist::ci / build-binary (push) Has been cancelled
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Has been cancelled
* fix: bad link * feat(neovim): init lsp * feat(neovim): add bootstrap script * build: add notice
30 lines
976 B
Lua
30 lines
976 B
Lua
---@brief [[
|
|
--- Tests for basic (auto-)attaching of LSP clients.
|
|
---@brief ]]
|
|
|
|
local fixtures = require 'spec.fixtures'
|
|
local helpers = require 'spec.helpers'
|
|
|
|
require('tinymist').setup {}
|
|
|
|
describe('LSP', function()
|
|
assert.is.empty(vim.lsp.get_clients { bufnr = 0, name = 'tinymist', _uninitialized = true })
|
|
|
|
it('is attached to .typ files within projects', function()
|
|
vim.cmd.edit(fixtures.project.some_existing_file)
|
|
assert.is.same(1, #vim.lsp.get_clients { bufnr = 0, name = 'tinymist', _uninitialized = true })
|
|
end)
|
|
|
|
it(
|
|
'is attached to single .typ files',
|
|
helpers.clean_buffer(function()
|
|
assert.is.same(1, #vim.lsp.get_clients { bufnr = 0, name = 'tinymist', _uninitialized = true })
|
|
end)
|
|
)
|
|
|
|
it('is not attached to non-typst files', function()
|
|
vim.cmd.split 'some_non_typst_file.tmp'
|
|
assert.is.empty(vim.lsp.get_clients { bufnr = 0, name = 'tinymist', _uninitialized = true })
|
|
vim.cmd.close { bang = true }
|
|
end)
|
|
end)
|