├── .gitignore ├── .gitmodules ├── LICENSE ├── README.md ├── angular ├── install.py ├── package.json └── snippet.vim ├── astro ├── install.py ├── package.json └── snippet.vim ├── bash ├── .gitignore ├── install.py ├── package.json └── snippet.vim ├── cmake ├── .gitignore ├── install.py └── snippet.vim ├── crystal ├── install.py └── snippet.vim ├── css ├── install.py ├── package.json └── snippet.vim ├── d ├── .gitignore ├── install.py └── snippet.vim ├── dart ├── .gitignore ├── install.py └── snippet.vim ├── docker ├── .gitignore ├── install.py ├── package.json ├── snippet.vim └── test │ └── Dockerfile ├── erlang ├── install.py └── snippet.vim ├── fortran ├── install.py └── snippet.vim ├── gh-md-toc ├── godot ├── install.py └── snippet.vim ├── groovy ├── .gitignore ├── install.py └── snippet.vim ├── haskell ├── install.py └── snippet.vim ├── install.py ├── jai ├── .gitignore ├── install.py └── snippet.vim ├── jetbrains_kotlin ├── README.md └── snippet.vim ├── json ├── .gitignore ├── install.py ├── package.json └── snippet.vim ├── jsonnet ├── .gitignore ├── README.md └── snippet.vim ├── julia ├── install.py └── snippet.vim ├── kotlin ├── .gitignore ├── install.py ├── snippet.vim └── test │ ├── .gitattributes │ ├── .gitignore │ ├── .ycm_extra_conf.py │ ├── app │ ├── build.gradle │ └── src │ │ ├── main │ │ └── kotlin │ │ │ └── test │ │ │ └── App.kt │ │ └── test │ │ └── kotlin │ │ └── test │ │ └── AppTest.kt │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── lua ├── .gitignore ├── install.py └── snippet.vim ├── matlab ├── .gitignore ├── install.py └── snippet.vim ├── php ├── .gitignore ├── install.py ├── snippet.vim └── test │ └── test.php ├── postgres ├── install.py ├── package.json └── snippet.vim ├── purescript ├── install.py ├── package.json └── snippet.vim ├── python ├── install.py ├── package.json └── snippet.vim ├── racket ├── install.py └── snippet.vim ├── ruby ├── .gitignore ├── Gemfile ├── install ├── snippet.vim └── test │ └── test.rb ├── scala ├── install.py └── snippet.vim ├── test ├── .gitignore ├── package.json ├── src │ └── server.ts └── tsconfig.json ├── tox.ini ├── vala ├── install.py └── snippet.vim ├── viml ├── .gitignore ├── install.py ├── package.json ├── snippet.vim └── test │ └── test.vim ├── vue ├── .gitignore ├── install.py ├── package.json ├── snippet.vim └── test │ └── testapp │ ├── .gitignore │ ├── README.md │ ├── babel.config.js │ ├── jsconfig.json │ ├── package.json │ ├── public │ ├── favicon.ico │ └── index.html │ ├── src │ ├── App.vue │ ├── assets │ │ └── logo.png │ ├── components │ │ └── HelloWorld.vue │ └── main.js │ └── vue.config.js ├── wasm ├── install.py ├── snippet.vim └── test │ └── test.wat ├── yaml ├── .gitignore ├── install.py ├── package.json ├── snippet.vim └── tests │ └── ansible │ └── tasks │ └── main.yml └── zig ├── .gitignore ├── install.py └── snippet.vim /.gitignore: -------------------------------------------------------------------------------- 1 | *.sw[a-z] 2 | *.un~ 3 | vendor/ 4 | package-lock.json 5 | composer.lock 6 | 7 | #add for ignoring node_modules dir 8 | node_modules/ 9 | vimrc.generated 10 | 11 | ## Add to ignore cloned Erlang LS source 12 | erlang/erlang_ls/ 13 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "vue/test/ciao-vue-popup"] 2 | path = vue/test/ciao-vue-popup 3 | url = https://github.com/ciao-chung/ciao-vue-popup 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Overview 2 | 3 | This repo includes a simple way to install some language servers that might work 4 | with YouCompleteMe (strictly ycmd). 5 | 6 | This repo comes with no warranty, and these engines are not officially supported 7 | by YCM, though they should work for the most part. 8 | 9 | 10 | * [Overview](#overview) 11 | * [Languages Tested](#languages-tested) 12 | * [Quick start](#quick-start) 13 | * [Configuration](#configuration) 14 | * [Purescript](#purescript) 15 | * [Scala](#scala) 16 | * [Haskell](#haskell) 17 | * [Fortran](#fortran) 18 | * [Python (e.g. pyright)](#python-eg-pyright) 19 | * [Ruby](#ruby) 20 | * [D](#d) 21 | * [Godot](#godot) 22 | * [Kotlin](#kotlin) 23 | * [Julia](#julia) 24 | * [Lua](#lua) 25 | * [Zig](#zig) 26 | * [CSS](#css) 27 | * [PHP](#php) 28 | * [Crystal](#crystal) 29 | * [Astro](#astro) 30 | * [Postgres](#postgres) 31 | * [Erlang](#erlang) 32 | * [Known Issues](#known-issues) 33 | 34 | 35 | 36 | 37 | 38 | # Languages Tested 39 | 40 | Working: 41 | 42 | * Angular 43 | * Bash 44 | * CSS 45 | * Cmake 46 | * Crystal 47 | * D 48 | * Dart 49 | * Dockerfile 50 | * Godot (gdscript) 51 | * Groovy 52 | * Jai 53 | * Jsonnet (see jsonnet/README.md) 54 | * Kotlin 55 | * PHP 56 | * Python (pyright) 57 | * Racket 58 | * Ruby 59 | * Vala 60 | * Vim (vimscript) 61 | * Vue 62 | * WASM (WAT) 63 | * Zig 64 | 65 | Broken or partially working: 66 | 67 | * JSON 68 | * Lua 69 | * YAML 70 | 71 | See also: 72 | 73 | * [C-family with ccls](https://github.com/MaskRay/ccls/wiki/YouCompleteMe) 74 | 75 | # Quick start 76 | 77 | Assuming you installed this repo in `/path/to/this/directory`: 78 | 79 | * Decide which languages you want. Each language is a directory in this repo. 80 | * Run `python3 ./install.py --enable-LANG1 --enable-LANG2 ...`. 81 | Replace LANG1/LANG2 etc. with the language dirs. e.g. `./install.py 82 | --enable-dart --enable-bash`. You can also use `--all` and `--disable-LANG`. 83 | * Add the line to your vimrc that it tells you to, this will be similar to: 84 | 85 | ```viml 86 | source /path/to/this/directory/vimrc.generated 87 | ``` 88 | 89 | * Optionally: edit `vimrc.generated` to customise `g:ycm_language_server` 90 | 91 | * **NOTE**: YCM will regard the path of `.ycm_extra_conf.py` as root path of 92 | project folder. So please make sure you put your `.ycm_extra_conf.py` at 93 | right place (root of current project) 94 | 95 | # Configuration 96 | 97 | The `g:ycm_language_server` option is used to tell YCM (strictly, ycmd) to use 98 | its 'generic' language server completer. It's a list of dictionaries with the 99 | following keys: 100 | 101 | * 'name' (string): Name of the language server 102 | * 'filetypes' (list): List of Vim filetypes to use this language server for 103 | * 'cmdline' (list): List of words forming a command line to execute. Note: 104 | *must* be a list, even if it has only one element (such as `[ 'executable' ]`. 105 | If not supplied, no server is started and a port must be supplied. 106 | * 'port' (number): A TCP port on localhost to connect to if stdio is not 107 | possible. 108 | * 'project_root_files' (list, optional): List of filename to search for when 109 | trying to determine the 'root' of the project. THis is useful for languages or 110 | language servers which don't automatically detect the 'workspace' root. 111 | 112 | For full documentation, please see the YouCompleteMe docs. 113 | 114 | # Purescript 115 | 116 | Ycmd currently doesn't support `showMessageRequest`, so users need to manually 117 | build their projects on the command line before starting the server. To do this 118 | execute `pulp build` in the project root. 119 | 120 | # Scala 121 | 122 | Ycmd currently doesn't support `showMessageRequest`, so users need to "import 123 | build" manually. Unlike purescript, for scala, this can be done in the editor 124 | by executing `:YcmCompleter ExecuteCommand build-import`. For this operation to 125 | succeed `sbt` and `bloop` need to be in the `$PATH`. `metals` also requires java 126 | 8. 127 | 128 | For completions to work make sure the version of `metals` has [this bug fix][metals-pr]. 129 | 130 | # Haskell 131 | 132 | haskell-ide-engine [is not actively being developed anymore][hie-not-developing], in 133 | favour of [haskell-language-server][haskell-language-server] ([installation 134 | instructions][hls-install]). 135 | 136 | 137 | # Fortran 138 | 139 | The server causes a spurious error: 140 | 141 | - `fortls` doesn't support `didChangeConfiguration`. 142 | 143 | This error can be ignored, as they don't interfere with normal work of ycmd/fortls. 144 | 145 | # Python (e.g. pyright) 146 | 147 | If configuring a language server for Python, this will completely disable the 148 | built-in Jedi completer in YCM. 149 | 150 | ## Pyright 151 | 152 | Example extra conf (actually for ycmd itself): 153 | 154 | ```python 155 | import sys.path as p 156 | 157 | DIR_OF_THIS_SCRIPT = p.abspath( p.dirname( __file__ ) ) 158 | DIR_OF_THIRD_PARTY = p.join( DIR_OF_THIS_SCRIPT, 'third_party' ) 159 | DIR_OF_WATCHDOG_DEPS = p.join( DIR_OF_THIRD_PARTY, 'watchdog_deps' ) 160 | 161 | def Settings( **kwargs ): 162 | if language == 'python': 163 | return { 164 | 'ls': { 165 | 'python': { 166 | 'analysis': { 167 | 'extraPaths': [ 168 | p.join( DIR_OF_THIS_SCRIPT ), 169 | p.join( DIR_OF_THIRD_PARTY, 'bottle' ), 170 | p.join( DIR_OF_THIRD_PARTY, 'regex-build' ), 171 | p.join( DIR_OF_THIRD_PARTY, 'frozendict' ), 172 | p.join( DIR_OF_THIRD_PARTY, 'jedi_deps', 'jedi' ), 173 | p.join( DIR_OF_THIRD_PARTY, 'jedi_deps', 'parso' ), 174 | p.join( DIR_OF_WATCHDOG_DEPS, 'watchdog', 'build', 'lib3' ), 175 | p.join( DIR_OF_WATCHDOG_DEPS, 'pathtools' ), 176 | p.join( DIR_OF_THIRD_PARTY, 'waitress' ) 177 | ], 178 | 'useLibraryCodeForTypes': True 179 | } 180 | } 181 | } 182 | } 183 | ``` 184 | 185 | # Racket 186 | 187 | You need to have racket installed so you can use `raco` to install 188 | the required packages for the language server. 189 | You can install racket through the [racket website](https://download.racket-lang.org/) or your package manager. 190 | 191 | # Ruby 192 | 193 | You need to be running a version of ruby that the parser understands: 194 | https://github.com/whitequark/parser#compatibility-with-ruby-mri 195 | 196 | Recommend running in [rbenv][] for that: 197 | 198 | ``` 199 | $ rbenv shell 2.3.8 200 | $ cd ruby 201 | $ ./install 202 | $ vim test/test.rb 203 | ``` 204 | 205 | # D 206 | 207 | There is a number of external dependencies that you will want to install: 208 | 209 | - `libphobos`/`liblphobos` - the D standard library 210 | - `dmd` - the D compiler 211 | - `dscanner` - at the very least responsible for diagnostics 212 | - `dcd` - the D compiler daemon 213 | - Potentially `dfmt` - `serve-d` seems to be able to format code even without it. 214 | - `dub` - the D package manager 215 | 216 | On top of that, you will want to configure the server, at least to let `serve-d` 217 | know about your modules. The configuration is done through ycmd's extra confs 218 | and the full list of `serve-d`'s configuration options can be found 219 | [here][d-conf]. 220 | 221 | Note that the server executable on Windows is called `serve-d.exe`. 222 | 223 | # Godot 224 | 225 | Godot must be running and you must go to `Project -> Project Settings -> Global` 226 | and set `Language Server` to `On`. At least since Godot 3.4, `Language Server` 227 | options are under `Editor Settings` and `On` by default. 228 | 229 | If Godot is closed or restarted, you might need to force YCM to reconnect (this 230 | isn't automatic). Use `:YcmCompleter RestartServer` to reconnect. 231 | 232 | You can check the status of the connection with `:YcmDebugInfo`. 233 | 234 | Recommend [vim-godot](https://github.com/habamax/vim-godot) for syntax, etc. 235 | (don't believe the hype about using _other_ completion systems though, of 236 | course). 237 | 238 | # Kotlin 239 | 240 | ## Kotlin - JetBrains 241 | 242 | JetBrains Kotlin Language Server Protocol (LSP) implementation based on IntelliJ 243 | 244 | https://github.com/Kotlin/kotlin-lsp. 245 | 246 | See [jetbrains-kotlin/README.md](jetbrains-kotlin/README.md) for more 247 | information. 248 | 249 | ### Limitations 250 | 251 | Uses pull-style diagnostics, which YCM doesn't currently support. 252 | 253 | ## Kotlin - fwcd 254 | 255 | NOTE: I have had little success with this, but the JetBrains one seems to work 256 | well. 257 | 258 | For whatever reason, the server expects you to have maven in your `PATH` and, 259 | just like `serve-d`, `kotlin-language-server` has its own [configuration][kt-conf]. 260 | 261 | The server executable is actually a shell script and the build process produces 262 | `server` for Linux and `server.bat` for Windows. 263 | 264 | Make sure to put a `.ycm_extra_conf.py` file in the root of your project, otherwise 265 | [the language server may fail][kt-issue]. 266 | 267 | # Julia 268 | 269 | The command line for starting the server is: 270 | 271 | ```viml 272 | let g:julia_cmdline = ['julia', '--startup-file=no', '--history-file=no', '-e', ' 273 | \ using LanguageServer; 274 | \ using Pkg; 275 | \ import StaticLint; 276 | \ import SymbolServer; 277 | \ env_path = dirname(Pkg.Types.Context().env.project_file); 278 | \ debug = false; 279 | \ 280 | \ server = LanguageServer.LanguageServerInstance(stdin, stdout, debug, env_path, "", Dict()); 281 | \ server.runlinter = true; 282 | \ run(server); 283 | \ '] 284 | ``` 285 | 286 | You can replace the first command line argument (`'julia'`) with an absolute 287 | path, if `julia` isn't in your `$PATH`. 288 | With the above list in your vimrc, you can set `'cmdline'` in 289 | `g:ycm_language_server` to just `g:julia_cmdline`. 290 | 291 | Julia server *does* support configuration via the extra conf, but it doesn't 292 | seem to be documented anywhere. 293 | 294 | # Lua 295 | 296 | Uses [lua-language-server][]. 297 | 298 | Quick testing suggests that: 299 | 300 | - It returns snippets even though YCM explicitly opted out, meaning completions 301 | don't work unless you use [Ben's Fork][puremourning-fork] 302 | - It violates a number of other items of the protocol other than that such as 303 | missing mandatory fields. 304 | - Signature help doesn't seem to work. 305 | 306 | However, it looks like diagnostics and GoTo work. 307 | 308 | The command line requeired depends on your OS: 309 | 310 | * Windows: `/path/to/lua-language-server/bin/Windows/lua-language-server.exe` 311 | * Linux: `/path/to/lua-language-server/bin/Linux/lua-language-server` 312 | * macOS: `/path/to/lua-language-server/bin/macOS/lua-language-server` 313 | 314 | There is one command line argument. It needs to be the absolute path to 315 | `/path/to/lua-language-server/main.lua`. 316 | 317 | The `install.py` for Lua downloads the pre-built visual studio code extension, 318 | but you can build `lua-language-server` yourself easily if you have `ninja` 319 | installed: 320 | 321 | ``` 322 | git clone https://github.com/sumneko/lua-language-server 323 | cd lua-language-server 324 | cd 3rd/luamake 325 | ninja ninja/.ninja 326 | cd ../../ 327 | ./3rd/luamake/luamake rebuild 328 | ``` 329 | 330 | This will put the binaries in `bin/`. 331 | 332 | # Zig 333 | 334 | Uses [zls](https://github.com/zigtools/zls) 335 | 336 | For this to work sometimes, one needs to run the zls executable to create a user/global config json file 337 | by running the executable in /zig/zls/zig-out/bin/zls after running the install.py. 338 | [NOTE] if your workspace directory has a zls.json file, it should would also work. 339 | 340 | # CSS 341 | 342 | Uses [css](https://github.com/hrsh7th/vscode-langservers-extracted) 343 | 344 | # PHP 345 | 346 | Uses [phpactor](https://phpactor.readthedocs.io/en/master/index.html). 347 | 348 | # Crystal 349 | 350 | Uses [Crystalline](https://github.com/elbywan/crystalline) as an LSP server and 351 | [vim-crystal](https://github.com/vim-crystal/vim-crystal.git) to determine file 352 | type. 353 | 354 | Keep in mind, that Crystalline version **must** match crystal version (see 355 | details on crystalline page). 356 | 357 | The configuration is pretty straightforward. Add this to your .vimrc: 358 | ```viml 359 | let g:ycm_language_server = 360 | \ [ 361 | \ { 362 | \ 'name': 'crystal', 363 | \ 'cmdline': [ 'crystalline'], 364 | \ 'project_root_files' : [ 'shard.yml' ], 365 | \ 'filetypes': [ 'crystal' ] 366 | \ } 367 | \ ] 368 | ``` 369 | Place crystalline in the path (i.e. /usr/local/bin) or use absolute path 370 | in the example above.. 371 | 372 | # Astro 373 | 374 | In addition to defining `g:ycm_language_server` block as shown in 375 | [`astro/snippet.vim`](astro/snippet.vim) this LSP requires `.ycm_extra_conf.py` 376 | to pass Language Server `initializationOptions` pointing to a directory 377 | containing either `typescript.js` or `tsserverlibrary.js` file, such as 378 | `node_modules/typescript/lib`, via `typescript.tsdk` key/value address, eg. 379 | 380 | ```python 381 | import os 382 | 383 | def Settings( **kwargs ): 384 | current_directory = os.path.abspath(os.path.curdir) 385 | if kwargs[ 'language' ] == 'astro': 386 | configs = { 387 | 'ls': { 388 | 'typescript': { 389 | 'tsdk': f"{current_directory}/node_modules/typescript/lib" 390 | }, 391 | }, 392 | } 393 | 394 | return configs 395 | ``` 396 | 397 | ... Authors of Astro Language Server recommend installing `prettier` plugins 398 | too, so adding the following to your `npm init` rituals may be a good idea; 399 | 400 | ```bash 401 | npm install --save-dev typescript prettier prettier-plugin-astro @astrojs/ts-plugin 402 | ``` 403 | 404 | Finally, hopefully for now, adding the `@astrojs/ts-plugin` to your project's 405 | `tsconfig.json` may be necessary to enable all features of Astro LS 406 | 407 | ```json 408 | { 409 | "compilerOptions": { 410 | "plugins": [ 411 | { 412 | "name": "@astrojs/ts-plugin" 413 | } 414 | ] 415 | } 416 | } 417 | ``` 418 | 419 | # Postgres 420 | 421 | Within the root of a project running `postgrestools init` is recommend by 422 | [Configuration](https://pgtools.dev/#configuration) documentation to create a 423 | `postgrestools.jsonc` file, then editing that file for your database setup 424 | seems required to make full use of this Language Server's tooling. 425 | 426 | # Erlang 427 | 428 | Be sure to have satisfied [minimum requirements](https://github.com/erlang-ls/erlang_ls?tab=readme-ov-file#minimum-requirements), and checking [configuration](https://erlang-ls.github.io/configuration/) documentation may be prudent. 429 | 430 |
Minimum Requirements install hints 431 | **Arch (BTW™)** 432 | 433 | ```bash 434 | sudo pacman -S erlang && 435 | yay -S rebar3 436 | ``` 437 |
438 | 439 | > :warning: doc-comments, as of 2025-02-11, are only extracted correctly when a project includes `{project_plugins, [rebar3_ex_doc]}.`, within its `rebar.conf` file. Check [`erlang-ls/erlang_ls` -- Issue `1578`](https://github.com/erlang-ls/erlang_ls/issues/1578) for the full scoop. 440 | 441 | # Jai 442 | 443 | This is using [Jails](https://github.comSogoCZE/Jails), which is very much 444 | "work in progress", so many things aren't fully working yet, but it's easy 445 | enough to set up. 446 | 447 | You may need to create a `jails.json` in your project root to tell Jails where 448 | to find modules. 449 | 450 | Example `jails.json`: 451 | 452 | ```json 453 | { 454 | "workspaces": [ 455 | { 456 | "entry": "/foo/main.jai", 457 | "local_modules": "/modules" 458 | } 459 | ] 460 | } 461 | ``` 462 | 463 | # Vala 464 | 465 | Installing [vala-language-server](https://github.com/vala-lang/vala-language-server) from 466 | source automatically takes a long time 467 | and would be difficult to get right generically. 468 | 469 | Please install `vala-language-server` through your system package manager 470 | before enabling vala support through YCM. 471 | 472 | For formatting support you will need `uncrustify` as well. 473 | 474 | # Known Issues 475 | 476 | - `yaml` completer completions don't work because the server [bugs][yaml-bug] 477 | always returns snippets, even though ycmd claims not to support them. 478 | Validation works though. 479 | - `json` completer completions don't work because the server [bugs][json-bug] 480 | always returns snippets, even though ycmd claims not to support them. 481 | Validation works though. 482 | - `lua` - yet another completer that returns snippets even if client doesn't 483 | support them. 484 | 485 | There is highly experimental (essentially unsupported) support for snippet 486 | completions in [Ben's Fork][puremourning-fork] of YCM. For example, the 487 | following makes json work with that fork: 488 | 489 | ```viml 490 | \ { 491 | \ 'name': 'json', 492 | \ 'cmdline': [ 'node', s:lsp_dir . '/json/node_modules/.bin/vscode-json-languageserver', '--stdio' ], 493 | \ 'filetypes': [ 'json' ], 494 | \ 'capabilities': #{ textDocument: #{ completion: #{ completionItem: #{ snippetSupport: v:true } } } }, 495 | \ }, 496 | ``` 497 | 498 | 499 | [yaml-bug]: https://github.com/redhat-developer/yaml-language-server/issues/161 500 | [json-bug]: https://github.com/vscode-langservers/vscode-json-languageserver-bin/issues/2 501 | [rbenv]: https://github.com/rbenv/rbenv 502 | [d-conf]: https://github.com/Pure-D/serve-d/blob/master/source/served/types.d#L64 503 | [kt-conf]: https://github.com/fwcd/KotlinLanguageServer/blob/master/server/src/main/kotlin/org/javacs/kt/KotlinWorkspaceService.kt#L81 504 | [kt-issue]: https://github.com/ycm-core/lsp-examples/issues/5 505 | [hie-pr]: https://github.com/haskell/haskell-ide-engine/pull/1424 506 | [hie-install]: https://github.com/haskell/haskell-ide-engine#installation 507 | [metals-pr]: https://github.com/scalameta/metals/issues/1057 508 | [lua-language-server]: https://marketplace.visualstudio.com/items?itemName=sumneko.lua 509 | [puremourning-fork]: https://github.com/puremourning/YouCompleteMe 510 | [hie-not-developing]: https://stackoverflow.com/questions/64087188/what-is-the-current-situation-for-using-vim-as-ide-for-haskell-on-archlinux/ 511 | [haskell-language-server]: https://github.com/haskell/haskell-language-server 512 | [hls-install]: https://github.com/haskell/haskell-language-server#installation 513 | -------------------------------------------------------------------------------- /angular/install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import subprocess, os, sys, platform 4 | 5 | def OnWindows(): 6 | return platform.system() == 'Windows' 7 | 8 | 9 | # On Windows, distutils.spawn.find_executable only works for .exe files 10 | # but .bat and .cmd files are also executables, so we use our own 11 | # implementation. 12 | def FindExecutable( executable ): 13 | # Executable extensions used on Windows 14 | WIN_EXECUTABLE_EXTS = [ '.exe', '.bat', '.cmd' ] 15 | 16 | paths = os.environ[ 'PATH' ].split( os.pathsep ) 17 | base, extension = os.path.splitext( executable ) 18 | 19 | if OnWindows() and extension.lower() not in WIN_EXECUTABLE_EXTS: 20 | extensions = WIN_EXECUTABLE_EXTS 21 | else: 22 | extensions = [ '' ] 23 | 24 | for extension in extensions: 25 | executable_name = executable + extension 26 | if not os.path.isfile( executable_name ): 27 | for path in paths: 28 | executable_path = os.path.join( path, executable_name ) 29 | if os.path.isfile( executable_path ): 30 | return executable_path 31 | else: 32 | return executable_name 33 | return None 34 | 35 | 36 | def FindExecutableOrDie( executable, message ): 37 | path = FindExecutable( executable ) 38 | 39 | if not path: 40 | sys.exit( "ERROR: Unable to find executable '{0}'. {1}".format( 41 | executable, 42 | message ) ) 43 | 44 | return path 45 | 46 | 47 | def Main(): 48 | npm = FindExecutableOrDie( 'npm', 'npm is required to set up Angular and TSServer.' ) 49 | subprocess.check_call( [ npm, 'install', '--production' ] ) 50 | 51 | 52 | if __name__ == '__main__': 53 | Main() 54 | -------------------------------------------------------------------------------- /angular/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "ycmd angular-language-server area", 3 | "dependencies": { 4 | "@angular/language-server": "*", 5 | "@angular/language-service": "*", 6 | "typescript": "*" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /angular/snippet.vim: -------------------------------------------------------------------------------- 1 | let g:ycm_language_server += [ 2 | \ { 3 | \ 'name': 'angular', 4 | \ 'cmdline': [ 'node' , 5 | \ expand( g:ycm_lsp_dir . '/angular/node_modules/@angular/language-server' ), 6 | \ '--ngProbeLocations', 7 | \ expand( g:ycm_lsp_dir . '/angular/node_modules/' ), 8 | \ '--tsProbeLocations', 9 | \ expand( g:ycm_lsp_dir . '/angular/node_modules/' ), 10 | \ '--stdio' ], 11 | \ 'filetypes': [ 'ts','html' ], 12 | \ }, 13 | \ ] 14 | -------------------------------------------------------------------------------- /astro/install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import subprocess, os, sys, platform 4 | 5 | def OnWindows(): 6 | return platform.system() == 'Windows' 7 | 8 | 9 | # On Windows, distutils.spawn.find_executable only works for .exe files 10 | # but .bat and .cmd files are also executables, so we use our own 11 | # implementation. 12 | def FindExecutable( executable ): 13 | # Executable extensions used on Windows 14 | WIN_EXECUTABLE_EXTS = [ '.exe', '.bat', '.cmd' ] 15 | 16 | paths = os.environ[ 'PATH' ].split( os.pathsep ) 17 | base, extension = os.path.splitext( executable ) 18 | 19 | if OnWindows() and extension.lower() not in WIN_EXECUTABLE_EXTS: 20 | extensions = WIN_EXECUTABLE_EXTS 21 | else: 22 | extensions = [ '' ] 23 | 24 | for extension in extensions: 25 | executable_name = executable + extension 26 | if not os.path.isfile( executable_name ): 27 | for path in paths: 28 | executable_path = os.path.join( path, executable_name ) 29 | if os.path.isfile( executable_path ): 30 | return executable_path 31 | else: 32 | return executable_name 33 | return None 34 | 35 | 36 | def FindExecutableOrDie( executable, message ): 37 | path = FindExecutable( executable ) 38 | 39 | if not path: 40 | sys.exit( "ERROR: Unable to find executable '{0}'. {1}".format( 41 | executable, 42 | message ) ) 43 | 44 | return path 45 | 46 | 47 | def Main(): 48 | npm = FindExecutableOrDie( 'npm', 'npm is required to set up Astro LS.' ) 49 | subprocess.check_call( [ npm, 'install', '--production' ] ) 50 | 51 | 52 | if __name__ == '__main__': 53 | Main() 54 | -------------------------------------------------------------------------------- /astro/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "ycmd astro-ls runtime area", 3 | "dependencies": { 4 | "@astrojs/language-server": "*" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /astro/snippet.vim: -------------------------------------------------------------------------------- 1 | let g:ycm_language_server += [ 2 | \ { 3 | \ 'name': 'astro', 4 | \ 'filetypes': [ 'astro' ], 5 | \ 'cmdline': [ expand( g:ycm_lsp_dir . '/astro/node_modules/@astrojs/language-server/bin/nodeServer.js' ), '--stdio' ], 6 | \ 'project_root_files': [ 'tsconfig.json', 'astro.config.mjs' ] 7 | \ }, 8 | \ ] 9 | -------------------------------------------------------------------------------- /bash/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /bash/install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import subprocess, os, sys, platform 4 | 5 | def OnWindows(): 6 | return platform.system() == 'Windows' 7 | 8 | 9 | # On Windows, distutils.spawn.find_executable only works for .exe files 10 | # but .bat and .cmd files are also executables, so we use our own 11 | # implementation. 12 | def FindExecutable( executable ): 13 | # Executable extensions used on Windows 14 | WIN_EXECUTABLE_EXTS = [ '.exe', '.bat', '.cmd' ] 15 | 16 | paths = os.environ[ 'PATH' ].split( os.pathsep ) 17 | base, extension = os.path.splitext( executable ) 18 | 19 | if OnWindows() and extension.lower() not in WIN_EXECUTABLE_EXTS: 20 | extensions = WIN_EXECUTABLE_EXTS 21 | else: 22 | extensions = [ '' ] 23 | 24 | for extension in extensions: 25 | executable_name = executable + extension 26 | if not os.path.isfile( executable_name ): 27 | for path in paths: 28 | executable_path = os.path.join( path, executable_name ) 29 | if os.path.isfile( executable_path ): 30 | return executable_path 31 | else: 32 | return executable_name 33 | return None 34 | 35 | 36 | def FindExecutableOrDie( executable, message ): 37 | path = FindExecutable( executable ) 38 | 39 | if not path: 40 | sys.exit( "ERROR: Unable to find executable '{0}'. {1}".format( 41 | executable, 42 | message ) ) 43 | 44 | return path 45 | 46 | 47 | def Main(): 48 | npm = FindExecutableOrDie( 'npm', 'npm is required to set up Tern.' ) 49 | subprocess.check_call( [ npm, 'install', '--production' ] ) 50 | 51 | 52 | if __name__ == '__main__': 53 | Main() 54 | -------------------------------------------------------------------------------- /bash/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "ycmd yaml-language-server runtime area", 3 | "dependencies": { 4 | "bash-language-server": "*" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /bash/snippet.vim: -------------------------------------------------------------------------------- 1 | let g:ycm_language_server += [ 2 | \ { 3 | \ 'name': 'bash', 4 | \ 'cmdline': [ 'node', expand( g:ycm_lsp_dir . '/bash/node_modules/.bin/bash-language-server' ), 'start' ], 5 | \ 'filetypes': [ 'sh', 'bash' ], 6 | \ }, 7 | \ ] 8 | -------------------------------------------------------------------------------- /cmake/.gitignore: -------------------------------------------------------------------------------- 1 | #for env dir 2 | venv/ 3 | -------------------------------------------------------------------------------- /cmake/install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import subprocess 3 | import platform 4 | import sys 5 | import os 6 | 7 | PY_CMD = sys.executable 8 | DIR_OF_THIS_SCRIPT = os.path.dirname( os.path.abspath( __name__ ) ) 9 | 10 | def OnWindows(): 11 | return platform.system() == 'Windows' 12 | 13 | 14 | def CreateVenvDir(): 15 | print( "Creating venv" ) 16 | cmd = [ PY_CMD, "-m", "venv", "venv" ] 17 | subprocess.check_call( cmd ) 18 | 19 | 20 | def InstallCMakeLanguageServer(): 21 | bin_dir = "bin" 22 | if OnWindows(): 23 | bin_dir = "Scripts" 24 | 25 | pip_cmd = os.path.join( DIR_OF_THIS_SCRIPT, "venv", bin_dir, "pip" ) 26 | cmd = [ pip_cmd, "install", "cmake-language-server" ] 27 | subprocess.check_call( cmd ) 28 | 29 | 30 | def Main(): 31 | CreateVenvDir() 32 | InstallCMakeLanguageServer() 33 | 34 | 35 | if __name__ == "__main__": 36 | Main() 37 | -------------------------------------------------------------------------------- /cmake/snippet.vim: -------------------------------------------------------------------------------- 1 | let s:pip_os_dir = 'bin' 2 | if has('win32') 3 | let s:pip_os_dir = 'Scripts' 4 | end 5 | 6 | let g:ycm_language_server += [ 7 | \ { 8 | \ 'name': 'cmake', 9 | \ 'cmdline': [ expand( g:ycm_lsp_dir . '/cmake/venv/' . s:pip_os_dir . '/cmake-language-server' )], 10 | \ 'filetypes': [ 'cmake' ], 11 | \ }, 12 | \ ] 13 | -------------------------------------------------------------------------------- /crystal/install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | import subprocess 5 | from sys import platform 6 | import sys 7 | import requests 8 | import gzip 9 | import shutil 10 | import os.path 11 | 12 | # Credit goes to Sumit Ghosh: https://sumit-ghosh.com/articles/python-download-progress-bar/ 13 | def download(url, filename): 14 | with open(filename, 'wb') as f: 15 | response = requests.get(url, stream=True) 16 | total = response.headers.get('content-length') 17 | 18 | if total is None: 19 | f.write(response.content) 20 | else: 21 | downloaded = 0 22 | total = int(total) 23 | for data in response.iter_content(chunk_size=max(int(total/1000), 1024*1024)): 24 | downloaded += len(data) 25 | f.write(data) 26 | done = int(50*downloaded/total) 27 | sys.stdout.write('\r[{}{}]'.format('█' * done, '.' * (50-done))) 28 | sys.stdout.flush() 29 | sys.stdout.write('\n') 30 | 31 | if platform == "linux" or platform == "linux2": 32 | known_versions = { 33 | b"0.35.1" : "https://github.com/elbywan/crystalline/releases/download/v0.1.9/crystalline_linux.gz", 34 | b"0.36" : "https://github.com/elbywan/crystalline/releases/download/v0.2.1/crystalline_x86_64-unknown-linux-gnu.gz", 35 | b"1.0.0" : "https://github.com/elbywan/crystalline/releases/download/v0.3.0/crystalline_x86_64-unknown-linux-gnu.gz" 36 | } 37 | elif platform == "darwin": 38 | known_versions = { 39 | b"0.35.1" : "https://github.com/elbywan/crystalline/releases/download/v0.1.9/crystalline_darwin.gz", 40 | b"0.36" : "https://github.com/elbywan/crystalline/releases/download/v0.2.1/crystalline_x86_64-apple-darwin.gz", 41 | b"1.0.0" : "https://github.com/elbywan/crystalline/releases/download/v0.3.0/crystalline_x86_64-apple-darwin.gz" 42 | } 43 | else: 44 | print("Unable to probe OS version, or your OS is not supported") 45 | exit(1) 46 | 47 | # result = subprocess.Popen('/opt/crystal-0.36/bin/crystal --version', shell=True, stdout=subprocess.PIPE) 48 | result = subprocess.Popen('crystal --version', shell=True, stdout=subprocess.PIPE) 49 | result.wait() 50 | if result.returncode: 51 | print("There is an error looking for Crystal version. Possibly, Crystal is not installed") 52 | exit(2) 53 | 54 | versionline = result.stdout.readlines() 55 | if not (versionline and versionline[0][:7] == b"Crystal"): 56 | print("Unable to find Crystal version in crystal output") 57 | exit(3) 58 | 59 | versionline = versionline[0] 60 | sspace = versionline.index(b' ', 8) 61 | version = versionline.split()[1] 62 | print(f"Found Crystal version {version.decode('utf-8')}") 63 | 64 | 65 | url = "" 66 | for v in known_versions: 67 | if version >= v: 68 | url = known_versions[v] 69 | 70 | if not url: 71 | print("Unable to find crystalline URL for your Crystal version") 72 | exit(4) 73 | 74 | print(f"Using URL {url}") 75 | if os.path.isfile("/tmp/crystalline.gz"): 76 | print("Re-using downloaded file") 77 | else: 78 | download(url, "/tmp/crystalline.gz") 79 | 80 | with gzip.open("/tmp/crystalline.gz", "rb") as z: 81 | with open("/tmp/crystalline", "wb") as f: 82 | f.write(z.read()) 83 | subprocess.check_call( ("chmod", "+x", "/tmp/crystalline") ) 84 | 85 | try: 86 | try: 87 | os.mkdir("bin") 88 | except FileExistsError: 89 | pass 90 | shutil.move("/tmp/crystalline", "bin/crystalline") 91 | except OSError: 92 | print("Error writing bin/crystalline. Possibly, you don't have permissions") 93 | -------------------------------------------------------------------------------- /crystal/snippet.vim: -------------------------------------------------------------------------------- 1 | let g:ycm_language_server = 2 | \ [ 3 | \ { 4 | \ 'name': 'crystal', 5 | \ 'cmdline': [ expand( g:ycm_lsp_dir . '/crystal/bin/crystalline' ) ], 6 | \ 'project_root_files' : [ 'shard.yml' ], 7 | \ 'filetypes': [ 'crystal' ] 8 | \ } 9 | \ ] 10 | -------------------------------------------------------------------------------- /css/install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import subprocess, os, sys, platform 4 | 5 | def OnWindows(): 6 | return platform.system() == 'Windows' 7 | 8 | 9 | # On Windows, distutils.spawn.find_executable only works for .exe files 10 | # but .bat and .cmd files are also executables, so we use our own 11 | # implementation. 12 | def FindExecutable( executable ): 13 | # Executable extensions used on Windows 14 | WIN_EXECUTABLE_EXTS = [ '.exe', '.bat', '.cmd' ] 15 | 16 | paths = os.environ[ 'PATH' ].split( os.pathsep ) 17 | base, extension = os.path.splitext( executable ) 18 | 19 | if OnWindows() and extension.lower() not in WIN_EXECUTABLE_EXTS: 20 | extensions = WIN_EXECUTABLE_EXTS 21 | else: 22 | extensions = [ '' ] 23 | 24 | for extension in extensions: 25 | executable_name = executable + extension 26 | if not os.path.isfile( executable_name ): 27 | for path in paths: 28 | executable_path = os.path.join( path, executable_name ) 29 | if os.path.isfile( executable_path ): 30 | return executable_path 31 | else: 32 | return executable_name 33 | return None 34 | 35 | 36 | def FindExecutableOrDie( executable, message ): 37 | path = FindExecutable( executable ) 38 | 39 | if not path: 40 | sys.exit( "ERROR: Unable to find executable '{0}'. {1}".format( 41 | executable, 42 | message ) ) 43 | 44 | return path 45 | 46 | 47 | def Main(): 48 | npm = FindExecutableOrDie( 'npm', 'npm is required to set up Tern.' ) 49 | subprocess.check_call( [ npm, 'install', '--production' ] ) 50 | 51 | 52 | if __name__ == '__main__': 53 | Main() 54 | -------------------------------------------------------------------------------- /css/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "ycmd css-language-server runtime area", 3 | "dependencies": { 4 | "vscode-langservers-extracted": "*" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /css/snippet.vim: -------------------------------------------------------------------------------- 1 | let g:ycm_language_server += [ 2 | \ { 3 | \ 'name': 'css', 4 | \ 'cmdline': [ expand( g:ycm_lsp_dir . '/css/node_modules/.bin/vscode-css-language-server' ), '--stdio' ], 5 | \ 'filetypes': [ 'css', 'sass' ], 6 | \ }, 7 | \ ] 8 | -------------------------------------------------------------------------------- /d/.gitignore: -------------------------------------------------------------------------------- 1 | serve-d 2 | -------------------------------------------------------------------------------- /d/install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import sys 4 | 5 | if sys.version_info < ( 3, 6, 4 ): 6 | print( "Your python: " + str( sys.version_info ) ) 7 | sys.exit( "You need to run this with python 3.6.4 or later" ) 8 | 9 | import os, urllib.request, platform, zipfile, tarfile 10 | 11 | def OnWindows(): 12 | return platform.system() == 'Windows' 13 | 14 | 15 | def Main(): 16 | if OnWindows(): 17 | url = 'https://github.com/Pure-D/serve-d/releases/download/v0.4.1/serve-d_0.4.1-windows.zip' 18 | filename = 'serve-d.zip' 19 | else: 20 | url = 'https://github.com/Pure-D/serve-d/releases/download/v0.4.1/serve-d_0.4.1-linux-x86_64.tar.xz' 21 | filename = 'serve-d.tar.xz' 22 | 23 | urllib.request.urlretrieve( url, filename ) 24 | 25 | if OnWindows(): 26 | with zipfile.ZipFile( filename ) as zip_file: 27 | zip_file.extractall() 28 | else: 29 | with tarfile.open( filename ) as archive: 30 | archive.extractall() 31 | 32 | os.remove( filename ) 33 | 34 | 35 | if __name__ == '__main__': 36 | Main() 37 | -------------------------------------------------------------------------------- /d/snippet.vim: -------------------------------------------------------------------------------- 1 | let g:ycm_language_server += [ 2 | \ { 'name': 'd', 3 | \ 'filetypes': [ 'd' ], 4 | \ 'cmdline': [ expand( g:ycm_lsp_dir . '/d/serve-d' ) ], 5 | \ }, 6 | \ ] 7 | -------------------------------------------------------------------------------- /dart/.gitignore: -------------------------------------------------------------------------------- 1 | analysis_server.dart.snapshot 2 | dart-sdk.zip 3 | -------------------------------------------------------------------------------- /dart/install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import os 4 | import platform 5 | 6 | 7 | # On Windows, distutils.spawn.find_executable only works for .exe files 8 | # but .bat and .cmd files are also executables, so we use our own 9 | # implementation. 10 | def FindExecutable( executable ): 11 | # Executable extensions used on Windows 12 | WIN_EXECUTABLE_EXTS = [ '.exe', '.bat', '.cmd' ] 13 | 14 | paths = os.environ[ 'PATH' ].split( os.pathsep ) 15 | base, extension = os.path.splitext( executable ) 16 | 17 | if platform.system() == 'Windows' and extension.lower() not in WIN_EXECUTABLE_EXTS: 18 | extensions = WIN_EXECUTABLE_EXTS 19 | else: 20 | extensions = [ '' ] 21 | 22 | for extension in extensions: 23 | executable_name = executable + extension 24 | if not os.path.isfile( executable_name ): 25 | for path in paths: 26 | executable_path = os.path.join( path, executable_name ) 27 | if os.path.isfile( executable_path ): 28 | return executable_path 29 | else: 30 | return executable_name 31 | return None 32 | 33 | 34 | if not FindExecutable( 'dart' ): 35 | raise UserWarning( '`dart` is needed in $PATH for proper operation' ) 36 | -------------------------------------------------------------------------------- /dart/snippet.vim: -------------------------------------------------------------------------------- 1 | let g:ycm_language_server += [ 2 | \ { 3 | \ 'name': 'dart', 4 | \ 'cmdline': [ 'dart', 'language-server', '--client-id', 'youcompleteme' ], 5 | \ 'filetypes': [ 'dart' ], 6 | \ }, 7 | \ ] 8 | -------------------------------------------------------------------------------- /docker/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /docker/install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import subprocess, os, sys, platform 4 | 5 | def OnWindows(): 6 | return platform.system() == 'Windows' 7 | 8 | 9 | # On Windows, distutils.spawn.find_executable only works for .exe files 10 | # but .bat and .cmd files are also executables, so we use our own 11 | # implementation. 12 | def FindExecutable( executable ): 13 | # Executable extensions used on Windows 14 | WIN_EXECUTABLE_EXTS = [ '.exe', '.bat', '.cmd' ] 15 | 16 | paths = os.environ[ 'PATH' ].split( os.pathsep ) 17 | base, extension = os.path.splitext( executable ) 18 | 19 | if OnWindows() and extension.lower() not in WIN_EXECUTABLE_EXTS: 20 | extensions = WIN_EXECUTABLE_EXTS 21 | else: 22 | extensions = [ '' ] 23 | 24 | for extension in extensions: 25 | executable_name = executable + extension 26 | if not os.path.isfile( executable_name ): 27 | for path in paths: 28 | executable_path = os.path.join( path, executable_name ) 29 | if os.path.isfile( executable_path ): 30 | return executable_path 31 | else: 32 | return executable_name 33 | return None 34 | 35 | 36 | def FindExecutableOrDie( executable, message ): 37 | path = FindExecutable( executable ) 38 | 39 | if not path: 40 | sys.exit( "ERROR: Unable to find executable '{0}'. {1}".format( 41 | executable, 42 | message ) ) 43 | 44 | return path 45 | 46 | 47 | def Main(): 48 | npm = FindExecutableOrDie( 'npm', 49 | 'npm is required to set up ' 50 | 'dockerfile-language-server.' ) 51 | subprocess.check_call( [ npm, 'install', '--production' ] ) 52 | 53 | 54 | if __name__ == '__main__': 55 | Main() 56 | -------------------------------------------------------------------------------- /docker/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "ycmd docker-language-server runtime area", 3 | "dependencies": { 4 | "dockerfile-language-server-nodejs": "*" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /docker/snippet.vim: -------------------------------------------------------------------------------- 1 | let g:ycm_language_server += [ 2 | \ { 'name': 'docker', 3 | \ 'filetypes': [ 'dockerfile' ], 4 | \ 'cmdline': [ expand( g:ycm_lsp_dir . '/docker/node_modules/.bin/docker-langserver' ), '--stdio' ] 5 | \ }, 6 | \ ] 7 | -------------------------------------------------------------------------------- /docker/test/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu 2 | 3 | ENV TEST test 4 | 5 | COPY --chown=test test test 6 | 7 | RUN test ${TEST} 8 | 9 | ENTRYPOINT test 10 | 11 | 12 | # vim: nospell 13 | -------------------------------------------------------------------------------- /erlang/install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import subprocess, os, sys, platform 4 | 5 | def OnWindows(): 6 | return platform.system() == 'Windows' 7 | 8 | 9 | # On Windows, distutils.spawn.find_executable only works for .exe files 10 | # but .bat and .cmd files are also executables, so we use our own 11 | # implementation. 12 | def FindExecutable( executable ): 13 | # Executable extensions used on Windows 14 | WIN_EXECUTABLE_EXTS = [ '.exe', '.bat', '.cmd' ] 15 | 16 | paths = os.environ[ 'PATH' ].split( os.pathsep ) 17 | base, extension = os.path.splitext( executable ) 18 | 19 | if OnWindows() and extension.lower() not in WIN_EXECUTABLE_EXTS: 20 | extensions = WIN_EXECUTABLE_EXTS 21 | else: 22 | extensions = [ '' ] 23 | 24 | for extension in extensions: 25 | executable_name = executable + extension 26 | if not os.path.isfile( executable_name ): 27 | for path in paths: 28 | executable_path = os.path.join( path, executable_name ) 29 | if os.path.isfile( executable_path ): 30 | return executable_path 31 | else: 32 | return executable_name 33 | return None 34 | 35 | 36 | def FindExecutableOrDie( executable, message ): 37 | path = FindExecutable( executable ) 38 | 39 | if not path: 40 | sys.exit( "ERROR: Unable to find executable '{0}'. {1}".format( 41 | executable, 42 | message ) ) 43 | 44 | return path 45 | 46 | 47 | def Main(): 48 | git_dir = 'erlang_ls' 49 | if FindExecutable( 'erlang_ls' ) is not None and os.path.isdir(os.curdir + os.sep + git_dir) is not True: 50 | sys.exit( "Error: Erlang Language Server already installed by unknown means" ) 51 | 52 | git = FindExecutableOrDie( 'git', 'git is required' ) 53 | make = FindExecutableOrDie( 'make', 'make is required to set up Erlang LS.' ) 54 | 55 | url = 'https://github.com/erlang-ls/erlang_ls' 56 | 57 | if os.path.isdir(os.curdir + os.sep + git_dir): 58 | print("erlang_ls already cloned into directory") 59 | print("Going to update and upgrade") 60 | os.chdir(git_dir) 61 | subprocess.check_call( [ git, 'pull' ] ) 62 | subprocess.check_call( [ git, 'submodule', 'update', '--recursive' ] ) 63 | else: 64 | subprocess.check_call( [ git, 'clone', '--recurse-submodules', '--depth=1', url ] ) 65 | os.chdir(git_dir) 66 | 67 | subprocess.check_call( [ make ] ) 68 | 69 | 70 | if __name__ == '__main__': 71 | Main() 72 | -------------------------------------------------------------------------------- /erlang/snippet.vim: -------------------------------------------------------------------------------- 1 | let g:ycm_language_server += [ 2 | \ { 3 | \ 'name': 'erlang', 4 | \ 'filetypes': [ 'erlang' ], 5 | \ 'cmdline': [ expand( g:ycm_lsp_dir . '/erlang/erlang_ls/_build/default/bin/erlang_ls' ), '--transport', 'stdio' ], 6 | \ 'project_root_files': [ 'erlang_ls.config', 'erlang_ls.yaml' ] 7 | \ }, 8 | \ ] 9 | -------------------------------------------------------------------------------- /fortran/install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import subprocess, os, sys, platform 4 | 5 | def OnWindows(): 6 | return platform.system() == 'Windows' 7 | 8 | 9 | # On Windows, distutils.spawn.find_executable only works for .exe files 10 | # but .bat and .cmd files are also executables, so we use our own 11 | # implementation. 12 | def FindExecutable( executable ): 13 | # Executable extensions used on Windows 14 | WIN_EXECUTABLE_EXTS = [ '.exe', '.bat', '.cmd' ] 15 | 16 | paths = os.environ[ 'PATH' ].split( os.pathsep ) 17 | base, extension = os.path.splitext( executable ) 18 | 19 | if OnWindows() and extension.lower() not in WIN_EXECUTABLE_EXTS: 20 | extensions = WIN_EXECUTABLE_EXTS 21 | else: 22 | extensions = [ '' ] 23 | 24 | for extension in extensions: 25 | executable_name = executable + extension 26 | if not os.path.isfile( executable_name ): 27 | for path in paths: 28 | executable_path = os.path.join( path, executable_name ) 29 | if os.path.isfile( executable_path ): 30 | return executable_path 31 | else: 32 | return executable_name 33 | return None 34 | 35 | 36 | def FindExecutableOrDie( executables, message ): 37 | for executable in executables: 38 | path = FindExecutable( executable ) 39 | if path: 40 | break 41 | 42 | if not path: 43 | sys.exit( "ERROR: Unable to find any executable from '{0}'. {1}".format( 44 | executables, 45 | message ) ) 46 | 47 | return path 48 | 49 | 50 | def Main(): 51 | pip = FindExecutableOrDie( [ 'pip', 'pip3' ], 52 | 'pip is required to install fortls.' ) 53 | subprocess.check_call( [ pip, 54 | 'install', 55 | '--user', 56 | '--upgrade', 57 | 'fortls' ] ) 58 | 59 | 60 | if __name__ == '__main__': 61 | Main() 62 | -------------------------------------------------------------------------------- /fortran/snippet.vim: -------------------------------------------------------------------------------- 1 | let g:ycm_language_server += [ 2 | \ { 'name': 'fortran', 3 | \ 'filetypes': [ 'fortran' ], 4 | \ 'cmdline': [ 'fortls', '--notify_init', '--hover_signature', '--hover_language', 'fortran', '--use_signature_help' ], 5 | \ }, 6 | \ ] 7 | -------------------------------------------------------------------------------- /gh-md-toc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # 4 | # Steps: 5 | # 6 | # 1. Download corresponding html file for some README.md: 7 | # curl -s $1 8 | # 9 | # 2. Discard rows where no substring 'user-content-' (github's markup): 10 | # awk '/user-content-/ { ... 11 | # 12 | # 3.1 Get last number in each row like ' ... sitemap.js.*<\/h/)+2, RLENGTH-5) 21 | # 22 | # 5. Find anchor and insert it inside "(...)": 23 | # substr($0, match($0, "href=\"[^\"]+?\" ")+6, RLENGTH-8) 24 | # 25 | 26 | gh_toc_version="0.6.1" 27 | 28 | gh_user_agent="gh-md-toc v$gh_toc_version" 29 | 30 | # 31 | # Download rendered into html README.md by its url. 32 | # 33 | # 34 | gh_toc_load() { 35 | local gh_url=$1 36 | 37 | if type curl &>/dev/null; then 38 | curl --user-agent "$gh_user_agent" -s "$gh_url" 39 | elif type wget &>/dev/null; then 40 | wget --user-agent="$gh_user_agent" -qO- "$gh_url" 41 | else 42 | echo "Please, install 'curl' or 'wget' and try again." 43 | exit 1 44 | fi 45 | } 46 | 47 | # 48 | # Converts local md file into html by GitHub 49 | # 50 | # ➥ curl -X POST --data '{"text": "Hello world github/linguist#1 **cool**, and #1!"}' https://api.github.com/markdown 51 | #

Hello world github/linguist#1 cool, and #1!

'" 52 | gh_toc_md2html() { 53 | local gh_file_md=$1 54 | URL=https://api.github.com/markdown/raw 55 | if [ ! -z "$GH_TOC_TOKEN" ]; then 56 | TOKEN=$GH_TOC_TOKEN 57 | else 58 | TOKEN="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/token.txt" 59 | fi 60 | if [ -f "$TOKEN" ]; then 61 | URL="$URL?access_token=$(cat $TOKEN)" 62 | fi 63 | # echo $URL 1>&2 64 | OUTPUT="$(curl -s --user-agent "$gh_user_agent" \ 65 | --data-binary @"$gh_file_md" -H "Content-Type:text/plain" \ 66 | $URL)" 67 | 68 | if [ "$?" != "0" ]; then 69 | echo "XXNetworkErrorXX" 70 | fi 71 | if [ "$(echo "${OUTPUT}" | awk '/API rate limit exceeded/')" != "" ]; then 72 | echo "XXRateLimitXX" 73 | else 74 | echo "${OUTPUT}" 75 | fi 76 | } 77 | 78 | 79 | # 80 | # Is passed string url 81 | # 82 | gh_is_url() { 83 | case $1 in 84 | https* | http*) 85 | echo "yes";; 86 | *) 87 | echo "no";; 88 | esac 89 | } 90 | 91 | # 92 | # TOC generator 93 | # 94 | gh_toc(){ 95 | local gh_src=$1 96 | local gh_src_copy=$1 97 | local gh_ttl_docs=$2 98 | local need_replace=$3 99 | 100 | if [ "$gh_src" = "" ]; then 101 | echo "Please, enter URL or local path for a README.md" 102 | exit 1 103 | fi 104 | 105 | 106 | # Show "TOC" string only if working with one document 107 | if [ "$gh_ttl_docs" = "1" ]; then 108 | 109 | echo "Table of Contents" 110 | echo "=================" 111 | echo "" 112 | gh_src_copy="" 113 | 114 | fi 115 | 116 | if [ "$(gh_is_url "$gh_src")" == "yes" ]; then 117 | gh_toc_load "$gh_src" | gh_toc_grab "$gh_src_copy" 118 | if [ "${PIPESTATUS[0]}" != "0" ]; then 119 | echo "Could not load remote document." 120 | echo "Please check your url or network connectivity" 121 | exit 1 122 | fi 123 | if [ "$need_replace" = "yes" ]; then 124 | echo 125 | echo "!! '$gh_src' is not a local file" 126 | echo "!! Can't insert the TOC into it." 127 | echo 128 | fi 129 | else 130 | local rawhtml=$(gh_toc_md2html "$gh_src") 131 | if [ "$rawhtml" == "XXNetworkErrorXX" ]; then 132 | echo "Parsing local markdown file requires access to github API" 133 | echo "Please make sure curl is installed and check your network connectivity" 134 | exit 1 135 | fi 136 | if [ "$rawhtml" == "XXRateLimitXX" ]; then 137 | echo "Parsing local markdown file requires access to github API" 138 | echo "Error: You exceeded the hourly limit. See: https://developer.github.com/v3/#rate-limiting" 139 | TOKEN="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/token.txt" 140 | echo "or place github auth token here: $TOKEN" 141 | exit 1 142 | fi 143 | local toc=`echo "$rawhtml" | gh_toc_grab "$gh_src_copy"` 144 | echo "$toc" 145 | if [ "$need_replace" = "yes" ]; then 146 | if grep -Fxq "" $gh_src && grep -Fxq "" $gh_src; then 147 | echo "Found markers" 148 | else 149 | echo "You don't have or in your file...exiting" 150 | exit 1 151 | fi 152 | local ts="<\!--ts-->" 153 | local te="<\!--te-->" 154 | local dt=`date +'%F_%H%M%S'` 155 | local ext=".orig.${dt}" 156 | local toc_path="${gh_src}.toc.${dt}" 157 | local toc_footer="" 158 | # http://fahdshariff.blogspot.ru/2012/12/sed-mutli-line-replacement-between-two.html 159 | # clear old TOC 160 | sed -i${ext} "/${ts}/,/${te}/{//!d;}" "$gh_src" 161 | # create toc file 162 | echo "${toc}" > "${toc_path}" 163 | echo -e "\n${toc_footer}\n" >> "$toc_path" 164 | # insert toc file 165 | if [[ "`uname`" == "Darwin" ]]; then 166 | sed -i "" "/${ts}/r ${toc_path}" "$gh_src" 167 | else 168 | sed -i "/${ts}/r ${toc_path}" "$gh_src" 169 | fi 170 | echo 171 | echo "!! TOC was added into: '$gh_src'" 172 | echo "!! Origin version of the file: '${gh_src}${ext}'" 173 | echo "!! TOC added into a separate file: '${toc_path}'" 174 | echo 175 | fi 176 | fi 177 | } 178 | 179 | # 180 | # Grabber of the TOC from rendered html 181 | # 182 | # $1 — a source url of document. 183 | # It's need if TOC is generated for multiple documents. 184 | # 185 | gh_toc_grab() { 186 | # if closed is on the new line, then move it on the prev line 187 | # for example: 188 | # was: The command foo1 189 | # 190 | # became: The command foo1 191 | sed -e ':a' -e 'N' -e '$!ba' -e 's/\n<\/h/<\/h/g' | 192 | # find strings that corresponds to template 193 | grep -E -o '//g' | sed 's/<\/code>//g' | 196 | # now all rows are like: 197 | # ... .*<\/h/)+2, RLENGTH-5) 204 | href = substr($0, match($0, "href=\"[^\"]+?\"")+6, RLENGTH-7) 205 | print sprintf("%*s", level*3, " ") "* [" text "](" gh_url href ")" }' | 206 | sed 'y/+/ /; s/%/\\x/g')" 207 | } 208 | 209 | # 210 | # Returns filename only from full path or url 211 | # 212 | gh_toc_get_filename() { 213 | echo "${1##*/}" 214 | } 215 | 216 | # 217 | # Options hendlers 218 | # 219 | gh_toc_app() { 220 | local need_replace="no" 221 | 222 | if [ "$1" = '--help' ] || [ $# -eq 0 ] ; then 223 | local app_name=$(basename "$0") 224 | echo "GitHub TOC generator ($app_name): $gh_toc_version" 225 | echo "" 226 | echo "Usage:" 227 | echo " $app_name [--insert] src [src] Create TOC for a README file (url or local path)" 228 | echo " $app_name - Create TOC for markdown from STDIN" 229 | echo " $app_name --help Show help" 230 | echo " $app_name --version Show version" 231 | return 232 | fi 233 | 234 | if [ "$1" = '--version' ]; then 235 | echo "$gh_toc_version" 236 | echo 237 | echo "os: `lsb_release -d | cut -f 2`" 238 | echo "kernel: `cat /proc/version`" 239 | echo "shell: `$SHELL --version`" 240 | echo 241 | for tool in curl wget grep awk sed; do 242 | printf "%-5s: " $tool 243 | echo `$tool --version | head -n 1` 244 | done 245 | return 246 | fi 247 | 248 | if [ "$1" = "-" ]; then 249 | if [ -z "$TMPDIR" ]; then 250 | TMPDIR="/tmp" 251 | elif [ -n "$TMPDIR" -a ! -d "$TMPDIR" ]; then 252 | mkdir -p "$TMPDIR" 253 | fi 254 | local gh_tmp_md 255 | gh_tmp_md=$(mktemp $TMPDIR/tmp.XXXXXX) 256 | while read input; do 257 | echo "$input" >> "$gh_tmp_md" 258 | done 259 | gh_toc_md2html "$gh_tmp_md" | gh_toc_grab "" 260 | return 261 | fi 262 | 263 | if [ "$1" = '--insert' ]; then 264 | need_replace="yes" 265 | shift 266 | fi 267 | 268 | for md in "$@" 269 | do 270 | echo "" 271 | gh_toc "$md" "$#" "$need_replace" 272 | done 273 | 274 | echo "" 275 | echo "Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc)" 276 | } 277 | 278 | # 279 | # Entry point 280 | # 281 | gh_toc_app "$@" 282 | -------------------------------------------------------------------------------- /godot/install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | print( "**************************************************************" ) 4 | print( "To enable GoDot language server" ) 5 | print( "**************************************************************" ) 6 | print( "" ) 7 | print( "You must enable the godot language server manually, by setting " 8 | "Project -> Project Settings -> Global -> Language Server to ON" ) 9 | print( "" ) 10 | print( "**************************************************************" ) 11 | -------------------------------------------------------------------------------- /godot/snippet.vim: -------------------------------------------------------------------------------- 1 | let g:ycm_language_server += [ 2 | \ { 3 | \ 'name': 'godot', 4 | \ 'filetypes': [ 'gdscript' ], 5 | \ 'project_root_files': [ 'project.godot' ], 6 | \ 'port': 6008 7 | \ }, 8 | \ ] 9 | -------------------------------------------------------------------------------- /groovy/.gitignore: -------------------------------------------------------------------------------- 1 | groovy-language-server/ 2 | -------------------------------------------------------------------------------- /groovy/install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import subprocess, os, platform 4 | 5 | def OnWindows(): 6 | return platform.system() == 'Windows' 7 | 8 | 9 | def Main(): 10 | url = 'https://github.com/prominic/groovy-language-server' 11 | if not os.path.isdir( 'groovy-language-server' ): 12 | subprocess.check_call( [ 'git', 'clone', '--depth', '1', url ] ) 13 | 14 | os.chdir( 'groovy-language-server' ) 15 | subprocess.check_call( [ 'git', 'pull' ] ) 16 | 17 | if OnWindows(): 18 | subprocess.check_call( [ 'gradlew.bat', 19 | '--no-daemon', 20 | 'build' ] ) 21 | else: 22 | subprocess.check_call( [ './gradlew', 23 | '--no-daemon', 24 | 'build' ] ) 25 | 26 | 27 | if __name__ == '__main__': 28 | Main() 29 | -------------------------------------------------------------------------------- /groovy/snippet.vim: -------------------------------------------------------------------------------- 1 | let g:ycm_language_server += [ 2 | \ { 3 | \ 'name': 'groovy', 4 | \ 'cmdline': [ 'java', '-jar', expand( g:ycm_lsp_dir . '/groovy/groovy-language-server/build/libs/groovy-language-server-all.jar' ) ], 5 | \ 'filetypes': [ 'groovy' ] 6 | \ }, 7 | \ ] 8 | -------------------------------------------------------------------------------- /haskell/install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | print( 'NOTE: For haskell support read the README.md.' ) 4 | -------------------------------------------------------------------------------- /haskell/snippet.vim: -------------------------------------------------------------------------------- 1 | let g:ycm_language_server += [ 2 | \ { 3 | \ 'name': 'haskell-language-server', 4 | \ 'cmdline': [ 'haskell-language-server-wrapper', '--lsp' ], 5 | \ 'filetypes': [ 'haskell', 'lhaskell' ], 6 | \ 'project_root_files': [ 'stack.yaml', 'cabal.project', 'package.yaml', 'hie.yaml' ], 7 | \ }, 8 | \ ] 9 | -------------------------------------------------------------------------------- /install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import os 4 | import argparse 5 | import subprocess 6 | import contextlib 7 | import sys 8 | import platform 9 | 10 | DIR_OF_THIS_SCRIPT = os.path.dirname( os.path.abspath( __name__ ) ) 11 | 12 | parser = argparse.ArgumentParser() 13 | 14 | def OnWindows(): 15 | return platform.system() == 'Windows' 16 | 17 | @contextlib.contextmanager 18 | def TemporaryWorkingDirectory( d ): 19 | old_d = os.getcwd() 20 | print( '*** Entering direcory ' + d + ' *** ' ) 21 | try: 22 | os.chdir( d ) 23 | yield 24 | finally: 25 | os.chdir( old_d ) 26 | 27 | 28 | parser.add_argument( '--all', action='store_true' ) 29 | for d in os.listdir( DIR_OF_THIS_SCRIPT ): 30 | dirname = os.path.join( DIR_OF_THIS_SCRIPT, d ) 31 | if os.path.isdir( dirname ): 32 | parser.add_argument( '--enable-' + d, action='store_true' ) 33 | parser.add_argument( '--disable-' + d, action='store_true' ) 34 | 35 | args = parser.parse_args() 36 | 37 | done = [] 38 | failed = [] 39 | 40 | for d in os.listdir( DIR_OF_THIS_SCRIPT ): 41 | dirname = os.path.join( DIR_OF_THIS_SCRIPT, d ) 42 | if not os.path.isdir( dirname ): 43 | continue 44 | if not args.all and not getattr( args, 'enable_' + d ): 45 | continue 46 | if getattr( args, 'disable_' + d ): 47 | continue 48 | 49 | try: 50 | with TemporaryWorkingDirectory( dirname ): 51 | if not OnWindows() and os.path.exists( 'install' ): 52 | subprocess.check_call( [ 'bash', 'install' ] ) 53 | elif os.path.exists( 'install.py' ): 54 | subprocess.check_call( [ sys.executable, 'install.py' ] ) 55 | done.append( d ) 56 | except Exception: 57 | failed.append( d ) 58 | 59 | vimrc = '' 60 | 61 | if done: 62 | print( "** SUCCEEDED **: {}".format( ', '.join( done ) ) ) 63 | 64 | vimrc = f""" 65 | let g:ycm_lsp_dir = '{ DIR_OF_THIS_SCRIPT }' 66 | let g:ycm_language_server = [] 67 | """ 68 | 69 | for d in done: 70 | snippet = os.path.join( DIR_OF_THIS_SCRIPT, d, 'snippet.vim' ) 71 | if os.path.exists( snippet ): 72 | with open( snippet, 'r' ) as f: 73 | vimrc += f.read() 74 | 75 | 76 | if failed: 77 | print( "** FAILED **: {}".format( ', '.join( failed ) ) ) 78 | 79 | if not ( done + failed ): 80 | parser.print_help() 81 | 82 | if vimrc: 83 | with open( os.path.join( DIR_OF_THIS_SCRIPT, 'vimrc.generated' ), 'w' ) as f: 84 | f.write( vimrc ) 85 | 86 | print( "OK, now add the following to your vimrc:\n" ) 87 | print( f"source { os.path.join( DIR_OF_THIS_SCRIPT, 'vimrc.generated' ) }" ) 88 | -------------------------------------------------------------------------------- /jai/.gitignore: -------------------------------------------------------------------------------- 1 | Jails/ 2 | -------------------------------------------------------------------------------- /jai/install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import subprocess, os, platform, sys 4 | 5 | def OnWindows(): 6 | return platform.system() == 'Windows' 7 | 8 | # On Windows, distutils.spawn.find_executable only works for .exe files 9 | # but .bat and .cmd files are also executables, so we use our own 10 | # implementation. 11 | def FindExecutable( executable ): 12 | # Executable extensions used on Windows 13 | WIN_EXECUTABLE_EXTS = [ '.exe', '.bat', '.cmd' ] 14 | 15 | paths = os.environ[ 'PATH' ].split( os.pathsep ) 16 | base, extension = os.path.splitext( executable ) 17 | 18 | if OnWindows() and extension.lower() not in WIN_EXECUTABLE_EXTS: 19 | extensions = WIN_EXECUTABLE_EXTS 20 | else: 21 | extensions = [ '' ] 22 | 23 | for extension in extensions: 24 | executable_name = executable + extension 25 | if not os.path.isfile( executable_name ): 26 | for path in paths: 27 | executable_path = os.path.join( path, executable_name ) 28 | if os.path.isfile( executable_path ): 29 | return executable_path 30 | else: 31 | return executable_name 32 | return None 33 | 34 | 35 | def FindExecutableOrDie( executable, message ): 36 | path = FindExecutable( executable ) 37 | 38 | if not path: 39 | sys.exit( "ERROR: Unable to find executable '{0}'. {1}".format( 40 | executable, 41 | message ) ) 42 | 43 | return path 44 | 45 | 46 | 47 | def Main(): 48 | url = 'https://github.com/SogoCZE/Jails' 49 | jai = FindExecutableOrDie( 50 | 'jai', 51 | "You have to add jai to your path, e.g." 52 | "ln -s /path/to/jai/bin/jai-linux /usr/local/bin/jai" ) 53 | git = FindExecutableOrDie( 'git', 'Need git to download source' ) 54 | 55 | if not os.path.isdir( 'Jails' ): 56 | subprocess.check_call( [ git, 'clone', '--depth', '1', url ] ) 57 | 58 | os.chdir( 'Jails' ) 59 | subprocess.check_call( [ git, 'pull' ] ) 60 | subprocess.check_call( [ git, 'submodule', 'update', '--init', '--recursive' ] ) 61 | 62 | subprocess.check_call( [ jai, 'build.jai', '-import_dir', 'metaprogram_modules/' ] ) 63 | 64 | 65 | if __name__ == '__main__': 66 | Main() 67 | -------------------------------------------------------------------------------- /jai/snippet.vim: -------------------------------------------------------------------------------- 1 | let g:ycm_language_server += [ 2 | \ { 3 | \ 'name': 'Jails', 4 | \ 'cmdline': [ g:ycm_lsp_dir .. '/jai/Jails/bin/jails' ], 5 | \ 'filetypes': [ 'jai' ], 6 | \ 'project_root_files': [ 'jails.json', 'build.jai', 'first.jai' ], 7 | \ }, 8 | \ ] 9 | -------------------------------------------------------------------------------- /jetbrains_kotlin/README.md: -------------------------------------------------------------------------------- 1 | # Kotlin LSP 2 | 3 | JetBrains Kotlin Language Server Protocol (LSP) implementation based on IntelliJ 4 | IDEA's Kotlin plugin. 5 | 6 | ## Installation 7 | 8 | Requires being run with java 17 or later. The `JAVA_HOME` environment variable 9 | must be set to ponit to a java 17 or later to run the language server. 10 | 11 | 1. Download the zip from https://github.com/Kotlin/kotlin-lsp/blob/main/RELEASES.md 12 | and unpack it into this directory/kotlin-lsp. Make the `kotlin-lsp.sh` script 13 | executable. 14 | 2. Include the snippet 15 | 16 | Example: 17 | 18 | ``` 19 | cd lsp-examples/jetbrains_kotlin 20 | wget 21 | mkdir kotlin-lsp 22 | cd kotlin-lsp 23 | unzip ../ 24 | chmod +x kotlin-lsp.sh 25 | ``` 26 | 27 | If you can't have JAVA_HOME set globally in your Vim environment, you can 28 | manually set up the snippet to use any java 17 or later installation. 29 | 30 | ```viml 31 | let g:ycm_language_server += [ 32 | \ { 33 | \ 'name': 'jetbrains_kotlin', 34 | \ 'cmdline': [ 35 | \ '/usr/bin/env', 'JAVA_HOME=/path/to/java17', 36 | \ expand( g:ycm_lsp_dir ) . '/jetbrains_kotlin/kotlin-lsp/kotlin-lsp.sh', 37 | \ '--stdio', 38 | \ ], 39 | \ 'filetypes': [ 'kotlin' ], 40 | \ 'project_root_files': [ 'build.gradle', 'build.gradle.kts', 'pom.xml' ], 41 | \ }, 42 | \ ] 43 | 44 | ``` 45 | -------------------------------------------------------------------------------- /jetbrains_kotlin/snippet.vim: -------------------------------------------------------------------------------- 1 | let g:ycm_language_server += [ 2 | \ { 3 | \ 'name': 'jetbrains-kotlin', 4 | \ 'cmdline': [ 5 | \ expand( g:ycm_lsp_dir ) . '/jetbrains-kotlin/kotlin-lsp/kotlin-lsp.sh', 6 | \ '--stdio', 7 | \ ], 8 | \ 'filetypes': [ 'kotlin' ], 9 | \ 'project_root_files': [ 'build.gradle', 'build.gradle.kts', 'pom.xml' ], 10 | \ }, 11 | \ ] 12 | 13 | -------------------------------------------------------------------------------- /json/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /json/install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import subprocess, os, sys, platform 4 | 5 | def OnWindows(): 6 | return platform.system() == 'Windows' 7 | 8 | 9 | # On Windows, distutils.spawn.find_executable only works for .exe files 10 | # but .bat and .cmd files are also executables, so we use our own 11 | # implementation. 12 | def FindExecutable( executable ): 13 | # Executable extensions used on Windows 14 | WIN_EXECUTABLE_EXTS = [ '.exe', '.bat', '.cmd' ] 15 | 16 | paths = os.environ[ 'PATH' ].split( os.pathsep ) 17 | base, extension = os.path.splitext( executable ) 18 | 19 | if OnWindows() and extension.lower() not in WIN_EXECUTABLE_EXTS: 20 | extensions = WIN_EXECUTABLE_EXTS 21 | else: 22 | extensions = [ '' ] 23 | 24 | for extension in extensions: 25 | executable_name = executable + extension 26 | if not os.path.isfile( executable_name ): 27 | for path in paths: 28 | executable_path = os.path.join( path, executable_name ) 29 | if os.path.isfile( executable_path ): 30 | return executable_path 31 | else: 32 | return executable_name 33 | return None 34 | 35 | 36 | def FindExecutableOrDie( executable, message ): 37 | path = FindExecutable( executable ) 38 | 39 | if not path: 40 | sys.exit( "ERROR: Unable to find executable '{0}'. {1}".format( 41 | executable, 42 | message ) ) 43 | 44 | return path 45 | 46 | 47 | def Main(): 48 | npm = FindExecutableOrDie( 'npm', 'npm is required to set up Tern.' ) 49 | subprocess.check_call( [ npm, 'install', '--production' ] ) 50 | 51 | 52 | if __name__ == '__main__': 53 | Main() 54 | -------------------------------------------------------------------------------- /json/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "ycmd yaml-language-server runtime area", 3 | "dependencies": { 4 | "vscode-json-languageserver": "*" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /json/snippet.vim: -------------------------------------------------------------------------------- 1 | let g:ycm_language_server += [ 2 | \ { 3 | \ 'name': 'json', 4 | \ 'cmdline': [ 'node', expand( g:ycm_lsp_dir . '/json/node_modules/.bin/vscode-json-languageserver' ), '--stdio' ], 5 | \ 'filetypes': [ 'json' ], 6 | \ 'capabilities': { 'textDocument': { 'completion': { 'completionItem': { 'snippetSupport': v:true } } } }, 7 | \ }, 8 | \ ] 9 | -------------------------------------------------------------------------------- /jsonnet/.gitignore: -------------------------------------------------------------------------------- 1 | jsonnet-language-server/ 2 | bin/ 3 | -------------------------------------------------------------------------------- /jsonnet/README.md: -------------------------------------------------------------------------------- 1 | # Installation 2 | 3 | 1. Go to: https://github.com/grafana/jsonnet-language-server/releases 4 | 2. Pic the release for your platform 5 | 3. Put it in the bin/ directory under here, and rename to 6 | jsonnet-language-server. 7 | 4. Make sure it is executable: `chmod +x bin/jsonnet-language-server` 8 | 5. Include the snippet. 9 | 10 | # Extra conf 11 | 12 | Settings are classically undocumented, so go to 13 | https://github.com/grafana/jsonnet-language-server/blob/main/pkg/server/configuration.go#L33 14 | 15 | Example extra conf: 16 | 17 | ```python 18 | def read_file( path ): 19 | with open( path, 'r' ) as f: 20 | return f.read() 21 | 22 | def Settingss( **kwargs ): 23 | if kwargs[ 'language' ] == 'jsonnet': 24 | return { 25 | 'ls': { 26 | 'jpath': [ 27 | '/foo/bar/lib' 28 | ], 29 | # 'enable_eval_diagnositcs': True, 30 | 'enable_lint_diagnostics': True, 31 | 'ext_vars': { 32 | 'key': 'value', 33 | }, 34 | 'ext_code': { 35 | 'otherkey': read_file('input.jsonnet') 36 | }, 37 | # 'formatting': '' // uses formatting options from jsonnetfmt 38 | } 39 | } 40 | ``` 41 | -------------------------------------------------------------------------------- /jsonnet/snippet.vim: -------------------------------------------------------------------------------- 1 | let g:ycm_language_server += [ 2 | \ { 3 | \ 'name': 'jsonnet', 4 | \ 'cmdline': [ 5 | \ expand( g:ycm_lsp_dir ) . '/jsonnet/bin/jsonnet-language-server' 6 | \ ], 7 | \ 'filetypes': [ 'jsonnet' ], 8 | \ }, 9 | \ ] 10 | 11 | -------------------------------------------------------------------------------- /julia/install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import subprocess, os, sys, platform 4 | 5 | def OnWindows(): 6 | return platform.system() == 'Windows' 7 | 8 | 9 | # On Windows, distutils.spawn.find_executable only works for .exe files 10 | # but .bat and .cmd files are also executables, so we use our own 11 | # implementation. 12 | def FindExecutable( executable ): 13 | # Executable extensions used on Windows 14 | WIN_EXECUTABLE_EXTS = [ '.exe', '.bat', '.cmd' ] 15 | 16 | paths = os.environ[ 'PATH' ].split( os.pathsep ) 17 | base, extension = os.path.splitext( executable ) 18 | 19 | if OnWindows() and extension.lower() not in WIN_EXECUTABLE_EXTS: 20 | extensions = WIN_EXECUTABLE_EXTS 21 | else: 22 | extensions = [ '' ] 23 | 24 | for extension in extensions: 25 | executable_name = executable + extension 26 | if not os.path.isfile( executable_name ): 27 | for path in paths: 28 | executable_path = os.path.join( path, executable_name ) 29 | if os.path.isfile( executable_path ): 30 | return executable_path 31 | else: 32 | return executable_name 33 | return None 34 | 35 | 36 | def FindExecutableOrDie( executable, message ): 37 | path = FindExecutable( executable ) 38 | 39 | if not path: 40 | sys.exit( "ERROR: Unable to find executable '{0}'. {1}".format( 41 | executable, 42 | message ) ) 43 | 44 | return path 45 | 46 | 47 | def Main(): 48 | julia = FindExecutableOrDie( 49 | 'julia', 50 | 'julia is required to set up LanguageServer.jl.' ) 51 | subprocess.check_call( [ 52 | julia, 53 | '--startup-file=no', 54 | '--history-file=no', 55 | '-e', 56 | 'using Pkg;' 57 | 'Pkg.add("LanguageServer");' 58 | 'Pkg.add("SymbolServer");' 59 | 'Pkg.add("StaticLint")' ] ) 60 | 61 | 62 | if __name__ == '__main__': 63 | Main() 64 | -------------------------------------------------------------------------------- /julia/snippet.vim: -------------------------------------------------------------------------------- 1 | let s:julia_cmdline = ['julia', '--startup-file=no', '--history-file=no', '-e', ' 2 | \ using LanguageServer; 3 | \ using Pkg; 4 | \ import StaticLint; 5 | \ import SymbolServer; 6 | \ env_path = dirname(Pkg.Types.Context().env.project_file); 7 | \ debug = false; 8 | \ 9 | \ server = LanguageServer.LanguageServerInstance(stdin, stdout, debug, env_path, "", Dict()); 10 | \ server.runlinter = true; 11 | \ run(server); 12 | \ '] 13 | 14 | let g:ycm_language_server += [ 15 | \ { 'name': 'julia', 16 | \ 'filetypes': [ 'julia' ], 17 | \ 'project_root_files': [ 'Project.toml' ], 18 | \ 'cmdline': s:julia_cmdline 19 | \ }, 20 | \ ] 21 | -------------------------------------------------------------------------------- /kotlin/.gitignore: -------------------------------------------------------------------------------- 1 | KotlinLanguageServer 2 | -------------------------------------------------------------------------------- /kotlin/install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import subprocess, os, platform 4 | 5 | def OnWindows(): 6 | return platform.system == 'Windows' 7 | 8 | 9 | def Main(): 10 | url = 'https://github.com/fwcd/KotlinLanguageServer' 11 | if not os.path.isdir( 'KotlinLanguageServer' ): 12 | subprocess.check_call( [ 'git', 'clone', '--depth', '1', url ] ) 13 | 14 | os.chdir( 'KotlinLanguageServer' ) 15 | subprocess.check_call( [ 'git', 'pull' ] ) 16 | 17 | if OnWindows(): 18 | subprocess.check_call( [ './gradlew.bat', 19 | '--no-daemon', 20 | 'server:installDist' ] ) 21 | else: 22 | subprocess.check_call( [ './gradlew', 23 | '--no-daemon', 24 | 'server:installDist' ] ) 25 | 26 | 27 | if __name__ == '__main__': 28 | Main() 29 | -------------------------------------------------------------------------------- /kotlin/snippet.vim: -------------------------------------------------------------------------------- 1 | let g:ycm_language_server += [ 2 | \ { 'name': 'kotlin', 3 | \ 'filetypes': [ 'kotlin' ], 4 | \ 'cmdline': [ expand( g:ycm_lsp_dir . '/kotlin/KotlinLanguageServer/server/build/install/server/bin/kotlin-language-server' ) ], 5 | \ }, 6 | \ ] 7 | -------------------------------------------------------------------------------- /kotlin/test/.gitattributes: -------------------------------------------------------------------------------- 1 | # 2 | # https://help.github.com/articles/dealing-with-line-endings/ 3 | # 4 | # Linux start script should use lf 5 | /gradlew text eol=lf 6 | 7 | # These are Windows script files and should use crlf 8 | *.bat text eol=crlf 9 | 10 | -------------------------------------------------------------------------------- /kotlin/test/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore Gradle project-specific cache directory 2 | .gradle 3 | 4 | # Ignore Gradle build output directory 5 | build 6 | -------------------------------------------------------------------------------- /kotlin/test/.ycm_extra_conf.py: -------------------------------------------------------------------------------- 1 | def Settings( **kwargs ): 2 | return { 'ls': {} } 3 | -------------------------------------------------------------------------------- /kotlin/test/app/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by the Gradle 'init' task. 3 | * 4 | * This generated file contains a sample Kotlin application project to get you started. 5 | * For more details take a look at the 'Building Java & JVM projects' chapter in the Gradle 6 | * User Manual available at https://docs.gradle.org/8.1.1/userguide/building_java_projects.html 7 | */ 8 | 9 | plugins { 10 | // Apply the org.jetbrains.kotlin.jvm Plugin to add support for Kotlin. 11 | id 'org.jetbrains.kotlin.jvm' version '1.8.10' 12 | 13 | // Apply the application plugin to add support for building a CLI application in Java. 14 | id 'application' 15 | } 16 | 17 | repositories { 18 | // Use Maven Central for resolving dependencies. 19 | mavenCentral() 20 | } 21 | 22 | dependencies { 23 | // Use the Kotlin JUnit 5 integration. 24 | testImplementation 'org.jetbrains.kotlin:kotlin-test-junit5' 25 | 26 | // Use the JUnit 5 integration. 27 | testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.9.1' 28 | 29 | // This dependency is used by the application. 30 | implementation 'com.google.guava:guava:31.1-jre' 31 | } 32 | 33 | // Apply a specific Java toolchain to ease working on different environments. 34 | java { 35 | toolchain { 36 | languageVersion = JavaLanguageVersion.of(17) 37 | } 38 | } 39 | 40 | application { 41 | // Define the main class for the application. 42 | mainClass = 'test.AppKt' 43 | } 44 | 45 | tasks.named('test') { 46 | // Use JUnit Platform for unit tests. 47 | useJUnitPlatform() 48 | } 49 | -------------------------------------------------------------------------------- /kotlin/test/app/src/main/kotlin/test/App.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This Kotlin source file was generated by the Gradle 'init' task. 3 | */ 4 | package test 5 | 6 | class App { 7 | val greeting: String 8 | get() { 9 | return "Hello World!" 10 | } 11 | 12 | var foobar: String 13 | get() { 14 | return this.foobar 15 | } 16 | set(str) { 17 | this.foobar = str 18 | } 19 | } 20 | 21 | fun main() { 22 | var app = App() 23 | app.foobar = "Ben" 24 | println(app.greeting) 25 | println(app.foobar) 26 | } 27 | -------------------------------------------------------------------------------- /kotlin/test/app/src/test/kotlin/test/AppTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This Kotlin source file was generated by the Gradle 'init' task. 3 | */ 4 | package test 5 | 6 | import kotlin.test.Test 7 | import kotlin.test.assertNotNull 8 | 9 | class AppTest { 10 | @Test fun appHasAGreeting() { 11 | val classUnderTest = App() 12 | assertNotNull(classUnderTest.greeting, "app should have a greeting") 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /kotlin/test/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ycm-core/lsp-examples/46db2070275e00e16359ce6a02e7b8ba76691aa2/kotlin/test/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /kotlin/test/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip 4 | networkTimeout=10000 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /kotlin/test/gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | # This is normally unused 84 | # shellcheck disable=SC2034 85 | APP_BASE_NAME=${0##*/} 86 | APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit 87 | 88 | # Use the maximum available, or set MAX_FD != -1 to use that value. 89 | MAX_FD=maximum 90 | 91 | warn () { 92 | echo "$*" 93 | } >&2 94 | 95 | die () { 96 | echo 97 | echo "$*" 98 | echo 99 | exit 1 100 | } >&2 101 | 102 | # OS specific support (must be 'true' or 'false'). 103 | cygwin=false 104 | msys=false 105 | darwin=false 106 | nonstop=false 107 | case "$( uname )" in #( 108 | CYGWIN* ) cygwin=true ;; #( 109 | Darwin* ) darwin=true ;; #( 110 | MSYS* | MINGW* ) msys=true ;; #( 111 | NONSTOP* ) nonstop=true ;; 112 | esac 113 | 114 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 115 | 116 | 117 | # Determine the Java command to use to start the JVM. 118 | if [ -n "$JAVA_HOME" ] ; then 119 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 120 | # IBM's JDK on AIX uses strange locations for the executables 121 | JAVACMD=$JAVA_HOME/jre/sh/java 122 | else 123 | JAVACMD=$JAVA_HOME/bin/java 124 | fi 125 | if [ ! -x "$JAVACMD" ] ; then 126 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 127 | 128 | Please set the JAVA_HOME variable in your environment to match the 129 | location of your Java installation." 130 | fi 131 | else 132 | JAVACMD=java 133 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 134 | 135 | Please set the JAVA_HOME variable in your environment to match the 136 | location of your Java installation." 137 | fi 138 | 139 | # Increase the maximum file descriptors if we can. 140 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 141 | case $MAX_FD in #( 142 | max*) 143 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. 144 | # shellcheck disable=SC3045 145 | MAX_FD=$( ulimit -H -n ) || 146 | warn "Could not query maximum file descriptor limit" 147 | esac 148 | case $MAX_FD in #( 149 | '' | soft) :;; #( 150 | *) 151 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. 152 | # shellcheck disable=SC3045 153 | ulimit -n "$MAX_FD" || 154 | warn "Could not set maximum file descriptor limit to $MAX_FD" 155 | esac 156 | fi 157 | 158 | # Collect all arguments for the java command, stacking in reverse order: 159 | # * args from the command line 160 | # * the main class name 161 | # * -classpath 162 | # * -D...appname settings 163 | # * --module-path (only if needed) 164 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 165 | 166 | # For Cygwin or MSYS, switch paths to Windows format before running java 167 | if "$cygwin" || "$msys" ; then 168 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 169 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 170 | 171 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 172 | 173 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 174 | for arg do 175 | if 176 | case $arg in #( 177 | -*) false ;; # don't mess with options #( 178 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 179 | [ -e "$t" ] ;; #( 180 | *) false ;; 181 | esac 182 | then 183 | arg=$( cygpath --path --ignore --mixed "$arg" ) 184 | fi 185 | # Roll the args list around exactly as many times as the number of 186 | # args, so each arg winds up back in the position where it started, but 187 | # possibly modified. 188 | # 189 | # NB: a `for` loop captures its iteration list before it begins, so 190 | # changing the positional parameters here affects neither the number of 191 | # iterations, nor the values presented in `arg`. 192 | shift # remove old arg 193 | set -- "$@" "$arg" # push replacement arg 194 | done 195 | fi 196 | 197 | 198 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 199 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 200 | 201 | # Collect all arguments for the java command; 202 | # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of 203 | # shell script including quotes and variable substitutions, so put them in 204 | # double quotes to make sure that they get re-expanded; and 205 | # * put everything else in single quotes, so that it's not re-expanded. 206 | 207 | set -- \ 208 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 209 | -classpath "$CLASSPATH" \ 210 | org.gradle.wrapper.GradleWrapperMain \ 211 | "$@" 212 | 213 | # Stop when "xargs" is not available. 214 | if ! command -v xargs >/dev/null 2>&1 215 | then 216 | die "xargs is not available" 217 | fi 218 | 219 | # Use "xargs" to parse quoted args. 220 | # 221 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 222 | # 223 | # In Bash we could simply go: 224 | # 225 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 226 | # set -- "${ARGS[@]}" "$@" 227 | # 228 | # but POSIX shell has neither arrays nor command substitution, so instead we 229 | # post-process each arg (as a line of input to sed) to backslash-escape any 230 | # character that might be a shell metacharacter, then use eval to reverse 231 | # that process (while maintaining the separation between arguments), and wrap 232 | # the whole thing up as a single "set" statement. 233 | # 234 | # This will of course break if any of these variables contains a newline or 235 | # an unmatched quote. 236 | # 237 | 238 | eval "set -- $( 239 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 240 | xargs -n1 | 241 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 242 | tr '\n' ' ' 243 | )" '"$@"' 244 | 245 | exec "$JAVACMD" "$@" 246 | -------------------------------------------------------------------------------- /kotlin/test/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%"=="" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%"=="" set DIRNAME=. 29 | @rem This is normally unused 30 | set APP_BASE_NAME=%~n0 31 | set APP_HOME=%DIRNAME% 32 | 33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 35 | 36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 38 | 39 | @rem Find java.exe 40 | if defined JAVA_HOME goto findJavaFromJavaHome 41 | 42 | set JAVA_EXE=java.exe 43 | %JAVA_EXE% -version >NUL 2>&1 44 | if %ERRORLEVEL% equ 0 goto execute 45 | 46 | echo. 47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 48 | echo. 49 | echo Please set the JAVA_HOME variable in your environment to match the 50 | echo location of your Java installation. 51 | 52 | goto fail 53 | 54 | :findJavaFromJavaHome 55 | set JAVA_HOME=%JAVA_HOME:"=% 56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 57 | 58 | if exist "%JAVA_EXE%" goto execute 59 | 60 | echo. 61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 62 | echo. 63 | echo Please set the JAVA_HOME variable in your environment to match the 64 | echo location of your Java installation. 65 | 66 | goto fail 67 | 68 | :execute 69 | @rem Setup the command line 70 | 71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 72 | 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if %ERRORLEVEL% equ 0 goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | set EXIT_CODE=%ERRORLEVEL% 85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 87 | exit /b %EXIT_CODE% 88 | 89 | :mainEnd 90 | if "%OS%"=="Windows_NT" endlocal 91 | 92 | :omega 93 | -------------------------------------------------------------------------------- /kotlin/test/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by the Gradle 'init' task. 3 | * 4 | * The settings file is used to specify which projects to include in your build. 5 | * 6 | * Detailed information about configuring a multi-project build in Gradle can be found 7 | * in the user manual at https://docs.gradle.org/8.1.1/userguide/multi_project_builds.html 8 | */ 9 | 10 | plugins { 11 | // Apply the foojay-resolver plugin to allow automatic download of JDKs 12 | id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0' 13 | } 14 | 15 | rootProject.name = 'test' 16 | include('app') 17 | -------------------------------------------------------------------------------- /lua/.gitignore: -------------------------------------------------------------------------------- 1 | lua-language-server/ 2 | -------------------------------------------------------------------------------- /lua/install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | from urllib import request 4 | import os 5 | import contextlib 6 | import functools 7 | import time 8 | import ssl 9 | import zipfile 10 | import shutil 11 | import platform 12 | import re 13 | import tarfile 14 | 15 | VERSION = '3.6.11' 16 | URL = ( 17 | 'https://github.com/LuaLS/lua-language-server/releases/download/{version}' 18 | '/{package_name}' 19 | ) 20 | PACKAGE_NAME = 'lua-language-server-{version}-{platform}-{arch}.{ext}' 21 | 22 | @contextlib.contextmanager 23 | def CurrentWorkingDir( d ): 24 | cur_d = os.getcwd() 25 | try: 26 | os.chdir( d ) 27 | yield 28 | finally: 29 | os.chdir( cur_d ) 30 | 31 | 32 | def MakeExecutable( file_path ): 33 | # TODO: import stat and use them by _just_ adding the X bit. 34 | print( 'Making executable: {}'.format( file_path ) ) 35 | os.chmod( file_path, 0o755 ) 36 | 37 | 38 | def WithRetry( f ): 39 | retries = 5 40 | timeout = 1 # seconds 41 | 42 | @functools.wraps( f ) 43 | def wrapper( *args, **kwargs ): 44 | thrown = None 45 | for _ in range( retries ): 46 | try: 47 | return f( *args, **kwargs ) 48 | except Exception as e: 49 | thrown = e 50 | print( "Failed - {}, will retry in {} seconds".format( e, timeout ) ) 51 | time.sleep( timeout ) 52 | raise thrown 53 | 54 | return wrapper 55 | 56 | 57 | @WithRetry 58 | def UrlOpen( *args, **kwargs ): 59 | return request.urlopen( *args, **kwargs ) 60 | 61 | 62 | def DownloadFileTo( url, 63 | destination, 64 | file_name = None, 65 | check_certificate = True ): 66 | if not file_name: 67 | file_name = url.split( '/' )[ -1 ] 68 | 69 | file_path = os.path.abspath( os.path.join( destination, file_name ) ) 70 | 71 | if not os.path.isdir( destination ): 72 | os.makedirs( destination ) 73 | 74 | if os.path.exists( file_path ): 75 | print( "Removing existing {}".format( file_path ) ) 76 | os.remove( file_path ) 77 | 78 | r = request.Request( url, headers = { 'User-Agent': 'Vimspector' } ) 79 | 80 | print( "Downloading {} to {}/{}".format( url, destination, file_name ) ) 81 | 82 | if not check_certificate: 83 | context = ssl.create_default_context() 84 | context.check_hostname = False 85 | context.verify_mode = ssl.CERT_NONE 86 | kwargs = { "context": context } 87 | else: 88 | kwargs = {} 89 | 90 | with contextlib.closing( UrlOpen( r, **kwargs ) ) as u: 91 | with open( file_path, 'wb' ) as f: 92 | f.write( u.read() ) 93 | 94 | return file_path 95 | 96 | 97 | # Python's ZipFile module strips execute bits from files, for no good reason 98 | # other than crappy code. Let's do it's job for it. 99 | class ModePreservingZipFile( zipfile.ZipFile ): 100 | def extract( self, member, path = None, pwd = None ): 101 | if not isinstance( member, zipfile.ZipInfo ): 102 | member = self.getinfo( member ) 103 | 104 | if path is None: 105 | path = os.getcwd() 106 | 107 | ret_val = self._extract_member( member, path, pwd ) 108 | attr = member.external_attr >> 16 109 | os.chmod( ret_val, attr ) 110 | return ret_val 111 | 112 | 113 | def RemoveIfExists( destination ): 114 | if os.path.exists( destination ) or os.path.islink( destination ): 115 | if os.path.islink( destination ): 116 | print( "Removing file {}".format( destination ) ) 117 | os.remove( destination ) 118 | else: 119 | print( "Removing dir {}".format( destination ) ) 120 | shutil.rmtree( destination ) 121 | 122 | 123 | def ExtractZipTo( file_path, fmt, destination ): 124 | print( "Extracting {} to {}".format( file_path, destination ) ) 125 | RemoveIfExists( destination ) 126 | 127 | if fmt == 'zip': 128 | with ModePreservingZipFile( file_path ) as f: 129 | f.extractall( path = destination ) 130 | elif fmt == 'tar': 131 | with tarfile.open( file_path ) as f: 132 | f.extractall( path = destination ) 133 | 134 | 135 | OUTPUT_DIR = os.path.join( os.path.dirname( os.path.abspath( __file__ ) ) , 136 | 'lua-language-server' ) 137 | if os.path.isdir( OUTPUT_DIR ): 138 | shutil.rmtree( OUTPUT_DIR ) 139 | 140 | os.makedirs( OUTPUT_DIR ) 141 | os.chdir( OUTPUT_DIR ) 142 | 143 | 144 | def GetPlatform(): 145 | if 'YCM_PLATFORM' in os.environ: 146 | return os.environ[ 'YCM_PLATFORM' ] 147 | 148 | if platform.system() == 'Darwin': 149 | return 'darwin' 150 | if platform.system() == 'Windows': 151 | return 'win32' 152 | return 'linux' 153 | 154 | 155 | def GetArch(): 156 | if 'YCM_ARCH' in os.environ: 157 | return os.environ[ 'YCM_ARCH' ] 158 | 159 | machine = platform.machine() 160 | if re.match( '^arm', machine.lower() ): 161 | return 'arm64' 162 | 163 | return 'x64' 164 | 165 | package = { 166 | 'platform': GetPlatform(), 167 | 'arch': GetArch(), 168 | 'ext': 'zip' if GetPlatform() == 'win32' else 'tar.gz', 169 | 'version': VERSION, 170 | } 171 | package_name = PACKAGE_NAME.format( **package ) 172 | url = URL.format( package_name = package_name, **package ) 173 | file_name = DownloadFileTo( url, OUTPUT_DIR, package_name ) 174 | ExtractZipTo( file_name, 175 | 'zip' if package['ext'] == 'zip' else 'tar', 176 | os.path.join( OUTPUT_DIR, 'root' ) ) 177 | -------------------------------------------------------------------------------- /lua/snippet.vim: -------------------------------------------------------------------------------- 1 | let g:ycm_language_server += [ 2 | \ { 'name': 'lua', 3 | \ 'filetypes': [ 'lua' ], 4 | \ 'cmdline': [ g:ycm_lsp_dir . '/lua/lua-language-server/root/bin/lua-language-server' ], 5 | \ 'capabilities': { 'textDocument': { 'completion': { 'completionItem': { 'snippetSupport': v:true } } } }, 6 | \ 'triggerCharacters': [] 7 | \ }, 8 | \ ] 9 | -------------------------------------------------------------------------------- /matlab/.gitignore: -------------------------------------------------------------------------------- 1 | MATLAB-language-server 2 | -------------------------------------------------------------------------------- /matlab/install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import subprocess, os, sys, platform 4 | 5 | 6 | def OnWindows(): 7 | return platform.system == 'Windows' 8 | 9 | 10 | # On Windows, distutils.spawn.find_executable only works for .exe files 11 | # but .bat and .cmd files are also executables, so we use our own 12 | # implementation. 13 | def FindExecutable( executable ): 14 | # Executable extensions used on Windows 15 | WIN_EXECUTABLE_EXTS = [ '.exe', '.bat', '.cmd' ] 16 | 17 | paths = os.environ[ 'PATH' ].split( os.pathsep ) 18 | base, extension = os.path.splitext( executable ) 19 | 20 | if OnWindows() and extension.lower() not in WIN_EXECUTABLE_EXTS: 21 | extensions = WIN_EXECUTABLE_EXTS 22 | else: 23 | extensions = [ '' ] 24 | 25 | for extension in extensions: 26 | executable_name = executable + extension 27 | if not os.path.isfile( executable_name ): 28 | for path in paths: 29 | executable_path = os.path.join( path, executable_name ) 30 | if os.path.isfile( executable_path ): 31 | return executable_path 32 | else: 33 | return executable_name 34 | return None 35 | 36 | 37 | def FindExecutableOrDie( executable, message ): 38 | path = FindExecutable( executable ) 39 | 40 | if not path: 41 | sys.exit( "ERROR: Unable to find executable '{0}'. {1}".format( 42 | executable, 43 | message ) ) 44 | 45 | return path 46 | 47 | 48 | def Main(): 49 | npm = FindExecutableOrDie( 'npm', 'npm is required to set up VLS.' ) 50 | git = FindExecutableOrDie( 'git', 'git is required' ) 51 | 52 | url = 'https://github.com/mathworks/MATLAB-language-server' 53 | if not os.path.isdir( 'MATLAB-language-server' ): 54 | subprocess.check_call( [ git, 'clone', '--depth', '1', url ] ) 55 | 56 | os.chdir( 'MATLAB-language-server' ) 57 | subprocess.check_call( [ git, 'pull' ] ) 58 | 59 | subprocess.check_call( [ npm, 'install' ] ) 60 | subprocess.check_call( [ npm, 'run', 'package' ] ) 61 | 62 | 63 | if __name__ == '__main__': 64 | Main() 65 | -------------------------------------------------------------------------------- /matlab/snippet.vim: -------------------------------------------------------------------------------- 1 | let g:ycm_language_server += [ 2 | \ { 'name': 'MATLAB', 3 | \ 'filetypes': [ 'matlab' ], 4 | \ 'cmdline': [ 'node', 5 | \ expand( g:ycm_lsp_dir . '/matlab/MATLAB-language-server/out/index.js' ), 6 | \ '--stdio' ] 7 | \ }, 8 | \ ] 9 | 10 | -------------------------------------------------------------------------------- /php/.gitignore: -------------------------------------------------------------------------------- 1 | vendor/ 2 | -------------------------------------------------------------------------------- /php/install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import subprocess, os, sys, platform 4 | 5 | def OnWindows(): 6 | return platform.system() == 'Windows' 7 | 8 | 9 | # On Windows, distutils.spawn.find_executable only works for .exe files 10 | # but .bat and .cmd files are also executables, so we use our own 11 | # implementation. 12 | def FindExecutable( executable ): 13 | # Executable extensions used on Windows 14 | WIN_EXECUTABLE_EXTS = [ '.exe', '.bat', '.cmd' ] 15 | 16 | paths = os.environ[ 'PATH' ].split( os.pathsep ) 17 | base, extension = os.path.splitext( executable ) 18 | 19 | if OnWindows() and extension.lower() not in WIN_EXECUTABLE_EXTS: 20 | extensions = WIN_EXECUTABLE_EXTS 21 | else: 22 | extensions = [ '' ] 23 | 24 | for extension in extensions: 25 | executable_name = executable + extension 26 | if not os.path.isfile( executable_name ): 27 | for path in paths: 28 | executable_path = os.path.join( path, executable_name ) 29 | if os.path.isfile( executable_path ): 30 | return executable_path 31 | else: 32 | return executable_name 33 | return None 34 | 35 | 36 | def FindExecutableOrDie( executable, message ): 37 | path = FindExecutable( executable ) 38 | 39 | if not path: 40 | sys.exit( "ERROR: Unable to find executable '{0}'. {1}".format( 41 | executable, 42 | message ) ) 43 | 44 | return path 45 | 46 | 47 | def Main(): 48 | composer = FindExecutableOrDie( 49 | 'composer', 50 | 'composer is required to set up phpactor.' ) 51 | subprocess.check_call( [ composer, 52 | 'create-project', 53 | 'phpactor/phpactor', 54 | 'phpactor', 55 | '--prefer-dist', 56 | '--no-dev' ] ) 57 | 58 | if __name__ == '__main__': 59 | Main() 60 | 61 | -------------------------------------------------------------------------------- /php/snippet.vim: -------------------------------------------------------------------------------- 1 | let g:ycm_language_server += [ 2 | \ { 3 | \ 'name': 'php', 4 | \ 'cmdline': [ 'php', '-d', 'memory_limt=1024M', g:ycm_lsp_dir . '/php/phpactor/bin/phpactor', 'language-server' ], 5 | \ 'filetypes': [ 'php' ], 6 | \ }, 7 | \ ] 8 | -------------------------------------------------------------------------------- /php/test/test.php: -------------------------------------------------------------------------------- 1 | edible = $edible; 12 | $this->color = $color; 13 | } 14 | 15 | function is_edible() 16 | { 17 | return $this->edible; 18 | } 19 | 20 | function what_color() 21 | { 22 | return $this->color; 23 | } 24 | 25 | } // end of class Vegetable 26 | 27 | // extends the base class 28 | class Spinach extends Vegetable { 29 | 30 | var $cooked = false; 31 | 32 | function __construct() 33 | { 34 | parent::__construct(true, "green"); 35 | } 36 | 37 | function cook_it() 38 | { 39 | $this->cooked = true; 40 | } 41 | 42 | function is_cooked() 43 | { 44 | return $this->cooked; 45 | } 46 | 47 | } // end of class Spinach 48 | 49 | var $veg = new Vegetable(); 50 | 51 | ?> 52 | -------------------------------------------------------------------------------- /postgres/install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import subprocess, os, sys, platform 4 | 5 | def OnWindows(): 6 | return platform.system() == 'Windows' 7 | 8 | 9 | # On Windows, distutils.spawn.find_executable only works for .exe files 10 | # but .bat and .cmd files are also executables, so we use our own 11 | # implementation. 12 | def FindExecutable( executable ): 13 | # Executable extensions used on Windows 14 | WIN_EXECUTABLE_EXTS = [ '.exe', '.bat', '.cmd' ] 15 | 16 | paths = os.environ[ 'PATH' ].split( os.pathsep ) 17 | base, extension = os.path.splitext( executable ) 18 | 19 | if OnWindows() and extension.lower() not in WIN_EXECUTABLE_EXTS: 20 | extensions = WIN_EXECUTABLE_EXTS 21 | else: 22 | extensions = [ '' ] 23 | 24 | for extension in extensions: 25 | executable_name = executable + extension 26 | if not os.path.isfile( executable_name ): 27 | for path in paths: 28 | executable_path = os.path.join( path, executable_name ) 29 | if os.path.isfile( executable_path ): 30 | return executable_path 31 | else: 32 | return executable_name 33 | return None 34 | 35 | 36 | def FindExecutableOrDie( executable, message ): 37 | path = FindExecutable( executable ) 38 | 39 | if not path: 40 | sys.exit( "ERROR: Unable to find executable '{0}'. {1}".format( 41 | executable, 42 | message ) ) 43 | 44 | return path 45 | 46 | 47 | def Main(): 48 | npm = FindExecutableOrDie( 'npm', 'npm is required to set up Postgre LS.' ) 49 | ## Note this is how we do because they use `"optionalDependencies"` under; 50 | ## ./node_modules/@postgrestools/postgrestools/package.json 51 | ## ... And `npm add` seems to auto-detect OS and architecture 52 | subprocess.check_call( [ npm, 'add', '--save-dev', '--save-exact', '@postgrestools/postgrestools' ] ) 53 | 54 | 55 | if __name__ == '__main__': 56 | Main() 57 | -------------------------------------------------------------------------------- /postgres/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "ycmd postgres-ls runtime area" 3 | } 4 | -------------------------------------------------------------------------------- /postgres/snippet.vim: -------------------------------------------------------------------------------- 1 | let g:ycm_language_server += [ 2 | \ { 3 | \ 'name': 'postgres', 4 | \ 'filetypes': [ 'sql' ], 5 | \ 'cmdline': [ expand( g:ycm_lsp_dir . '/postgres/node_modules/.bin/postgrestools' ), 'lsp-proxy' ], 6 | \ 'project_root_files': [ 'postgrestools.jsonc' ] 7 | \ }, 8 | \ ] 9 | -------------------------------------------------------------------------------- /purescript/install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import subprocess, os, sys, platform 4 | 5 | def OnWindows(): 6 | return platform.system() == 'Windows' 7 | 8 | 9 | # On Windows, distutils.spawn.find_executable only works for .exe files 10 | # but .bat and .cmd files are also executables, so we use our own 11 | # implementation. 12 | def FindExecutable( executable ): 13 | # Executable extensions used on Windows 14 | WIN_EXECUTABLE_EXTS = [ '.exe', '.bat', '.cmd' ] 15 | 16 | paths = os.environ[ 'PATH' ].split( os.pathsep ) 17 | base, extension = os.path.splitext( executable ) 18 | 19 | if OnWindows() and extension.lower() not in WIN_EXECUTABLE_EXTS: 20 | extensions = WIN_EXECUTABLE_EXTS 21 | else: 22 | extensions = [ '' ] 23 | 24 | for extension in extensions: 25 | executable_name = executable + extension 26 | if not os.path.isfile( executable_name ): 27 | for path in paths: 28 | executable_path = os.path.join( path, executable_name ) 29 | if os.path.isfile( executable_path ): 30 | return executable_path 31 | else: 32 | return executable_name 33 | return None 34 | 35 | 36 | def FindExecutableOrDie( executable, message ): 37 | path = FindExecutable( executable ) 38 | 39 | if not path: 40 | sys.exit( "ERROR: Unable to find executable '{0}'. {1}".format( 41 | executable, 42 | message ) ) 43 | 44 | return path 45 | 46 | 47 | def Main(): 48 | npm = FindExecutableOrDie( 'npm', 'npm is required to set up Tern.' ) 49 | subprocess.check_call( [ npm, 'install', '--production' ] ) 50 | 51 | 52 | if __name__ == '__main__': 53 | Main() 54 | -------------------------------------------------------------------------------- /purescript/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "ycmd purescript-language-server runtime area", 3 | "dependencies": { 4 | "purescript-language-server": "*" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /purescript/snippet.vim: -------------------------------------------------------------------------------- 1 | let g:ycm_language_server += [ 2 | \ { 'name': 'purescript', 3 | \ 'filetypes': [ 'purescript' ], 4 | \ 'cmdline': [ expand( g:ycm_lsp_dir . '/purescript/node_modules/.bin/purescript-language-server' ), '--stdio' ] 5 | \ }, 6 | \ ] 7 | -------------------------------------------------------------------------------- /python/install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import subprocess, os, sys, platform 4 | 5 | def OnWindows(): 6 | return platform.system() == 'Windows' 7 | 8 | 9 | # On Windows, distutils.spawn.find_executable only works for .exe files 10 | # but .bat and .cmd files are also executables, so we use our own 11 | # implementation. 12 | def FindExecutable( executable ): 13 | # Executable extensions used on Windows 14 | WIN_EXECUTABLE_EXTS = [ '.exe', '.bat', '.cmd' ] 15 | 16 | paths = os.environ[ 'PATH' ].split( os.pathsep ) 17 | base, extension = os.path.splitext( executable ) 18 | 19 | if OnWindows() and extension.lower() not in WIN_EXECUTABLE_EXTS: 20 | extensions = WIN_EXECUTABLE_EXTS 21 | else: 22 | extensions = [ '' ] 23 | 24 | for extension in extensions: 25 | executable_name = executable + extension 26 | if not os.path.isfile( executable_name ): 27 | for path in paths: 28 | executable_path = os.path.join( path, executable_name ) 29 | if os.path.isfile( executable_path ): 30 | return executable_path 31 | else: 32 | return executable_name 33 | return None 34 | 35 | 36 | def FindExecutableOrDie( executable, message ): 37 | path = FindExecutable( executable ) 38 | 39 | if not path: 40 | sys.exit( "ERROR: Unable to find executable '{0}'. {1}".format( 41 | executable, 42 | message ) ) 43 | 44 | return path 45 | 46 | 47 | def Main(): 48 | npm = FindExecutableOrDie( 'npm', 'npm is required to set up Tern.' ) 49 | subprocess.check_call( [ npm, 'install', '--production' ] ) 50 | 51 | 52 | if __name__ == '__main__': 53 | Main() 54 | -------------------------------------------------------------------------------- /python/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "pyright", 3 | "dependencies": { 4 | "pyright": "*" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /python/snippet.vim: -------------------------------------------------------------------------------- 1 | let g:ycm_language_server += [ 2 | \ { 3 | \ 'name': 'python', 4 | \ 'cmdline': [ 'node', expand( g:ycm_lsp_dir . '/python/node_modules/.bin/pyright-langserver' ), '--stdio' ], 5 | \ 'filetypes': [ 'python' ], 6 | \ }, 7 | \ ] 8 | -------------------------------------------------------------------------------- /racket/install.py: -------------------------------------------------------------------------------- 1 | import subprocess, os, platform, sys 2 | 3 | def OnWindows(): 4 | return platform.system() == 'Windows' 5 | 6 | 7 | # On Windows, distutils.spawn.find_executable only works for .exe files 8 | # but .bat and .cmd files are also executables, so we use our own 9 | # implementation. 10 | def FindExecutable( executable ): 11 | # Executable extensions used on Windows 12 | WIN_EXECUTABLE_EXTS = [ '.exe', '.bat', '.cmd' ] 13 | 14 | paths = os.environ[ 'PATH' ].split( os.pathsep ) 15 | base, extension = os.path.splitext( executable ) 16 | 17 | if OnWindows() and extension.lower() not in WIN_EXECUTABLE_EXTS: 18 | extensions = WIN_EXECUTABLE_EXTS 19 | else: 20 | extensions = [ '' ] 21 | 22 | for extension in extensions: 23 | executable_name = executable + extension 24 | if not os.path.isfile( executable_name ): 25 | for path in paths: 26 | if path.startswith('~'): 27 | path = os.path.expanduser('~')+path[1:] 28 | 29 | executable_path = os.path.join( path, executable_name ) 30 | if os.path.isfile( executable_path ): 31 | return executable_path 32 | else: 33 | return executable_name 34 | return None 35 | 36 | 37 | def FindExecutableOrDie( executable, message ): 38 | path = FindExecutable( executable ) 39 | 40 | if not path: 41 | sys.exit( "ERROR: Unable to find executable '{0}'. {1}".format( 42 | executable, 43 | message ) ) 44 | 45 | return path 46 | 47 | def InstallRacoPackage( racoExecutable, packageName ): 48 | print("Installing " + packageName + " from raco") 49 | subprocess.check_call( [ racoExecutable, 'pkg', 'install', '--skip-installed', packageName] ) 50 | 51 | def Main(): 52 | raco = FindExecutableOrDie('raco', 'raco is required to setup Racket language server') 53 | 54 | InstallRacoPackage(raco, 'racket-langserver') 55 | # Used by Vim when it recognizes racket filetype 56 | InstallRacoPackage(raco, 'fmt') 57 | 58 | 59 | if __name__ == '__main__': 60 | Main() 61 | -------------------------------------------------------------------------------- /racket/snippet.vim: -------------------------------------------------------------------------------- 1 | let g:ycm_language_server += [ 2 | \ { 'name': 'racket', 3 | \ 'filetypes': [ 'racket' , 'scheme' ], 4 | \ 'cmdline': [ 'racket', '-l', 'racket-langserver' ], 5 | \ }, 6 | \ ] 7 | -------------------------------------------------------------------------------- /ruby/.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | vendor/ 3 | Gemfile.lock 4 | .bundle/ 5 | -------------------------------------------------------------------------------- /ruby/Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source "https://rubygems.org" 4 | gem 'solargraph' 5 | -------------------------------------------------------------------------------- /ruby/install: -------------------------------------------------------------------------------- 1 | #/usr/bin/env bash 2 | 3 | bundle install --path=vendor/bundle --binstubs 4 | -------------------------------------------------------------------------------- /ruby/snippet.vim: -------------------------------------------------------------------------------- 1 | let g:ycm_language_server += [ 2 | \ { 3 | \ 'name': 'ruby', 4 | \ 'cmdline': [ expand( g:ycm_lsp_dir . '/ruby/bin/solargraph' ), 'stdio' ], 5 | \ 'filetypes': [ 'ruby' ], 6 | \ }, 7 | \ ] 8 | -------------------------------------------------------------------------------- /ruby/test/test.rb: -------------------------------------------------------------------------------- 1 | class Badger 2 | 3 | attr_accessor :name, :size # Creates getter and setter methods. 4 | 5 | def initialize(name, size) 6 | @name = name 7 | @size = size 8 | end 9 | 10 | # Instance method 11 | def name_backwards 12 | @name.reverse 13 | @name. 14 | end 15 | 16 | # 17 | def self. 18 | 19 | end 20 | 21 | # Create the new instance. 22 | badger = Badger.new('Charles', 12) 23 | 24 | # Access it's attributes. 25 | puts badger.size # => 12 26 | puts badger.name # => Charles 27 | badger.size = 15 28 | puts badger.size # => 15 29 | 30 | # OMGWTF open the class up and add new methods. 31 | class Badger 32 | def double_size 33 | @size*2 34 | end 35 | end 36 | 37 | puts badger.double_size # => 30 38 | 39 | # singleton methods 40 | def badger.moo 41 | puts "moo" 42 | end 43 | 44 | another_badger => Badger.new('Alice', 3) 45 | 46 | puts badger.moo # => 'moo' 47 | puts another_badger.moo # => Method Not Found Error 48 | -------------------------------------------------------------------------------- /scala/install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | print( 'NOTE: For scala support install `metals` using your system package manager.' ) 4 | -------------------------------------------------------------------------------- /scala/snippet.vim: -------------------------------------------------------------------------------- 1 | let g:ycm_language_server += [ 2 | \ { 'name': 'scala', 3 | \ 'filetypes': [ 'scala' ], 4 | \ 'cmdline': [ 'metals' ], 5 | \ 'project_root_files': [ 'build.sbt' ] 6 | \ }, 7 | \ ] 8 | -------------------------------------------------------------------------------- /test/.gitignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | node_modules/ 3 | -------------------------------------------------------------------------------- /test/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ycm-test-languageserver", 3 | "version": "1.0.0", 4 | "description": "Language server useful for testing the YCM generic LSP completer", 5 | "main": "dist/index.js", 6 | "scripts": { 7 | "watch": "./node_modules/.bin/tsc -w", 8 | "build": "./node_modules/.bin/tsc" 9 | }, 10 | "license": "MIT", 11 | "dependencies": { 12 | "vscode-languageserver": "^6.1.1", 13 | "vscode-languageserver-textdocument": "^1.0.1" 14 | }, 15 | "devDependencies": { 16 | "@types/node": "^13.7.4", 17 | "typescript": "^3.8.2" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /test/src/server.ts: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | * ------------------------------------------------------------------------------------------ */ 5 | 6 | import { 7 | createConnection, 8 | TextDocuments, 9 | Diagnostic, 10 | DiagnosticSeverity, 11 | ProposedFeatures, 12 | InitializeParams, 13 | DidChangeConfigurationNotification, 14 | CompletionItem, 15 | CompletionItemKind, 16 | TextDocumentPositionParams, 17 | TextDocumentSyncKind, 18 | InitializeResult, 19 | HoverParams, 20 | Hover 21 | } from 'vscode-languageserver'; 22 | 23 | import { 24 | TextDocument 25 | } from 'vscode-languageserver-textdocument'; 26 | 27 | // Create a connection for the server. The connection uses Node's IPC as a transport. 28 | // Also include all preview / proposed LSP features. 29 | let connection = createConnection(ProposedFeatures.all); 30 | 31 | // Create a simple text document manager. The text document manager 32 | // supports full document sync only 33 | let documents: TextDocuments = new TextDocuments(TextDocument); 34 | 35 | let hasConfigurationCapability: boolean = false; 36 | let hasWorkspaceFolderCapability: boolean = false; 37 | let hasDiagnosticRelatedInformationCapability: boolean = false; 38 | 39 | connection.onInitialize((params: InitializeParams) => { 40 | let capabilities = params.capabilities; 41 | 42 | // Does the client support the `workspace/configuration` request? 43 | // If not, we will fall back using global settings 44 | hasConfigurationCapability = !!( 45 | capabilities.workspace && !!capabilities.workspace.configuration 46 | ); 47 | hasWorkspaceFolderCapability = !!( 48 | capabilities.workspace && !!capabilities.workspace.workspaceFolders 49 | ); 50 | hasDiagnosticRelatedInformationCapability = !!( 51 | capabilities.textDocument && 52 | capabilities.textDocument.publishDiagnostics && 53 | capabilities.textDocument.publishDiagnostics.relatedInformation 54 | ); 55 | 56 | const result: InitializeResult = { 57 | capabilities: { 58 | textDocumentSync: TextDocumentSyncKind.Full, 59 | // Tell the client that the server supports code completion 60 | completionProvider: { 61 | resolveProvider: true 62 | } 63 | } 64 | }; 65 | if (hasWorkspaceFolderCapability) { 66 | result.capabilities.workspace = { 67 | workspaceFolders: { 68 | supported: true 69 | } 70 | }; 71 | } 72 | return result; 73 | }); 74 | 75 | connection.onInitialized(() => { 76 | if (hasConfigurationCapability) { 77 | // Register for all configuration changes. 78 | connection.client.register(DidChangeConfigurationNotification.type, undefined); 79 | } 80 | if (hasWorkspaceFolderCapability) { 81 | connection.workspace.onDidChangeWorkspaceFolders(_event => { 82 | connection.console.log('Workspace folder change event received.'); 83 | }); 84 | } 85 | }); 86 | 87 | // The example settings 88 | interface ExampleSettings { 89 | maxNumberOfProblems: number; 90 | } 91 | 92 | // The global settings, used when the `workspace/configuration` request is not supported by the client. 93 | // Please note that this is not the case when using this server with the client provided in this example 94 | // but could happen with other clients. 95 | const defaultSettings: ExampleSettings = { maxNumberOfProblems: 1000 }; 96 | let globalSettings: ExampleSettings = defaultSettings; 97 | 98 | // Cache the settings of all open documents 99 | let documentSettings: Map> = new Map(); 100 | 101 | connection.onDidChangeConfiguration(change => { 102 | if (hasConfigurationCapability) { 103 | // Reset all cached document settings 104 | documentSettings.clear(); 105 | } else { 106 | globalSettings = ( 107 | (change.settings.languageServerExample || defaultSettings) 108 | ); 109 | } 110 | 111 | // Revalidate all open text documents 112 | documents.all().forEach(validateTextDocument); 113 | }); 114 | 115 | function getDocumentSettings(resource: string): Thenable { 116 | if (!hasConfigurationCapability) { 117 | return Promise.resolve(globalSettings); 118 | } 119 | let result = documentSettings.get(resource); 120 | if (!result) { 121 | result = connection.workspace.getConfiguration({ 122 | scopeUri: resource, 123 | section: 'languageServerExample' 124 | }); 125 | documentSettings.set(resource, result); 126 | } 127 | return result; 128 | } 129 | 130 | // Only keep settings for open documents 131 | documents.onDidClose(e => { 132 | documentSettings.delete(e.document.uri); 133 | }); 134 | 135 | // The content of a text document has changed. This event is emitted 136 | // when the text document first opened or when its content has changed. 137 | documents.onDidChangeContent(change => { 138 | validateTextDocument(change.document); 139 | }); 140 | 141 | async function validateTextDocument(textDocument: TextDocument): Promise { 142 | // In this simple example we get the settings for every validate run. 143 | let settings = await getDocumentSettings(textDocument.uri); 144 | 145 | // The validator creates diagnostics for all uppercase words length 2 and more 146 | let text = textDocument.getText(); 147 | let pattern = /\b[A-Z]{2,}\b/g; 148 | let m: RegExpExecArray | null; 149 | 150 | let problems = 0; 151 | let diagnostics: Diagnostic[] = []; 152 | while ((m = pattern.exec(text)) && problems < settings.maxNumberOfProblems) { 153 | problems++; 154 | let diagnostic: Diagnostic = { 155 | severity: DiagnosticSeverity.Warning, 156 | range: { 157 | start: textDocument.positionAt(m.index), 158 | end: textDocument.positionAt(m.index + m[0].length) 159 | }, 160 | message: `${m[0]} is all uppercase.`, 161 | source: 'ex' 162 | }; 163 | if (hasDiagnosticRelatedInformationCapability) { 164 | diagnostic.relatedInformation = [ 165 | { 166 | location: { 167 | uri: textDocument.uri, 168 | range: Object.assign({}, diagnostic.range) 169 | }, 170 | message: 'Spelling matters' 171 | }, 172 | { 173 | location: { 174 | uri: textDocument.uri, 175 | range: Object.assign({}, diagnostic.range) 176 | }, 177 | message: 'Particularly for names' 178 | } 179 | ]; 180 | } 181 | diagnostics.push(diagnostic); 182 | } 183 | 184 | // Send the computed diagnostics to VSCode. 185 | connection.sendDiagnostics({ uri: textDocument.uri, diagnostics }); 186 | } 187 | 188 | connection.onDidChangeWatchedFiles(_change => { 189 | // Monitored files have change in VSCode 190 | connection.console.log('We received an file change event'); 191 | }); 192 | 193 | // This handler provides the initial list of the completion items. 194 | connection.onCompletion( 195 | (_textDocumentPosition: TextDocumentPositionParams): CompletionItem[] => { 196 | // The pass parameter contains the position of the text document in 197 | // which code complete got requested. For the example we ignore this 198 | // info and always provide the same completion items. 199 | return [ 200 | { 201 | label: 'TypeScript', 202 | kind: CompletionItemKind.Text, 203 | data: 1 204 | }, 205 | { 206 | label: 'JavaScript', 207 | kind: CompletionItemKind.Text, 208 | data: 2 209 | } 210 | ]; 211 | } 212 | ); 213 | 214 | // This handler resolves additional information for the item selected in 215 | // the completion list. 216 | connection.onCompletionResolve( 217 | (item: CompletionItem): CompletionItem => { 218 | if (item.data === 1) { 219 | item.detail = 'TypeScript details'; 220 | item.documentation = 'TypeScript documentation'; 221 | } else if (item.data === 2) { 222 | item.detail = 'JavaScript details'; 223 | item.documentation = 'JavaScript documentation'; 224 | } 225 | return item; 226 | } 227 | ); 228 | 229 | /* 230 | connection.onDidOpenTextDocument((params) => { 231 | // A text document got opened in VSCode. 232 | // params.textDocument.uri uniquely identifies the document. For documents store on disk this is a file URI. 233 | // params.textDocument.text the initial full content of the document. 234 | connection.console.log(`${params.textDocument.uri} opened.`); 235 | }); 236 | connection.onDidChangeTextDocument((params) => { 237 | // The content of a text document did change in VSCode. 238 | // params.textDocument.uri uniquely identifies the document. 239 | // params.contentChanges describe the content changes to the document. 240 | connection.console.log(`${params.textDocument.uri} changed: ${JSON.stringify(params.contentChanges)}`); 241 | }); 242 | connection.onDidCloseTextDocument((params) => { 243 | // A text document got closed in VSCode. 244 | // params.textDocument.uri uniquely identifies the document. 245 | connection.console.log(`${params.textDocument.uri} closed.`); 246 | }); 247 | */ 248 | 249 | connection.onHover( (_params: HoverParams): Hover => { 250 | return { 251 | "contents": "This is some text" 252 | } 253 | } ); 254 | 255 | // Make the text document manager listen on the connection 256 | // for open, change and close text document events 257 | documents.listen(connection); 258 | 259 | // Listen on the connection 260 | connection.listen(); 261 | -------------------------------------------------------------------------------- /test/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Basic Options */ 4 | // "incremental": true, /* Enable incremental compilation */ 5 | "target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ 6 | "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ 7 | // "lib": [], /* Specify library files to be included in the compilation. */ 8 | // "allowJs": true, /* Allow javascript files to be compiled. */ 9 | // "checkJs": true, /* Report errors in .js files. */ 10 | // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ 11 | // "declaration": true, /* Generates corresponding '.d.ts' file. */ 12 | // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ 13 | "sourceMap": true, /* Generates corresponding '.map' file. */ 14 | // "outFile": "./", /* Concatenate and emit output to single file. */ 15 | "outDir": "dist", /* Redirect output structure to the directory. */ 16 | // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ 17 | // "composite": true, /* Enable project compilation */ 18 | // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ 19 | // "removeComments": true, /* Do not emit comments to output. */ 20 | // "noEmit": true, /* Do not emit outputs. */ 21 | // "importHelpers": true, /* Import emit helpers from 'tslib'. */ 22 | // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ 23 | // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ 24 | 25 | /* Strict Type-Checking Options */ 26 | "strict": true, /* Enable all strict type-checking options. */ 27 | // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ 28 | // "strictNullChecks": true, /* Enable strict null checks. */ 29 | // "strictFunctionTypes": true, /* Enable strict checking of function types. */ 30 | // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ 31 | // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ 32 | // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ 33 | // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ 34 | 35 | /* Additional Checks */ 36 | // "noUnusedLocals": true, /* Report errors on unused locals. */ 37 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 38 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 39 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 40 | 41 | /* Module Resolution Options */ 42 | // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ 43 | // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ 44 | // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ 45 | // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ 46 | // "typeRoots": [], /* List of folders to include type definitions from. */ 47 | // "types": [], /* Type declaration files to be included in compilation. */ 48 | // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ 49 | "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ 50 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ 51 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 52 | 53 | /* Source Map Options */ 54 | // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ 55 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 56 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ 57 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ 58 | 59 | /* Experimental Options */ 60 | // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ 61 | // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ 62 | 63 | /* Advanced Options */ 64 | "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [flake8] 2 | ignore = E111,E114,E121,E125,E126,E127,E128,E129,E131,E133,E201,E202,E203,E221,E222,E241,E251,E261,E301,E303,E402,W503,W504 3 | max-line-length = 80 4 | -------------------------------------------------------------------------------- /vala/install.py: -------------------------------------------------------------------------------- 1 | import subprocess, os, platform, sys 2 | 3 | def OnWindows(): 4 | return platform.system() == 'Windows' 5 | 6 | 7 | # On Windows, distutils.spawn.find_executable only works for .exe files 8 | # but .bat and .cmd files are also executables, so we use our own 9 | # implementation. 10 | def FindExecutable( executable ): 11 | # Executable extensions used on Windows 12 | WIN_EXECUTABLE_EXTS = [ '.exe', '.bat', '.cmd' ] 13 | 14 | paths = os.environ[ 'PATH' ].split( os.pathsep ) 15 | base, extension = os.path.splitext( executable ) 16 | 17 | if OnWindows() and extension.lower() not in WIN_EXECUTABLE_EXTS: 18 | extensions = WIN_EXECUTABLE_EXTS 19 | else: 20 | extensions = [ '' ] 21 | 22 | for extension in extensions: 23 | executable_name = executable + extension 24 | if not os.path.isfile( executable_name ): 25 | for path in paths: 26 | if path.startswith('~'): 27 | path = os.path.expanduser('~')+path[1:] 28 | 29 | executable_path = os.path.join( path, executable_name ) 30 | if os.path.isfile( executable_path ): 31 | return executable_path 32 | else: 33 | return executable_name 34 | return None 35 | 36 | 37 | def FindExecutableOrDie( executable, message ): 38 | path = FindExecutable( executable ) 39 | 40 | if not path: 41 | sys.exit( "ERROR: Unable to find executable '{0}'. {1}".format( 42 | executable, 43 | message ) ) 44 | 45 | return path 46 | 47 | def Main(): 48 | vala_server_not_found_error = ''' 49 | Please install vala-language-server and add it to your PATH. 50 | For formatting support install uncrrustify too. 51 | ''' 52 | FindExecutableOrDie('vala-language-server', vala_server_not_found_error ) 53 | 54 | 55 | if __name__ == '__main__': 56 | Main() 57 | -------------------------------------------------------------------------------- /vala/snippet.vim: -------------------------------------------------------------------------------- 1 | let g:ycm_language_server += [ 2 | \ { 'name': 'vala', 3 | \ 'project_root_files': [ 'compile_commands.json', 'meson.build' ], 4 | \ 'filetypes': [ 'vala' ], 5 | \ 'cmdline': [ 'vala-language-server' ], 6 | \ }, 7 | \ ] 8 | -------------------------------------------------------------------------------- /viml/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /viml/install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import subprocess, os, sys, platform 4 | 5 | def OnWindows(): 6 | return platform.system() == 'Windows' 7 | 8 | 9 | # On Windows, distutils.spawn.find_executable only works for .exe files 10 | # but .bat and .cmd files are also executables, so we use our own 11 | # implementation. 12 | def FindExecutable( executable ): 13 | # Executable extensions used on Windows 14 | WIN_EXECUTABLE_EXTS = [ '.exe', '.bat', '.cmd' ] 15 | 16 | paths = os.environ[ 'PATH' ].split( os.pathsep ) 17 | base, extension = os.path.splitext( executable ) 18 | 19 | if OnWindows() and extension.lower() not in WIN_EXECUTABLE_EXTS: 20 | extensions = WIN_EXECUTABLE_EXTS 21 | else: 22 | extensions = [ '' ] 23 | 24 | for extension in extensions: 25 | executable_name = executable + extension 26 | if not os.path.isfile( executable_name ): 27 | for path in paths: 28 | executable_path = os.path.join( path, executable_name ) 29 | if os.path.isfile( executable_path ): 30 | return executable_path 31 | else: 32 | return executable_name 33 | return None 34 | 35 | 36 | def FindExecutableOrDie( executable, message ): 37 | path = FindExecutable( executable ) 38 | 39 | if not path: 40 | sys.exit( "ERROR: Unable to find executable '{0}'. {1}".format( 41 | executable, 42 | message ) ) 43 | 44 | return path 45 | 46 | 47 | def Main(): 48 | npm = FindExecutableOrDie( 'npm', 'npm is required to set up VLS.' ) 49 | subprocess.check_call( [ npm, 'install', '--production' ] ) 50 | 51 | 52 | if __name__ == '__main__': 53 | Main() 54 | -------------------------------------------------------------------------------- /viml/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "ycmd vim-language-server runtime area", 3 | "dependencies": { 4 | "vim-language-server": "^2.2.4" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /viml/snippet.vim: -------------------------------------------------------------------------------- 1 | let g:ycm_language_server += [ 2 | \ { 'name': 'vim', 3 | \ 'filetypes': [ 'vim' ], 4 | \ 'cmdline': [ expand( g:ycm_lsp_dir . '/viml/node_modules/.bin/vim-language-server' ), '--stdio' ] 5 | \ }, 6 | \ ] 7 | -------------------------------------------------------------------------------- /viml/test/test.vim: -------------------------------------------------------------------------------- 1 | let s:variable = 'test' 2 | 3 | function test#stuff#Test() 4 | endfunction 5 | 6 | function! s:BadFunction() 7 | endfunction 8 | 9 | function! s:TestFunction() abort 10 | let m = s:variable 11 | let m = [ 'test' ] 12 | call filter( m, 'test' ) 13 | 14 | call s:BadFunction() 15 | endfunction 16 | -------------------------------------------------------------------------------- /vue/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /vue/install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import subprocess, os, sys, platform 4 | 5 | def OnWindows(): 6 | return platform.system() == 'Windows' 7 | 8 | 9 | # On Windows, distutils.spawn.find_executable only works for .exe files 10 | # but .bat and .cmd files are also executables, so we use our own 11 | # implementation. 12 | def FindExecutable( executable ): 13 | # Executable extensions used on Windows 14 | WIN_EXECUTABLE_EXTS = [ '.exe', '.bat', '.cmd' ] 15 | 16 | paths = os.environ[ 'PATH' ].split( os.pathsep ) 17 | base, extension = os.path.splitext( executable ) 18 | 19 | if OnWindows() and extension.lower() not in WIN_EXECUTABLE_EXTS: 20 | extensions = WIN_EXECUTABLE_EXTS 21 | else: 22 | extensions = [ '' ] 23 | 24 | for extension in extensions: 25 | executable_name = executable + extension 26 | if not os.path.isfile( executable_name ): 27 | for path in paths: 28 | executable_path = os.path.join( path, executable_name ) 29 | if os.path.isfile( executable_path ): 30 | return executable_path 31 | else: 32 | return executable_name 33 | return None 34 | 35 | 36 | def FindExecutableOrDie( executable, message ): 37 | path = FindExecutable( executable ) 38 | 39 | if not path: 40 | sys.exit( "ERROR: Unable to find executable '{0}'. {1}".format( 41 | executable, 42 | message ) ) 43 | 44 | return path 45 | 46 | 47 | def Main(): 48 | npm = FindExecutableOrDie( 'npm', 'npm is required to set up VLS.' ) 49 | subprocess.check_call( [ npm, 'install', '--production' ] ) 50 | 51 | 52 | if __name__ == '__main__': 53 | Main() 54 | -------------------------------------------------------------------------------- /vue/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "ycmd yaml-language-server runtime area", 3 | "dependencies": { 4 | "vls": "*" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /vue/snippet.vim: -------------------------------------------------------------------------------- 1 | let g:ycm_language_server += [ 2 | \ { 'name': 'vue', 3 | \ 'filetypes': [ 'vue' ], 4 | \ 'cmdline': [ expand( g:ycm_lsp_dir . '/vue/node_modules/.bin/vls' ) ] 5 | \ }, 6 | \ ] 7 | -------------------------------------------------------------------------------- /vue/test/testapp/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | 6 | # local env files 7 | .env.local 8 | .env.*.local 9 | 10 | # Log files 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | pnpm-debug.log* 15 | 16 | # Editor directories and files 17 | .idea 18 | .vscode 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw? 24 | -------------------------------------------------------------------------------- /vue/test/testapp/README.md: -------------------------------------------------------------------------------- 1 | # testapp 2 | 3 | ## Project setup 4 | ``` 5 | npm install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | npm run serve 11 | ``` 12 | 13 | ### Compiles and minifies for production 14 | ``` 15 | npm run build 16 | ``` 17 | 18 | ### Lints and fixes files 19 | ``` 20 | npm run lint 21 | ``` 22 | 23 | ### Customize configuration 24 | See [Configuration Reference](https://cli.vuejs.org/config/). 25 | -------------------------------------------------------------------------------- /vue/test/testapp/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /vue/test/testapp/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "esnext", 5 | "baseUrl": "./", 6 | "moduleResolution": "node", 7 | "paths": { 8 | "@/*": [ 9 | "src/*" 10 | ] 11 | }, 12 | "lib": [ 13 | "esnext", 14 | "dom", 15 | "dom.iterable", 16 | "scripthost" 17 | ] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vue/test/testapp/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "testapp", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "core-js": "^3.8.3", 12 | "vue": "^3.2.13" 13 | }, 14 | "devDependencies": { 15 | "@babel/core": "^7.12.16", 16 | "@babel/eslint-parser": "^7.12.16", 17 | "@vue/cli-plugin-babel": "~5.0.0", 18 | "@vue/cli-plugin-eslint": "~5.0.0", 19 | "@vue/cli-service": "~5.0.0", 20 | "eslint": "^7.32.0", 21 | "eslint-plugin-vue": "^8.0.3" 22 | }, 23 | "eslintConfig": { 24 | "root": true, 25 | "env": { 26 | "node": true 27 | }, 28 | "extends": [ 29 | "plugin:vue/vue3-essential", 30 | "eslint:recommended" 31 | ], 32 | "parserOptions": { 33 | "parser": "@babel/eslint-parser" 34 | }, 35 | "rules": {} 36 | }, 37 | "browserslist": [ 38 | "> 1%", 39 | "last 2 versions", 40 | "not dead", 41 | "not ie 11" 42 | ] 43 | } 44 | -------------------------------------------------------------------------------- /vue/test/testapp/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ycm-core/lsp-examples/46db2070275e00e16359ce6a02e7b8ba76691aa2/vue/test/testapp/public/favicon.ico -------------------------------------------------------------------------------- /vue/test/testapp/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <%= htmlWebpackPlugin.options.title %> 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /vue/test/testapp/src/App.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 16 | 17 | 27 | -------------------------------------------------------------------------------- /vue/test/testapp/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ycm-core/lsp-examples/46db2070275e00e16359ce6a02e7b8ba76691aa2/vue/test/testapp/src/assets/logo.png -------------------------------------------------------------------------------- /vue/test/testapp/src/components/HelloWorld.vue: -------------------------------------------------------------------------------- 1 | 32 | 33 | 43 | 44 | 45 | 61 | -------------------------------------------------------------------------------- /vue/test/testapp/src/main.js: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue' 2 | import App from './App.vue' 3 | 4 | createApp(App).mount('#app') 5 | -------------------------------------------------------------------------------- /vue/test/testapp/vue.config.js: -------------------------------------------------------------------------------- 1 | const { defineConfig } = require('@vue/cli-service') 2 | module.exports = defineConfig({ 3 | transpileDependencies: true 4 | }) 5 | -------------------------------------------------------------------------------- /wasm/install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import subprocess, os, platform, sys 4 | 5 | def OnWindows(): 6 | return platform.system() == 'Windows' 7 | 8 | # On Windows, distutils.spawn.find_executable only works for .exe files 9 | # but .bat and .cmd files are also executables, so we use our own 10 | # implementation. 11 | def FindExecutable( executable ): 12 | # Executable extensions used on Windows 13 | WIN_EXECUTABLE_EXTS = [ '.exe', '.bat', '.cmd' ] 14 | 15 | paths = os.environ[ 'PATH' ].split( os.pathsep ) 16 | base, extension = os.path.splitext( executable ) 17 | 18 | if OnWindows() and extension.lower() not in WIN_EXECUTABLE_EXTS: 19 | extensions = WIN_EXECUTABLE_EXTS 20 | else: 21 | extensions = [ '' ] 22 | 23 | for extension in extensions: 24 | executable_name = executable + extension 25 | if not os.path.isfile( executable_name ): 26 | for path in paths: 27 | executable_path = os.path.join( path, executable_name ) 28 | if os.path.isfile( executable_path ): 29 | return executable_path 30 | else: 31 | return executable_name 32 | return None 33 | 34 | 35 | def FindExecutableOrDie( executable, message ): 36 | path = FindExecutable( executable ) 37 | 38 | if not path: 39 | sys.exit( "ERROR: Unable to find executable '{0}'. {1}".format( 40 | executable, 41 | message ) ) 42 | 43 | return path 44 | 45 | 46 | def Main(): 47 | cargo = FindExecutableOrDie( 'cargo', 'Need cargo to build' ) 48 | os.makedirs( os.path.join( os.path.dirname( __file__ ), 'root' ), 49 | exist_ok = True ) 50 | subprocess.check_call( [ 51 | cargo, 52 | 'install', 53 | '--root', os.path.join( os.path.dirname( __file__ ), 'root' ), 54 | '--git', 'https://github.com/g-plane/wasm-language-tools.git', 55 | 'wat_server' 56 | ] ) 57 | 58 | 59 | if __name__ == "__main__": 60 | Main() 61 | -------------------------------------------------------------------------------- /wasm/snippet.vim: -------------------------------------------------------------------------------- 1 | let g:ycm_language_server += [ 2 | \ { 3 | \ 'name': 'wasm-language-tools', 4 | \ 'cmdline': [ g:ycm_lsp_dir .. '/wasm/root/bin/wat_server' ], 5 | \ 'filetypes': [ 'wat' ], 6 | \ }, 7 | \ ] 8 | -------------------------------------------------------------------------------- /wasm/test/test.wat: -------------------------------------------------------------------------------- 1 | (module 2 | (global $global i32) 3 | (func $boris (result i32) (local $local i32) 4 | (i32.add 5 | (i32.const 1) 6 | (local.get $local)) 7 | (i32.add 8 | (i32.const 1) 9 | (global.get $global)) 10 | (i)) 11 | (func $ben (result i32) 12 | (call $boris)) 13 | (export $ben)) 14 | -------------------------------------------------------------------------------- /yaml/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /yaml/install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import subprocess, os, sys, platform 4 | 5 | def OnWindows(): 6 | return platform.system() == 'Windows' 7 | 8 | 9 | # On Windows, distutils.spawn.find_executable only works for .exe files 10 | # but .bat and .cmd files are also executables, so we use our own 11 | # implementation. 12 | def FindExecutable( executable ): 13 | # Executable extensions used on Windows 14 | WIN_EXECUTABLE_EXTS = [ '.exe', '.bat', '.cmd' ] 15 | 16 | paths = os.environ[ 'PATH' ].split( os.pathsep ) 17 | base, extension = os.path.splitext( executable ) 18 | 19 | if OnWindows() and extension.lower() not in WIN_EXECUTABLE_EXTS: 20 | extensions = WIN_EXECUTABLE_EXTS 21 | else: 22 | extensions = [ '' ] 23 | 24 | for extension in extensions: 25 | executable_name = executable + extension 26 | if not os.path.isfile( executable_name ): 27 | for path in paths: 28 | executable_path = os.path.join( path, executable_name ) 29 | if os.path.isfile( executable_path ): 30 | return executable_path 31 | else: 32 | return executable_name 33 | return None 34 | 35 | 36 | def FindExecutableOrDie( executable, message ): 37 | path = FindExecutable( executable ) 38 | 39 | if not path: 40 | sys.exit( "ERROR: Unable to find executable '{0}'. {1}".format( 41 | executable, 42 | message ) ) 43 | 44 | return path 45 | 46 | 47 | def Main(): 48 | npm = FindExecutableOrDie( 'npm', 'npm is required to set up Tern.' ) 49 | subprocess.check_call( [ npm, 'install', '--production' ] ) 50 | 51 | 52 | if __name__ == '__main__': 53 | Main() 54 | -------------------------------------------------------------------------------- /yaml/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "ycmd yaml-language-server runtime area", 3 | "dependencies": { 4 | "yaml-language-server": "*" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /yaml/snippet.vim: -------------------------------------------------------------------------------- 1 | let g:ycm_language_server += [ 2 | \ { 3 | \ 'name': 'yaml', 4 | \ 'cmdline': [ 'node', expand( g:ycm_lsp_dir . '/yaml/node_modules/.bin/yaml-language-server' ), '--stdio' ], 5 | \ 'filetypes': [ 'yaml' ], 6 | \ 'capabilities': { 7 | \ 'workspace': { 'configuration': v:true }, 8 | \ 'textDocument': { 9 | \ 'completion': { 10 | \ 'completionItem': { 'snippetSupport': v:true }, 11 | \ } 12 | \ } 13 | \ }, 14 | \ }, 15 | \ ] 16 | -------------------------------------------------------------------------------- /yaml/tests/ansible/tasks/main.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ycm-core/lsp-examples/46db2070275e00e16359ce6a02e7b8ba76691aa2/yaml/tests/ansible/tasks/main.yml -------------------------------------------------------------------------------- /zig/.gitignore: -------------------------------------------------------------------------------- 1 | zls/ 2 | -------------------------------------------------------------------------------- /zig/install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import subprocess, os, platform, sys 4 | 5 | def OnWindows(): 6 | return platform.system() == 'Windows' 7 | 8 | 9 | # On Windows, distutils.spawn.find_executable only works for .exe files 10 | # but .bat and .cmd files are also executables, so we use our own 11 | # implementation. 12 | def FindExecutable( executable ): 13 | # Executable extensions used on Windows 14 | WIN_EXECUTABLE_EXTS = [ '.exe', '.bat', '.cmd' ] 15 | 16 | paths = os.environ[ 'PATH' ].split( os.pathsep ) 17 | base, extension = os.path.splitext( executable ) 18 | 19 | if OnWindows() and extension.lower() not in WIN_EXECUTABLE_EXTS: 20 | extensions = WIN_EXECUTABLE_EXTS 21 | else: 22 | extensions = [ '' ] 23 | 24 | for extension in extensions: 25 | executable_name = executable + extension 26 | if not os.path.isfile( executable_name ): 27 | for path in paths: 28 | if path.startswith('~'): 29 | path = os.path.expanduser('~')+path[1:] 30 | 31 | executable_path = os.path.join( path, executable_name ) 32 | if os.path.isfile( executable_path ): 33 | return executable_path 34 | else: 35 | return executable_name 36 | return None 37 | 38 | 39 | def FindExecutableOrDie( executable, message ): 40 | path = FindExecutable( executable ) 41 | 42 | if not path: 43 | sys.exit( "ERROR: Unable to find executable '{0}'. {1}".format( 44 | executable, 45 | message ) ) 46 | 47 | return path 48 | 49 | 50 | def Main(): 51 | url = 'https://github.com/zigtools/zls' 52 | git = FindExecutableOrDie('git', 'git is required to setup Zig language server') 53 | zig = FindExecutableOrDie('zig', 'zig compiler is required to setup Zig language server') 54 | 55 | print("Building zig lsp from source ",url) 56 | 57 | if os.path.isdir(os.curdir+os.sep+'zls'): 58 | print("zls alread cloned into directory") 59 | print("Going to update and upgrade") 60 | os.chdir('zls') 61 | subprocess.check_call( [ git, 'pull' ] ) 62 | subprocess.check_call( [ git, 'submodule', 'update', '--recursive' ] ) 63 | else: 64 | subprocess.check_call( [ git, 'clone', '--recurse-submodules', '--depth=1', url ] ) 65 | os.chdir('zls') 66 | 67 | subprocess.check_call( [ zig, 'build', '-Drelease-safe']) 68 | 69 | 70 | if __name__ == '__main__': 71 | Main() 72 | -------------------------------------------------------------------------------- /zig/snippet.vim: -------------------------------------------------------------------------------- 1 | let g:ycm_language_server += [ 2 | \ { 'name': 'zls', 3 | \ 'filetypes': [ 'zig' ], 4 | \ 'cmdline': [ expand( g:ycm_lsp_dir . '/zig/zls/zig-out/bin/zls' ) ], 5 | \ }, 6 | \ ] 7 | --------------------------------------------------------------------------------