coldfusion completion source nvim-cmp
- Lua 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| lua/cfcomplete | ||
| plugin | ||
| logo.svg | ||
| README.md | ||
cfcomplete.nvim
A Neovim plugin for ColdFusion code completion based on JSON definitions for cfdocs.
Features
- Tag completion for ColdFusion tags (
<cfquery>, etc.) - Documentation display for tags and attributes
- Based on cfdocs JSON definitions
Planned features
- CfScript completion
- Attribute completion for ColdFusion tags
- Snippet insertion for common tag patterns
- Auto-update of JSON definitions from cfdocs
- Context-aware completion (e.g., inside
<cfquery>) (if this is even possible) - Support for ColdFusion functions and built-in variables
Configuration
You can configure the plugin by passing options to the setup function:
require('cfcomplete').setup({
-- Default configuration
json_path = vim.fn.stdpath('data') .. '/cf_definitions',
file_patterns = {'*.cfm', '*.cfc'},
enable_documentation = true, --does not work as now
})
Installation
Using lazy.nvim:
{
'https://codeberg.org/oricat/cfcomplete.nvim',
dependencies = { 'hrsh7th/nvim-cmp' },
config = function()
require('cfcomplete').setup({
json_path = '/home/ori/lucee-docs-json', -- Path to directory with JSON files
file_patterns = {'*.cfm', '*.cfc'}, -- File patterns to activate completion
enable_documentation = true, -- Enable documentation in completion popups
})
end
},
{
"hrsh7th/nvim-cmp",
version = false,
event = "InsertEnter",
config = function()
local cmp = require("cmp")
cmp.setup({
sources = cmp.config.sources({
{ name = 'cfcomplete', priority = 1000 },
}),
})
end
}
Using Nixvim:
{ pkgs, ... }:
{
programs.nixvim = {
extraPlugins = [
(pkgs.vimUtils.buildVimPlugin {
name = "cfcomplete.nvim";
src = pkgs.fetchgit {
url = "https://codeberg.org/oricat/cfcomplete.nvim";
sha256 = ""; #insert the current hash
};
dependencies = [pkgs.vimPlugins.nvim-cmp];
})
];
extraConfigLua = let
lucee-docs-json = pkgs.fetchzip {
url = "https://docs.lucee.org/lucee-docs-json.zip";
sha256 = ""; #insert the current hash
stripRoot = false;
};
in ''
require('cfcomplete').setup({
json_path = '${lucee-docs-json}',
file_patterns = {'*.cfm', '*.cfc'},
enable_documentation = true,
})
'';
};
}
JSON Definition Format
The plugin expects JSON files in the same format as cfdocs:
plese note that a collection of these generated for lucee these can be downloaded from: https://docs.lucee.org/lucee-docs-json.zip .
{
"engines": {
"lucee": {
"docs": "https://docs.lucee.org/reference/tags/query.html",
"minimum_version": ""
}
},
"name": "cfquery",
"description": "Passes SQL statements to a data source. Not limited to queries.",
"syntax": "<cfquery/>",
"returns": "void",
"type": "tag",
"params": [
{
"name": "name",
"description": "The name query...",
"default": false,
"type": "string",
"required": false
},
// ... more parameters ...
]
}