|
| 1 | +local util = require 'lspconfig.util' |
| 2 | + |
| 3 | +return { |
| 4 | + default_config = { |
| 5 | + cmd = { 'fountain-lsp-server', '--stdio' }, |
| 6 | + filetypes = { |
| 7 | + 'fountain', |
| 8 | + }, |
| 9 | + root_dir = function(fname) |
| 10 | + local root_files = { '.fountainrc' } |
| 11 | + return util.root_pattern(unpack(root_files))(fname) |
| 12 | + or vim.fs.dirname(vim.fs.find('.git', { path = fname, upward = true })[1]) |
| 13 | + end, |
| 14 | + single_file_support = true, |
| 15 | + }, |
| 16 | + docs = { |
| 17 | + description = [[ |
| 18 | +https://github.com/oparaskos/fountain-lsp-server |
| 19 | +
|
| 20 | +This is a Language Server for fountain files, a simple markup syntax for writing, editing, and sharing screenplays in plain, human-readable text. |
| 21 | +
|
| 22 | +The language server is built on vscode-languageserver but should be flexible to use with other IDEs. |
| 23 | +
|
| 24 | +- Code Completions for Title Page attributes, scene headings, etc. |
| 25 | +- CodeLens support for characters, scenes and locations. |
| 26 | +- Statistics to be consumed by a webview, by character, location and scene; and more granularly by character gender and race. |
| 27 | +
|
| 28 | +If installed through NPM then there should be a binary fountain-lsp-server in node_modules/.bin |
| 29 | +
|
| 30 | +Otherwise you can use node dist/bundle.cjs.js [options] from the package file in GitHub releases or import dist/server from the node module to roll it into your own application. |
| 31 | +
|
| 32 | +The project introduces the concept of a .fountainrc file to specify additional details about characters, the schema for which is in the root of this project. |
| 33 | +
|
| 34 | +The extension will also attempt to guess gender of characters based on name, this only supports en and it locales and makes incorrect assumptions often (e.g. Sam is always regarded as a male name, even though it can be a shortened form of Samantha), but provides a reasonable basis as a default to be overriden. |
| 35 | + ]], |
| 36 | + }, |
| 37 | +} |
0 commit comments