*webjs.txt*  Neovim support for webjs apps

==============================================================================
CONTENTS                                                          *webjs-contents*

  1. Introduction ......................... |webjs-introduction|
  2. Requirements ......................... |webjs-requirements|
  3. Setup ................................ |webjs-setup|
  4. Commands ............................. |webjs-commands|
  5. LSP intelligence ..................... |webjs-lsp|
  6. Health ............................... |webjs-health|

==============================================================================
1. INTRODUCTION                                               *webjs-introduction*

webjs.nvim is the Neovim counterpart to the webjs VS Code extension. It adds
in-template highlighting for the `html` / `css` / `svg` tagged templates webjs
uses, and surfaces the standalone @webjsdev/intellisense language service plus a
`webjs check` diagnostics source.

Highlighting works as soon as the plugin is on the runtimepath; the treesitter
injection queries under queries/ are auto-loaded. No Lit plugin is required.

==============================================================================
2. REQUIREMENTS                                               *webjs-requirements*

- Neovim 0.10+
- Treesitter parsers: typescript, javascript, html, css (svg optional).
  Install with nvim-treesitter: `:TSInstall typescript javascript html css`
- For intelligence: Node 24+, typescript in the app, and a tsserver LSP
  client (ts_ls or typescript-tools.nvim). @webjsdev/intellisense is bundled
  inside this plugin (works with no app dependency).

Run `:checkhealth webjs` to verify.

==============================================================================
3. SETUP                                                             *webjs-setup*

>lua
  require('webjs').setup({
    cmd = 'webjs',   -- the webjs CLI used by :WebjsCheck
  })
<
setup() is optional: it only registers the user commands. Highlighting needs
no setup() call.

==============================================================================
4. COMMANDS                                                       *webjs-commands*

                                                                    *:WebjsCheck*
:WebjsCheck             Run `webjs check --json` in the current directory and
                        load the violations into |vim.diagnostic| and the
                        |quickfix| list. Open it with |:copen|.

==============================================================================
5. LSP INTELLIGENCE                                                    *webjs-lsp*

webjs.nvim BUNDLES @webjsdev/intellisense (standalone, no Lit dependency) and
points the tsserver plugin probe location at the bundled copy, so it works with
no @webjsdev/intellisense in the app. If the app also wires it via tsconfig.json
`plugins`, tsserver dedupes by name, so there is no double-load.

Two LSPs load tsserver plugins via DIFFERENT keys; pick the helper for yours.

vtsls (LazyVim's default) uses `settings.vtsls.tsserver.globalPlugins`:
>lua
  -- in nvim-lspconfig opts.servers
  vtsls = { settings = require('webjs').with_vtsls_plugin() }
<
ts_ls / typescript-tools.nvim use `init_options.plugins`:
>lua
  require('lspconfig').ts_ls.setup({
    init_options = require('webjs').with_tsserver_plugin(),
  })
<
Add the `html` and `css` treesitter parsers (`ensure_installed`) for the
template injection highlighting, which is independent of the LSP wiring.

                                                  *webjs.with_tsserver_plugin()*
require('webjs').with_tsserver_plugin({init_options})
                        Return {init_options} with the bundled
                        @webjsdev/intellisense merged into `plugins` (idempotent),
                        its `location` set to the copy vendored inside
                        webjs.nvim. For ts_ls / typescript-tools.nvim.

                                                     *webjs.with_vtsls_plugin()*
require('webjs').with_vtsls_plugin({settings})
                        Return {settings} with the bundled
                        @webjsdev/intellisense merged into
                        `vtsls.tsserver.globalPlugins` (idempotent), with
                        `enableForWorkspaceTypeScriptVersions = true`. For vtsls
                        (LazyVim). No app dependency required.

==============================================================================
6. HEALTH                                                           *webjs-health*

                                                              *:checkhealth-webjs*
`:checkhealth webjs` verifies Node 24+, the webjs CLI, and the treesitter
parsers the injection queries depend on.

vim:tw=78:ts=8:ft=help:norl:
