Editor Support
Syntax highlighting, language servers, and editor integrations for Bear. {SOON, LINKS DO NOT WORK YET}
Editors & IDEs
First-class Bear support for your favorite editor. Install from marketplace or download the latest release directly.
Visual Studio Code
Full IDE support with syntax highlighting, autocomplete, error diagnostics, and inline documentation.
ext install bear.bear-lang- Syntax highlighting
- Autocomplete (IntelliSense)
- Error diagnostics
- Go to definition
- Find references
- Inline documentation
- Snippets
Neovim
Treesitter grammar for precise syntax highlighting and an LSP configuration for full editor intelligence.
- Treesitter grammar
- LSP support
- Autocompletion
- Diagnostics
- Syntax-aware selection
-- In your init.lua
vim.api.nvim_create_autocmd("BufReadPost", {
pattern = "*.bear",
callback = function()
vim.bo.filetype = "bear"
end,
})
-- LSP config
require('lspconfig').bear_ls.setup{}Vim
Syntax highlighting via native Vim syntax files for lightweight editing.
- Syntax highlighting
- Indent rules
- Comment toggling
Helix
Built-in Treesitter support for syntax-aware editing out of the box.
- Treesitter syntax
- LSP integration
- Textobjects
- Syntax-aware selection
Sublime Text
Syntax package for Sublime Text with highlighting and build system support.
- Syntax highlighting
- Build system
- Snippet support
Emacs
Major mode for Emacs with syntax highlighting, compilation, and REPL integration.
- Syntax highlighting
- Compilation mode
- REPL integration
- Indentation
Grammar Files
Standalone grammar definitions for editors and tools that support standard grammar formats.
| Format | Description | Extension | |
|---|---|---|---|
| TextMate Grammar | Universal syntax highlighting format. Works in VS Code, Atom, Sublime Text, and any TextMate-compatible editor. | .tmLanguage | Download |
| Tree-sitter Grammar | Incremental parsing grammar for precise syntax highlighting and code analysis. Used by Neovim, Helix, and modern editors. | .so / .dll | Download |
| Highlight.js Language Definition | For embedding Bear syntax highlighting on websites and documentation. | .js | Download |
Language Server Protocol
The Bear LSP server provides editor intelligence: autocompletion, diagnostics, go-to-definition, find references, hover info, and more.
# Install the language server $ git clone --depth=1 https://github.com/bearlanguageorg/bear $ bear install --lsp # Or download the latest binary directly $ curl -sL https://github.com/bearlanguageorg/bear/releases/download/0.0.1-rew1.0/bear-lsp-0.0.1-rew1.0 -o bear-lsp $ chmod +x bear-lsp $ ./bear-lsp
LSP Features
Go to Definition
Navigate to where any symbol is defined. Jump across files, modules, and packages.
Hover Documentation
See types, function signatures, and docs on hover without leaving your editor.
Autocomplete
Context-aware suggestions for functions, types, keywords, and imported symbols.
Diagnostics
Real-time error and warning highlighting as you type, with actionable messages.
Find References
See every place a function, type, or variable is used across your entire codebase.
Code Actions
Quick fixes and refactorings suggested automatically for common patterns.
LSP Servers
bear-lsp
DownloadOfficial language server for Bear. Provides autocompletion, diagnostics, go-to-definition, find references, hover documentation, and more.
bear-analyzer
DownloadStatic analysis tool for Bear. Detects unused variables, unreachable code, and common mistakes.
Editor Configuration
Quick setup snippets for popular editors.
// settings.json { "files.associations": { "*.bear": "bear" }, "bear.lsp.enabled": true, "bear.lsp.path": "bear-lsp", "editor.formatOnSave": true, "editor.tabSize": 4 }
-- init.lua
vim.filetype.add({
extension = {
bear ="bear",
},
})
-- Treesitter config
require'nvim-treesitter.configs'.setup {
ensure_installed = { "bear" },
highlight = { enable =true },
indent = { enable =true },
}
-- LSP config
require('lspconfig').bear_ls.setup{
cmd = { "bear-lsp" },
filetypes = { "bear" },
root_dir = require('lspconfig').util.root_pattern(
"bear.mod", ".git"
),
}" .vimrc
augroup bear_ft
autocmd!
autocmd BufRead,BufNewFile *.bear setfiletype bear
augroup END
" Syntax highlighting (after installing bear-vim)
syntax on
filetype plugin indent on# languages.toml [[language]] name ="bear" source-suffix =".bear" grammar ="bear" [[language.auto-pairs]] open ="(" close =")" [[language.auto-pairs]] open ="'" close ="'" [[language.auto-pairs]] open ='"' close ='"' [[language.debugger]] name ="bear-lsp" transport ="stdio" command ="bear-lsp", "languages.toml"
// Preferences > Package Settings > Bear// Bear.sublime-settings { "syntax": "Packages/Bear/Bear.sublime-syntax", "tab_size": 4, "translate_tabs_to_spaces": true } // Build system: Tools > Build System > Bear// Or save as Bear.sublime-build in your User/ folder
;; init.el (use-package bear-mode :ensure t :mode "\\.bear\\'" :config (add-hook 'bear-mode-hook #'eglot-ensure)) ;; LSP via eglot ;; Bear LSP will start automatically for .bear files ;; after bear-lsp is installed and on your PATH