From 223a85baca14150400e324ae39196be87822e265 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 29 Aug 2019 14:20:24 +0300 Subject: [PATCH] CCLS LSP for VIM // Resolve #2952 --- HISTORY.rst | 1 + docs | 2 +- platformio/ide/tpls/vim/.ccls.tpl | 22 ++++++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 platformio/ide/tpls/vim/.ccls.tpl diff --git a/HISTORY.rst b/HISTORY.rst index 902cac55..71f11b55 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -10,6 +10,7 @@ PlatformIO 4.0 ~~~~~~~~~~~~~~~~~~ * Update SCons tool to 3.1.1 +* Generate ``.ccls`` LSP file for `Vim `__ cross references, hierarchies, completion and semantic highlighting (`issue #2952 `_) * Remove ProjectConfig cache when "platformio.ini" was modified outside * Fixed an issue with PIO Unified Debugger on Windows OS when debug server is piped * Fixed an issue when `--upload-port `__ CLI flag does not override declared `upload_port `__ option in `"platformio.ini" (Project Configuration File) `__ diff --git a/docs b/docs index 61b47154..6fd93411 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 61b4715449ef06213af496219a691fe57bcfa996 +Subproject commit 6fd93411b2ddeb95c27bdcadb78dbb905c5219f8 diff --git a/platformio/ide/tpls/vim/.ccls.tpl b/platformio/ide/tpls/vim/.ccls.tpl new file mode 100644 index 00000000..ad22fce7 --- /dev/null +++ b/platformio/ide/tpls/vim/.ccls.tpl @@ -0,0 +1,22 @@ +% import re +% STD_RE = re.compile(r"\-std=[a-z\+]+(\d+)") +% cc_stds = STD_RE.findall(cc_flags) +% cxx_stds = STD_RE.findall(cxx_flags) +% +% +clang + +% if cc_stds: +{{"%c"}} -std=c{{ cc_stds[-1] }} +% end +% if cxx_stds: +{{"%cpp"}} -std=c++{{ cxx_stds[-1] }} +% end + +% for include in includes: +-I{{ include }} +% end + +% for define in defines: +-D{{ define }} +% end