Repository navigation
Language Server
The poefilterx CLI exposes a fully functional Language Server Protocol (LSP) server for .filterx filters and .fss stylesheets. It provides completion, error and warning diagnostics, hover documentation, signature help, go to definition, find references, symbol renaming, document formatting, symbol search, folding, semantic highlighting, color previews, and code actions. The features available in your editor depend on its LSP client.
VS Code is our first-class supported editor. The PoeFilterX extension ships with the language server built in and handles setup for you. See Using VS Code for installation and usage.
For every other editor below, first install the .NET 11 SDK and install PoeFilterX globally:
https://dotnet.microsoft.com/en-us/download
dotnet tool install --global PoeFilterX
poefilterx --versionTo update an existing installation, run dotnet tool update --global PoeFilterX. See Microsoft's global tool installation reference.
Make sure your editor can find poefilterx on its PATH. Global tools normally live in $HOME/.dotnet/tools on Linux and macOS, or %USERPROFILE%\.dotnet\tools on Windows. Restart your editor after installation. If necessary, use the full path to poefilterx (or poefilterx.exe on Windows) in place of the executable name in the configurations below. For remote editing, install the tool in the environment where the editor runs its language servers.
All examples start the server with:
poefilterx language-server --stdio- Open Settings > Languages & Frameworks > Language Servers and click Add LSP Server.
- Set Name to
PoeFilterXand Executable path to the full path of your globally installedpoefilterxexecutable. - Set Arguments to
language-server --stdio, replacing the default arguments. IntelliJ IDEA's current documentation describes a bundled LSP Connection Manager. If your version includes it: - Add
*.filterxand*.fssunder File name patterns, then click OK. - Open a matching file in a trusted project. The Language Services status bar widget shows the running server.
See the IntelliJ IDEA language server guide.
If your IDE does not include the aformentioned connection manager, use LSP4IJ, subject to its listed IDE compatibility:
- Install LSP4IJ through Settings > Plugins > Marketplace and restart if prompted.
- Open Settings > Languages & Frameworks > Language Servers, then click + to create a user-defined server.
- In the Server tab, set the name to
PoeFilterXand the command topoefilterx language-server --stdio. Keep the stdio transport. Quote the executable path if you use a full path containing spaces. - In Mappings, add file name patterns
*.filterxand*.fss, with language IDsfilterxandfssrespectively. - Save the configuration and open a matching file.
See the LSP4IJ user-defined server guide.
Use Neovim 0.11 or later, which provides vim.lsp.config and vim.lsp.enable directly. Add this to your init.lua:
vim.filetype.add({
extension = {
filterx = 'filterx',
fss = 'fss',
},
})
vim.lsp.config('poefilterx', {
cmd = { 'poefilterx', 'language-server', '--stdio' },
filetypes = { 'filterx', 'fss' },
root_dir = function(bufnr, on_dir)
on_dir(vim.fs.root(bufnr, { 'entrypoint.filterx', '.git' })
or vim.fn.getcwd())
end,
on_attach = function(client, bufnr)
vim.lsp.completion.enable(true, client.id, bufnr, {
autotrigger = true,
})
end,
})
vim.lsp.enable('poefilterx')Restart Neovim from your project directory and open a .filterx or .fss file. Run :checkhealth vim.lsp to inspect the configuration. Use K for hover documentation and :lua vim.lsp.buf.format() to format the document.
See the Neovim LSP documentation for further details.
For Vim 9 or later, install yegappan/lsp using your plugin manager. Alternatively, on Linux or macOS, install it as a native Vim package:
git clone https://github.com/yegappan/lsp "$HOME/.vim/pack/downloads/opt/lsp"
vim -u NONE -c "helptags $HOME/.vim/pack/downloads/opt/lsp/doc" -c qWith the native installation, add this to your .vimrc:
packadd lsp
filetype plugin indent on
augroup poefilterx_filetypes
autocmd!
autocmd BufRead,BufNewFile *.filterx setfiletype filterx
autocmd BufRead,BufNewFile *.fss setfiletype fss
augroup END
call LspAddServer([{
\ 'name': 'PoeFilterX',
\ 'filetype': ['filterx', 'fss'],
\ 'path': exepath('poefilterx'),
\ 'args': ['language-server', '--stdio']
\ }])If you use a plugin manager that loads the plugin later, register the server through its documented User LspSetup event instead of calling LspAddServer before the plugin loads.
Restart Vim from your project directory and open a matching file. Use :LspShowAllServers to inspect registered servers, :LspHover for documentation, and :LspFormat to format. See the plugin's installation and configuration guide.
Use Emacs 29 or later, which includes Eglot. Add the following to your Emacs configuration; the two minimal modes associate PoeFilterX files with Eglot:
(define-derived-mode filterx-mode prog-mode "FilterX")
(define-derived-mode fss-mode prog-mode "FSS")
(add-to-list 'auto-mode-alist '("\\.filterx\\'" . filterx-mode))
(add-to-list 'auto-mode-alist '("\\.fss\\'" . fss-mode))
(with-eval-after-load 'eglot
(add-to-list 'eglot-server-programs
'((filterx-mode fss-mode)
. ("poefilterx" "language-server" "--stdio"))))Evaluate the configuration or restart Emacs, open a matching file, then run M-x eglot. A successful connection appears in the mode line. Emacs uses its normal completion, ElDoc, Flymake, and Xref interfaces for the server's features.
For automatic startup, add:
(add-hook 'filterx-mode-hook #'eglot-ensure)
(add-hook 'fss-mode-hook #'eglot-ensure)See the Eglot manual's server setup and startup instructions.
- Run Package Control: Install Package from the Command Palette and select LSP.
- Open Preferences > Browse Packages…. Create
User/PoeFilterX.sublime-syntaxwith this minimal file association:
%YAML 1.2
---
name: PoeFilterX
file_extensions: [filterx, fss]
scope: source.poefilterx
contexts:
main: []- Run Preferences: LSP Server Configurations from the Command Palette, or open Preferences > Package Settings > LSP > Server Configurations. Add this entry to
LanguageServers.sublime-settings, preserving any existing entries:
{
"poefilterx": {
"enabled": true,
"command": ["poefilterx", "language-server", "--stdio"],
"selector": "source.poefilterx"
}
}- Open your project folder and reopen a
.filterxor.fssfile. Select the PoeFilterX syntax if the file already had another syntax assigned. The server name appears in the status bar when it starts.
Older LSP releases without Server Configurations use Preferences > Package Settings > LSP > Settings: put the poefilterx entry inside the top-level "clients" object in LSP.sublime-settings instead.
See the LSP client configuration guide and Sublime's syntax definition reference.
Add this to languages.toml in your Helix configuration directory, or to .helix/languages.toml in your project:
[language-server.poefilterx]
command = "poefilterx"
args = ["language-server", "--stdio"]
[[language]]
name = "filterx"
scope = "source.filterx"
file-types = ["filterx"]
roots = ["entrypoint.filterx", ".git"]
language-servers = ["poefilterx"]
[[language]]
name = "fss"
scope = "source.fss"
file-types = ["fss"]
roots = ["entrypoint.filterx", ".git"]
language-servers = ["poefilterx"]The user configuration directory is normally ~/.config/helix on Linux and macOS, or %AppData%\helix on Windows. Restart Helix from your project directory and open a matching file. Run hx --health filterx or hx --health fss in a terminal to check language server discovery.
See the Helix language configuration reference and configuration locations.
Eclipse's LSP4E supports configuring a server through the UI. Its maintainers describe this route as useful for testing and recommend a dedicated Eclipse plugin for production integration.
- If LSP4E is missing, use Help > Install New Software… with its latest release update site, install LSP4E, and restart Eclipse.
- In Preferences > General > Content Types, create a content type derived from Text and associate
*.filterxand*.fsswith it. - Under Run > External Tools > External Tools Configurations…, create a Program launch configuration. Set Location to the full path of
poefilterx, Arguments tolanguage-server --stdio, and the working directory to your filter project. Save it; LSP4E will launch it when needed. - In Preferences > Language Servers, use Add… in the launch configuration association area to bind your content type to that launch configuration in run mode. Apply the changes.
- Open a matching file with Open With > Generic Editor. Close and reopen files that were already open.
See LSP4E installation and its configuration guide.
🚧 Work in Progress 🚧
🚧 Work in Progress 🚧