diff --git a/README.md b/README.md index 7dfffb5b..29225dd3 100644 --- a/README.md +++ b/README.md @@ -47,10 +47,9 @@ Contents - [General Semantic Completion](#general-semantic-completion) - [C-family Semantic Completion](#c-family-semantic-completion) - [Java Semantic Completion](#java-semantic-completion) - - [JavaScript Semantic Completion](#javascript-semantic-completion) - [Python Semantic Completion](#python-semantic-completion) - [Rust Semantic Completion](#rust-semantic-completion) - - [TypeScript Semantic Completion](#typescript-semantic-completion) + - [JavaScript and TypeScript Semantic Completion](#javascript-and-typescript-semantic-completion) - [Semantic Completion for Other Languages](#semantic-completion-for-other-languages) - [Writing New Semantic Completers](#writing-new-semantic-completers) - [Diagnostic Display](#diagnostic-display) @@ -83,8 +82,7 @@ YouCompleteMe is a fast, as-you-type, fuzzy-search code completion engine for - a [Jedi][]-based completion engine for Python 2 and 3 (using the [JediHTTP][] wrapper), - an [OmniSharp][]-based completion engine for C#, - a combination of [Gocode][] and [Godef][] semantic engines for Go, -- a [TSServer][]-based completion engine for TypeScript, -- a [Tern][]-based completion engine for JavaScript, +- a [TSServer][]-based completion engine for JavaScript and TypeScript, - a [racer][]-based completion engine for Rust, - a [jdt.ls][]-based experimental completion engine for Java. - and an omnifunc-based completer that uses data from Vim's omnicomplete system @@ -216,10 +214,8 @@ The following additional language support options are available: `./install.py`. - Go support: install [Go][go-install] and add `--go-completer` when calling `./install.py`. -- TypeScript support: install [Node.js and npm][npm-install] then install the - TypeScript SDK with `npm install -g typescript`. -- JavaScript support: install [Node.js and npm][npm-install] and add - `--js-completer` when calling `./install.py`. +- JavaScript and TypeScript support: install [Node.js and npm][npm-install] then + install the TypeScript SDK with `npm install -g typescript`. - Rust support: install [Rust][rust-install] and add `--rust-completer` when calling `./install.py`. - Java support: install [JDK8 (version 8 required)][jdk-install] and add @@ -290,10 +286,8 @@ The following additional language support options are available: when calling `./install.py`. - Go support: install [Go][go-install] and add `--go-completer` when calling `./install.py`. -- TypeScript support: install [Node.js and npm][npm-install] then install the - TypeScript SDK with `npm install -g typescript`. -- JavaScript support: install [Node.js and npm][npm-install] and add - `--js-completer` when calling `./install.py`. +- JavaScript and TypeScript support: install [Node.js and npm][npm-install] then + install the TypeScript SDK with `npm install -g typescript`. - Rust support: install [Rust][rust-install] and add `--rust-completer` when calling `./install.py`. - Java support: install [JDK8 (version 8 required)][jdk-install] and add @@ -359,10 +353,8 @@ The following additional language support options are available: when calling `./install.py`. - Go support: install [Go][go-install] and add `--go-completer` when calling `./install.py`. -- TypeScript support: install [Node.js and npm][npm-install] then install the - TypeScript SDK with `npm install -g typescript`. -- JavaScript support: install [Node.js and npm][npm-install] and add - `--js-completer` when calling `./install.py`. +- JavaScript and TypeScript support: install [Node.js and npm][npm-install] then + install the TypeScript SDK with `npm install -g typescript`. - Rust support: install [Rust][rust-install] and add `--rust-completer` when calling `./install.py`. - Java support: install [JDK8 (version 8 required)][jdk-install] and add @@ -452,10 +444,8 @@ The following additional language support options are available: Be sure that [the build utility `msbuild` is in your PATH][add-msbuild-to-path]. - Go support: install [Go][go-install] and add `--go-completer` when calling `install.py`. -- TypeScript support: install [Node.js and npm][npm-install] then install the - TypeScript SDK with `npm install -g typescript`. -- JavaScript support: install [Node.js and npm][npm-install] and add - `--js-completer` when calling `install.py`. +- JavaScript and TypeScript support: install [Node.js and npm][npm-install] then + install the TypeScript SDK with `npm install -g typescript`. - Rust support: install [Rust][rust-install] and add `--rust-completer` when calling `install.py`. - Java support: install [JDK8 (version 8 required)][jdk-install] and add @@ -526,10 +516,8 @@ The following additional language support options are available: `./install.py`. - Go support: install [Go][go-install] and add `--go-completer` when calling `./install.py`. -- TypeScript support: install [Node.js and npm][npm-install] then install the - TypeScript SDK with `npm install -g typescript`. -- JavaScript support: install [Node.js and npm][npm-install] and add - `--js-completer` when calling `./install.py`. +- JavaScript and TypeScript support: install [Node.js and npm][npm-install] then + install the TypeScript SDK with `npm install -g typescript`. - Rust support: install [Rust][rust-install] and add `--rust-completer` when calling `./install.py`. - Java support: install [JDK8 (version 8 required)][jdk-install] and add @@ -739,12 +727,9 @@ process. - Go support: install [Go][go-install] and add it to your path. Navigate to `YouCompleteMe/third_party/ycmd/third_party/gocode` and run `go build`. - - TypeScript support: as with the quick installation, simply `npm install -g - typescript` after successfully installing [Node.js and npm][npm-install]. - - - JavaScript support: install [Node.js and npm][npm-install]. Then navigate - to `YouCompleteMe/third_party/ycmd/third_party/tern_runtime` and run `npm - install --production` + - JavaScript and TypeScript support: as with the quick installation, simply + `npm install -g typescript` after successfully installing [Node.js and + npm][npm-install]. - Rust support: install [Rust][rust-install]. Navigate to `YouCompleteMe/third_party/ycmd/third_party/racerd` and run `cargo build @@ -809,7 +794,7 @@ Quick Feature Summary * Go to definition (`GoTo`) * Management of `gocode` server instance -### TypeScript +### JavaScript and TypeScript * Semantic auto-completion with automatic import insertion * Go to definition (`GoTo`, `GoToDefinition`, and `GoToDeclaration` are @@ -825,15 +810,6 @@ Quick Feature Summary * Organize imports (`OrganizeImports`) * Management of `TSServer` server instance -### JavaScript - -* Intelligent auto-completion -* Renaming variables (`RefactorRename `) -* Go to definition, find references (`GoToDefinition`, `GoToReferences`) -* Type information for identifiers (`GetType`) -* View documentation comments for identifiers (`GetDoc`) -* Management of `Tern` server instance - ### Rust * Semantic auto-completion @@ -1235,97 +1211,6 @@ For anything else, [contact us](#contact). Java support is experimental at present so we'd love to hear your feedback! Please do remember to check [CONTRIBUTING.md][contributing-md] for the list of diagnostics we'll need. -### JavaScript Semantic Completion - -#### JavaScript quick start - -1. Ensure that you have enabled the JavaScript completer. See the - [installation guide](#installation) for details. - -2. Create a `.tern-project` file in the root directory of your JavaScript - project, by following the [instructions][tern-project] in the [Tern][] - documentation. - -3. Edit a file from your project. - -#### Explanation - -JavaScript completion is based on [Tern][]. This completion engine requires a -file named [`.tern-project`][tern-project] to exist in the current working -directory or a directory which is an ancestor of the current working directory -when the Tern server is started. YCM starts the Tern server the first time a -JavaScript file is edited and uses its directory as the working directory, so -the directory of that file at that time needs to be a descendent of the -directory containing the `.tern-project` file (or that directory itself). - -Alternatively, as described in the [Tern documentation][tern-docs], a global -`.tern-config` file may be used. - -Multiple Tern servers are not supported. To switch to a different JavaScript -project, you need to restart the Tern server using [the `RestartServer` -subcommand](#the-restartserver-subcommand) while editing a file of that -project: - -```vim -:YcmCompleter RestartServer -``` - -#### Tips and tricks - -This section contains some advice for configuring `.tern-project` and working -with JavaScript files. The canonical reference for correctly configuring Tern is -the [Tern documentation][tern-docs]. Any issues, improvements, advice, etc. -should be sought from the [Tern][] project. For example, see the [list of tern -plugins](http://ternjs.net/doc/manual.html#plugins) for the list of plugins -which can be enabled in the `plugins` section of the `.tern-project` file. - -##### Configuring Tern for node support - -The following simple example `.tern-project` file enables nodejs support: - -```json -{ - "plugins": { - "node": {} - } -} - -``` - -##### Configuring Tern for requirejs support - -The Tern requirejs plugin requires that all included "libraries" are rooted -under the same base directory. If that's not the case for your projects, then it -is possible to make it work with appropriate symbolic links. For example, create -a directory `ext_lib` within your project and populate it with symlinks to your -libraries. Then set up the `.tern-project` something like this: - -```json - -{ - "plugins": { - "requirejs": { - "baseURL": "./ext_lib", - } - } -} -``` - -Then, given the following structure: - -``` -./ext_lib/mylib (symlink) -./ext_lib/anotherlib (symlink) -``` - -Can be used as follows: - -```javascript -define( [ 'mylib/file1', 'anotherlib/anotherfile' ], function( f1, f2 ) { - // etc. -} ); -``` - ### Python Semantic Completion Completion and GoTo commands work out of the box with no additional @@ -1374,17 +1259,38 @@ extract it somewhere, and set the following option so YCM can locate it: let g:ycm_rust_src_path = '/usr/local/rust/rustc-1.20.0/src' ``` -### TypeScript Semantic Completion +### JavaScript and TypeScript Semantic Completion -All TypeScript features are provided by the [TSServer][] engine, which is -included in the TypeScript SDK. To get the SDK, install [Node.js and +**NOTE:** YCM originally used the [Tern][] engine for JavaScript but due to +[Tern][] not being maintained anymore by its main author and the [TSServer][] +engine offering more features, YCM is moving to [TSServer][]. This won't affect +you if you were already using [Tern][] but you are encouraged to do the switch +by deleting the `third_party/ycmd/third_party/tern_runtime/node_modules` +directory in YCM folder. If you are a new user but still want to use [Tern][], +you should pass the `--js-completer` option to the `install.py` script during +installation. Further instructions on how to setup YCM with [Tern][] are +available on [the wiki][tern-instructions]. + +All JavaScript and TypeScript features are provided by the [TSServer][] engine, +which is included in the TypeScript SDK. To get the SDK, install [Node.js and npm][npm-install] and run the command: ``` npm install -g typescript ``` -[TSServer][] relies on [the `tsconfig.json` file][tsconfig.json] to analyze your +[TSServer][] relies on [the `jsconfig.json` file][jsconfig.json] for JavaScript +and [the `tsconfig.json` file][tsconfig.json] for TypeScript to analyze your project. Ensure the file exists at the root of your project. +To get diagnostics in JavaScript, set the `checkJs` option to `true` in your +`jsconfig.json` file: +```json +{ + "compilerOptions": { + "checkJs": true + } +} +``` + TypeScript 2.8.1 or later is recommended. Some features will be missing on older versions. You can check which version you are currently using by looking at the output of [`:YcmDebugInfo` ](#the-ycmdebuginfo-command). If the version is @@ -1392,11 +1298,11 @@ output of [`:YcmDebugInfo` ](#the-ycmdebuginfo-command). If the version is ### Semantic Completion for Other Languages -C-family, C#, Go, Java, JavaScript, Python, Rust, and TypeScript languages are +C-family, C#, Go, Java, Python, Rust, and JavaScript/TypeScript languages are supported natively by YouCompleteMe using the [Clang][], [OmniSharp][], -[Gocode][]/[Godef][], [jdt.ls][], [Tern][], [Jedi][], [racer][], and -[TSServer][] engines, respectively. Check the [installation](#installation) -section for instructions to enable these features if desired. +[Gocode][]/[Godef][], [jdt.ls][], [Jedi][], [racer][], and [TSServer][] engines, +respectively. Check the [installation](#installation) section for instructions +to enable these features if desired. YCM will use your `omnifunc` (see `:h omnifunc` in Vim) as a source for semantic completions if it does not have a native semantic completion engine for your @@ -1441,11 +1347,10 @@ Completer API. ### Diagnostic Display -YCM will display diagnostic notifications for C-family and C# languages if you -compiled YCM with Clang and Omnisharp support, respectively. Diagnostics will -also be displayed for TypeScript. Since YCM continuously recompiles your file as -you type, you'll get notified of errors and warnings in your file as fast as -possible. +YCM will display diagnostic notifications for the C-family, C#, Java, +JavaScript, and TypeScript languages. Since YCM continuously recompiles your +file as you type, you'll get notified of errors and warnings in your file as +fast as possible. Here are the various pieces of the diagnostic UI: @@ -1636,8 +1541,8 @@ Supported in filetypes: `c, cpp, objc, objcpp, cuda` Looks up the symbol under the cursor and jumps to its declaration. -Supported in filetypes: `c, cpp, objc, objcpp, cuda, cs, go, java, python, rust, -typescript` +Supported in filetypes: `c, cpp, objc, objcpp, cuda, cs, go, java, javascript, +python, rust, typescript` #### The `GoToDefinition` subcommand @@ -1705,7 +1610,7 @@ Supported in filetypes: `cs` Looks up the symbol under the cursor and jumps to the definition of its type e.g. if the symbol is an object, go to the definition of its class. -Supported in filetypes: `typescript` +Supported in filetypes: `javascript, typescript` ### Semantic Information Commands @@ -1833,7 +1738,8 @@ indication). **NOTE:** Causes re-parsing of the current translation unit. -Supported in filetypes: `c, cpp, objc, objcpp, cuda, cs, java, typescript` +Supported in filetypes: `c, cpp, objc, objcpp, cuda, cs, java, javascript, +typescript` #### The `RefactorRename ` subcommand @@ -1847,7 +1753,7 @@ files. Rename operations may involve changes to multiple files, which may or may not be open in Vim buffers at the time. YouCompleteMe handles all of this for you. The behavior is described in [the following section](#multi-file-refactor). -Supported in filetypes: `java, javascript (variables only), typescript` +Supported in filetypes: `java, javascript, typescript` #### Multi-file Refactor @@ -1888,7 +1794,7 @@ it in one of Vim's visual modes (see `:h visual-use`) and run the command or directly enter the range on the command line, e.g. `:2,5YcmCompleter Format` to format it from line 2 to line 5. -Supported in filetypes: `java, typescript` +Supported in filetypes: `java, javascript, typescript` #### The `OrganizeImports` subcommand @@ -1896,7 +1802,7 @@ This command removes unused imports and sorts imports in the current file. It can also group imports from the same module in TypeScript and resolves imports in Java. -Supported in filetypes: `java, typescript` +Supported in filetypes: `java, javascript, typescript` ### Miscellaneous Commands @@ -1909,9 +1815,6 @@ flags. Restarts the semantic-engine-as-localhost-server for those semantic engines that work as separate servers that YCM talks to. -Use this subcommand while editing a file from a JavaScript project to switch to -that project. - An additional optional argument may be supplied for Python, specifying the python binary to use to restart the Python semantic engine. @@ -3351,15 +3254,6 @@ the list of flags you return from your `Settings` function in your See [issue #303][issue-303] for details. -### When I open a JavaScript file, I get an annoying warning about `.tern-project` file - -Take a look at the [instructions for using the JavaScript -completer](#javascript-semantic-completion). - -If this is still really annoying, and you have a good reason not to have a -`.tern-project` file, create an empty `.tern-config` file in your home directory -and YCM will stop complaining. - ### When I start vim I get a runtime error saying `R6034 An application has made an attempt to load the C runtime library incorrectly.` [CMake and other things seem to screw up the PATH with their own msvcrXX.dll @@ -3515,6 +3409,7 @@ This software is licensed under the [GPL v3 license][gpl]. [Gocode]: https://github.com/nsf/gocode [Godef]: https://github.com/Manishearth/godef [TSServer]: https://github.com/Microsoft/TypeScript/tree/master/src/server +[jsconfig.json]: https://code.visualstudio.com/docs/languages/jsconfig [tsconfig.json]: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html [vim-win-download]: https://bintray.com/micbou/generic/vim [python-win-download]: https://www.python.org/downloads/windows/ @@ -3526,9 +3421,8 @@ This software is licensed under the [GPL v3 license][gpl]. [mono-install]: http://www.mono-project.com/docs/getting-started/install/ [go-install]: https://golang.org/doc/install [npm-install]: https://docs.npmjs.com/getting-started/installing-node +[tern-instructions]: https://github.com/Valloric/YouCompleteMe/wiki/JavaScript-Semantic-Completion-through-Tern [Tern]: http://ternjs.net -[tern-project]: http://ternjs.net/doc/manual.html#configuration -[tern-docs]: http://ternjs.net/doc/manual.html#server [racer]: https://github.com/phildawes/racer [rust-install]: https://www.rust-lang.org/ [rust-src]: https://www.rust-lang.org/downloads.html diff --git a/doc/youcompleteme.txt b/doc/youcompleteme.txt index 23edcd8c..f779f37d 100644 --- a/doc/youcompleteme.txt +++ b/doc/youcompleteme.txt @@ -20,17 +20,16 @@ Contents ~ 3. C♯ |youcompleteme-c| 4. Python |youcompleteme-python| 5. Go |youcompleteme-go| - 6. TypeScript |youcompleteme-typescript| - 7. JavaScript |youcompleteme-javascript| - 8. Rust |youcompleteme-rust| - 9. Java |youcompleteme-java| + 6. JavaScript and TypeScript |youcompleteme-javascript-typescript| + 7. Rust |youcompleteme-rust| + 8. Java |youcompleteme-java| 7. User Guide |youcompleteme-user-guide| 1. General Usage |youcompleteme-general-usage| 2. Client-Server Architecture |youcompleteme-client-server-architecture| 3. Completion String Ranking |youcompleteme-completion-string-ranking| 4. General Semantic Completion |youcompleteme-general-semantic-completion| 5. C-family Semantic Completion |youcompleteme-c-family-semantic-completion| - 1. Option 1: Use a compilation database [50] |youcompleteme-option-1-use-compilation-database-50| + 1. Option 1: Use a compilation database [49] |youcompleteme-option-1-use-compilation-database-49| 2. Option 2: Provide the flags manually |youcompleteme-option-2-provide-flags-manually| 3. Errors during compilation |youcompleteme-errors-during-compilation| 6. Java Semantic Completion |youcompleteme-java-semantic-completion| @@ -42,18 +41,12 @@ Contents ~ 6. Maven Projects |youcompleteme-maven-projects| 7. Gradle Projects |youcompleteme-gradle-projects| 8. Troubleshooting |youcompleteme-troubleshooting| - 7. JavaScript Semantic Completion |youcompleteme-javascript-semantic-completion| - 1. JavaScript quick start |youcompleteme-javascript-quick-start| - 2. Explanation |youcompleteme-explanation| - 3. Tips and tricks |youcompleteme-tips-tricks| - 1. Configuring Tern for node support |youcompleteme-configuring-tern-for-node-support| - 2. Configuring Tern for requirejs support |youcompleteme-configuring-tern-for-requirejs-support| - 8. Python Semantic Completion |youcompleteme-python-semantic-completion| - 9. Rust Semantic Completion |youcompleteme-rust-semantic-completion| - 10. TypeScript Semantic Completion |youcompleteme-typescript-semantic-completion| - 11. Semantic Completion for Other Languages |youcompleteme-semantic-completion-for-other-languages| - 12. Writing New Semantic Completers |youcompleteme-writing-new-semantic-completers| - 13. Diagnostic Display |youcompleteme-diagnostic-display| + 7. Python Semantic Completion |youcompleteme-python-semantic-completion| + 8. Rust Semantic Completion |youcompleteme-rust-semantic-completion| + 9. JavaScript and TypeScript Semantic Completion |youcompleteme-javascript-typescript-semantic-completion| + 10. Semantic Completion for Other Languages |youcompleteme-semantic-completion-for-other-languages| + 11. Writing New Semantic Completers |youcompleteme-writing-new-semantic-completers| + 12. Diagnostic Display |youcompleteme-diagnostic-display| 1. Diagnostic Highlighting Groups |youcompleteme-diagnostic-highlighting-groups| 8. Commands |youcompleteme-commands| 1. The |:YcmRestartServer| command @@ -177,17 +170,15 @@ Contents ~ 27. I get weird errors when I press 'Ctrl-C' in Vim |youcompleteme-i-get-weird-errors-when-i-press-ctrl-c-in-vim| 28. Why did YCM stop using Syntastic for diagnostics display? |youcompleteme-why-did-ycm-stop-using-syntastic-for-diagnostics-display| 29. Completion doesn't work with the C++ standard library headers |youcompleteme-completion-doesnt-work-with-c-standard-library-headers| - 30. When I open a JavaScript file, I get an annoying warning about '.tern-project' -file |youcompleteme-when-i-open-javascript-file-i-get-an-annoying-warning-about-.tern-project-file| - 31. When I start vim I get a runtime error saying 'R6034 An application has made an + 30. When I start vim I get a runtime error saying 'R6034 An application has made an attempt to load the C runtime library incorrectly.' |youcompleteme-when-i-start-vim-i-get-runtime-error-saying-r6034-an-application-has-made-an-attempt-to-load-c-runtime-library-incorrectly.| - 32. I hear that YCM only supports Python 2, is that true? |youcompleteme-i-hear-that-ycm-only-supports-python-2-is-that-true| - 33. On Windows I get "E887: Sorry, this command is disabled, the Python's site + 31. I hear that YCM only supports Python 2, is that true? |youcompleteme-i-hear-that-ycm-only-supports-python-2-is-that-true| + 32. On Windows I get "E887: Sorry, this command is disabled, the Python's site module could not be loaded" |youcompleteme-on-windows-i-get-e887-sorry-this-command-is-disabled-pythons-site-module-could-not-be-loaded| - 34. I can't complete python packages in a virtual environment. |youcompleteme-i-cant-complete-python-packages-in-virtual-environment.| - 35. I want to defer loading of YouCompleteMe until after Vim finishes booting |i-want-to-defer-loading-of-youcompleteme-until-after-vim-finishes-booting| - 36. YCM does not shut down when I quit Vim |youcompleteme-ycm-does-not-shut-down-when-i-quit-vim| - 37. YCM does not work with my Anaconda Python setup |youcompleteme-ycm-does-not-work-with-my-anaconda-python-setup| + 33. I can't complete python packages in a virtual environment. |youcompleteme-i-cant-complete-python-packages-in-virtual-environment.| + 34. I want to defer loading of YouCompleteMe until after Vim finishes booting |i-want-to-defer-loading-of-youcompleteme-until-after-vim-finishes-booting| + 35. YCM does not shut down when I quit Vim |youcompleteme-ycm-does-not-shut-down-when-i-quit-vim| + 36. YCM does not work with my Anaconda Python setup |youcompleteme-ycm-does-not-work-with-my-anaconda-python-setup| 14. Contributor Code of Conduct |youcompleteme-contributor-code-of-conduct| 15. Contact |youcompleteme-contact| 16. License |youcompleteme-license| @@ -244,10 +235,9 @@ Contents ~ - General Semantic Completion - C-family Semantic Completion - Java Semantic Completion - - JavaScript Semantic Completion - Python Semantic Completion - Rust Semantic Completion - - TypeScript Semantic Completion + - JavaScript and TypeScript Semantic Completion - Semantic Completion for Other Languages - Writing New Semantic Completers - Diagnostic Display @@ -279,22 +269,29 @@ YouCompleteMe is a fast, as-you-type, fuzzy-search code completion engine for Vim. It has several completion engines: - an identifier-based engine that works with every programming language, + - a Clang [11]-based engine that provides native semantic code completion for C/C++/Objective-C/Objective-C++ (from now on referred to as "the C-family languages"), + - a Jedi [12]-based completion engine for Python 2 and 3 (using the JediHTTP [13] wrapper), + - an OmniSharp [14]-based completion engine for C#, + - a combination of Gocode [15] and Godef [16] semantic engines for Go, -- a TSServer [17]-based completion engine for TypeScript, -- a Tern [18]-based completion engine for JavaScript, -- a racer [19]-based completion engine for Rust, -- a jdt.ls [20]-based experimental completion engine for Java. + +- a TSServer [17]-based completion engine for JavaScript and TypeScript, + +- a racer [18]-based completion engine for Rust, + +- a jdt.ls [19]-based experimental completion engine for Java. + - and an omnifunc-based completer that uses data from Vim's omnicomplete system to provide semantic completions for many other languages (Ruby, PHP etc.). - Image: YouCompleteMe GIF demo (see reference [21]) + Image: YouCompleteMe GIF demo (see reference [20]) Here's an explanation of what happens in the short GIF demo above. @@ -313,7 +310,7 @@ typing to further filter out unwanted completions. A critical thing to notice is that the completion **filtering is NOT based on the input being a string prefix of the completion** (but that works too). The -input needs to be a _subsequence [22] match_ of a completion. This is a fancy +input needs to be a _subsequence [21] match_ of a completion. This is a fancy way of saying that any input characters need to be present in a completion string in the order in which they appear in the input. So 'abc' is a subsequence of 'xaybgc', but not of 'xbyxaxxc'. After the filter, a complicated @@ -332,7 +329,7 @@ with a keyboard shortcut; see the rest of the docs). The last thing that you can see in the demo is YCM's diagnostic display features (the little red X that shows up in the left gutter; inspired by -Syntastic [23]) if you are editing a C-family file. As Clang compiles your file +Syntastic [22]) if you are editing a C-family file. As Clang compiles your file and detects warnings or errors, they will be presented in various ways. You don't need to save your file or press any keyboard shortcut to trigger this, it "just happens" in the background. @@ -363,7 +360,7 @@ summary and the full list of completer subcommands to find out what's available for your favourite languages. You'll also find that YCM has filepath completers (try typing './' in a file) -and a completer that integrates with UltiSnips [24]. +and a completer that integrates with UltiSnips [23]. =============================================================================== *youcompleteme-installation* @@ -377,16 +374,16 @@ These instructions (using 'install.py') are the quickest way to install YouCompleteMe, however they may not work for everyone. If the following instructions don't work for you, check out the full installation guide. -Install the latest version of MacVim [25]. Yes, MacVim. And yes, the _latest_. +Install the latest version of MacVim [24]. Yes, MacVim. And yes, the _latest_. If you don't use the MacVim GUI, it is recommended to use the Vim binary that is inside the MacVim.app package ('MacVim.app/Contents/MacOS/Vim'). To ensure -it works correctly copy the 'mvim' script from the MacVim [25] download to your +it works correctly copy the 'mvim' script from the MacVim [24] download to your local binary folder (for example '/usr/local/bin/mvim') and then symlink it: > ln -s /usr/local/bin/mvim vim < -Install YouCompleteMe with Vundle [26]. +Install YouCompleteMe with Vundle [25]. **Remember:** YCM is a plugin with a compiled component. If you **update** YCM using Vundle and the ycm_core library APIs have changed (happens rarely), YCM @@ -397,8 +394,8 @@ installed along with the latest Command Line Tools (they are installed automatically when you run 'clang' for the first time, or manually by running 'xcode-select --install') -Install CMake. Preferably with Homebrew [27], but here's the stand-alone CMake -installer [28]. +Install CMake. Preferably with Homebrew [26], but here's the stand-alone CMake +installer [27]. _If_ you have installed a Homebrew Python and/or Homebrew MacVim, see the _FAQ_ for details. @@ -415,22 +412,19 @@ Compiling YCM **without** semantic support for C-family languages: < The following additional language support options are available: -- C# support: install Mono with Homebrew [27] or by downloading the Mono Mac - package [29] and add '--cs-completer' when calling './install.py'. +- C# support: install Mono with Homebrew [26] or by downloading the Mono Mac + package [28] and add '--cs-completer' when calling './install.py'. -- Go support: install Go [30] and add '--go-completer' when calling +- Go support: install Go [29] and add '--go-completer' when calling './install.py'. -- TypeScript support: install Node.js and npm [31] then install the - TypeScript SDK with 'npm install -g typescript'. +- JavaScript and TypeScript support: install Node.js and npm [30] then + install the TypeScript SDK with 'npm install -g typescript'. -- JavaScript support: install Node.js and npm [31] and add '--js-completer' - when calling './install.py'. - -- Rust support: install Rust [32] and add '--rust-completer' when calling +- Rust support: install Rust [31] and add '--rust-completer' when calling './install.py'. -- Java support: install JDK8 (version 8 required) [33] and add '--java- +- Java support: install JDK8 (version 8 required) [32] and add '--java- completer' when calling './install.py'. To simply compile with everything enabled, there's a '--all' flag. So, to @@ -461,9 +455,9 @@ instructions don't work for you, check out the full installation guide. Make sure you have Vim 7.4.1578 with Python 2 or Python 3 support. Ubuntu 16.04 and later have a Vim that's recent enough. You can see the version of Vim installed by running 'vim --version'. If the version is too old, you may need -to compile Vim from source [34] (don't worry, it's easy). +to compile Vim from source [33] (don't worry, it's easy). -Install YouCompleteMe with Vundle [26]. +Install YouCompleteMe with Vundle [25]. **Remember:** YCM is a plugin with a compiled component. If you **update** YCM using Vundle and the ycm_core library APIs have changed (happens rarely), YCM @@ -494,22 +488,19 @@ Compiling YCM **without** semantic support for C-family languages: < The following additional language support options are available: -- C# support: install Mono [35] and add '--cs-completer' when calling +- C# support: install Mono [34] and add '--cs-completer' when calling './install.py'. -- Go support: install Go [30] and add '--go-completer' when calling +- Go support: install Go [29] and add '--go-completer' when calling './install.py'. -- TypeScript support: install Node.js and npm [31] then install the - TypeScript SDK with 'npm install -g typescript'. +- JavaScript and TypeScript support: install Node.js and npm [30] then + install the TypeScript SDK with 'npm install -g typescript'. -- JavaScript support: install Node.js and npm [31] and add '--js-completer' - when calling './install.py'. - -- Rust support: install Rust [32] and add '--rust-completer' when calling +- Rust support: install Rust [31] and add '--rust-completer' when calling './install.py'. -- Java support: install JDK8 (version 8 required) [33] and add '--java- +- Java support: install JDK8 (version 8 required) [32] and add '--java- completer' when calling './install.py'. To simply compile with everything enabled, there's a '--all' flag. So, to @@ -540,9 +531,9 @@ instructions don't work for you, check out the full installation guide. Make sure you have Vim 7.4.1578 with Python 2 or Python 3 support. Fedora 21 and later have a Vim that's recent enough. You can see the version of Vim installed by running 'vim --version'. If the version is too old, you may need -to compile Vim from source [34] (don't worry, it's easy). +to compile Vim from source [33] (don't worry, it's easy). -Install YouCompleteMe with Vundle [26]. +Install YouCompleteMe with Vundle [25]. **Remember:** YCM is a plugin with a compiled component. If you **update** YCM using Vundle and the ycm_core library APIs have changed (happens rarely), YCM @@ -568,22 +559,19 @@ Compiling YCM **without** semantic support for C-family languages: < The following additional language support options are available: -- C# support: install Mono [36] and add '--cs-completer' when calling +- C# support: install Mono [35] and add '--cs-completer' when calling './install.py'. -- Go support: install Go [30] and add '--go-completer' when calling +- Go support: install Go [29] and add '--go-completer' when calling './install.py'. -- TypeScript support: install Node.js and npm [31] then install the - TypeScript SDK with 'npm install -g typescript'. +- JavaScript and TypeScript support: install Node.js and npm [30] then + install the TypeScript SDK with 'npm install -g typescript'. -- JavaScript support: install Node.js and npm [31] and add '--js-completer' - when calling './install.py'. - -- Rust support: install Rust [32] and add '--rust-completer' when calling +- Rust support: install Rust [31] and add '--rust-completer' when calling './install.py'. -- Java support: install JDK8 (version 8 required) [33] and add '--java- +- Java support: install JDK8 (version 8 required) [32] and add '--java- completer' when calling './install.py'. To simply compile with everything enabled, there's a '--all' flag. So, to @@ -620,18 +608,18 @@ Vim. Look at the features included: '+python/dyn' for Python 2 and '+python3/dyn' for Python 3. Take note of the Vim architecture, i.e. 32 or 64-bit. It will be important when choosing the Python installer. We recommend using a 64-bit client. Daily updated copies of 32-bit and 64-bit Vim with -Python 2 and Python 3 support [37] are available. +Python 2 and Python 3 support [36] are available. Add the line: > set encoding=utf-8 < -to your vimrc [38] if not already present. This option is required by YCM. Note +to your vimrc [37] if not already present. This option is required by YCM. Note that it does not prevent you from editing a file in another encoding than UTF-8. You can do that by specifying the '|++enc|' argument to the ':e' command. -Install YouCompleteMe with Vundle [26]. +Install YouCompleteMe with Vundle [25]. **Remember:** YCM is a plugin with a compiled component. If you **update** YCM using Vundle and the ycm_core library APIs have changed (happens rarely), YCM @@ -639,7 +627,7 @@ will notify you to recompile it. You should then rerun the install process. Download and install the following software: -- Python 2 or Python 3 [39]. Be sure to pick the version corresponding to +- Python 2 or Python 3 [38]. Be sure to pick the version corresponding to your Vim architecture. It is _Windows x86_ for a 32-bit Vim and _Windows x86-64_ for a 64-bit Vim. We recommend installing Python 3. Additionally, the version of Python you install must match up exactly with the version of @@ -651,9 +639,9 @@ Download and install the following software: Python 3.5. You'll need one or the other installed, matching the version number exactly. -- CMake [28]. Add CMake executable to the PATH environment variable. +- CMake [27]. Add CMake executable to the PATH environment variable. -- Visual Studio [40]. Download the community edition. During setup, select +- Visual Studio [39]. Download the community edition. During setup, select _Desktop development with C++_ in _Workloads_. Compiling YCM **with** semantic support for C-family languages: @@ -669,21 +657,18 @@ Compiling YCM **without** semantic support for C-family languages: The following additional language support options are available: - C# support: add '--cs-completer' when calling 'install.py'. Be sure that - the build utility 'msbuild' is in your PATH [41]. + the build utility 'msbuild' is in your PATH [40]. -- Go support: install Go [30] and add '--go-completer' when calling +- Go support: install Go [29] and add '--go-completer' when calling 'install.py'. -- TypeScript support: install Node.js and npm [31] then install the - TypeScript SDK with 'npm install -g typescript'. +- JavaScript and TypeScript support: install Node.js and npm [30] then + install the TypeScript SDK with 'npm install -g typescript'. -- JavaScript support: install Node.js and npm [31] and add '--js-completer' - when calling 'install.py'. - -- Rust support: install Rust [32] and add '--rust-completer' when calling +- Rust support: install Rust [31] and add '--rust-completer' when calling 'install.py'. -- Java support: install JDK8 (version 8 required) [33] and add '--java- +- Java support: install JDK8 (version 8 required) [32] and add '--java- completer' when calling './install.py'. To simply compile with everything enabled, there's a '--all' flag. So, to @@ -724,7 +709,7 @@ For FreeBSD 11.x, the requirement is cmake: > pkg install cmake < -Install YouCompleteMe with Vundle [26]. +Install YouCompleteMe with Vundle [25]. **Remember:** YCM is a plugin with a compiled component. If you **update** YCM using Vundle and the ycm_core library APIs have changed (happens rarely), YCM @@ -750,19 +735,16 @@ The following additional language support options are available: - C# support: install Mono and add '--cs-completer' when calling './install.py'. -- Go support: install Go [30] and add '--go-completer' when calling +- Go support: install Go [29] and add '--go-completer' when calling './install.py'. -- TypeScript support: install Node.js and npm [31] then install the - TypeScript SDK with 'npm install -g typescript'. +- JavaScript and TypeScript support: install Node.js and npm [30] then + install the TypeScript SDK with 'npm install -g typescript'. -- JavaScript support: install Node.js and npm [31] and add '--js-completer' - when calling './install.py'. - -- Rust support: install Rust [32] and add '--rust-completer' when calling +- Rust support: install Rust [31] and add '--rust-completer' when calling './install.py'. -- Java support: install JDK8 (version 8 required) [33] and add '--java- +- Java support: install JDK8 (version 8 required) [32] and add '--java- completer' when calling './install.py'. To simply compile with everything enabled, there's a '--all' flag. So, to @@ -812,7 +794,7 @@ will notify you to recompile it. You should then rerun the install process. higher. If your version of Vim is not recent enough, you may need to compile Vim - from source [34] (don't worry, it's easy). + from source [33] (don't worry, it's easy). After you have made sure that you have Vim 7.4.1578+, type the following in Vim: ":echo has('python') || has('python3')". The output should be 1. @@ -822,9 +804,9 @@ will notify you to recompile it. You should then rerun the install process. critical because it must match the Python and the YCM libraries architectures. We recommend using a 64-bit Vim. -2. **Install YCM** with Vundle [26] (or Pathogen [42], but Vundle is a +2. **Install YCM** with Vundle [25] (or Pathogen [41], but Vundle is a better idea). With Vundle, this would mean adding a "Plugin - 'Valloric/YouCompleteMe'" line to your vimrc [38]. + 'Valloric/YouCompleteMe'" line to your vimrc [37]. If you don't install YCM with Vundle, make sure you have run 'git submodule update --init --recursive' after checking out the YCM @@ -841,7 +823,7 @@ will notify you to recompile it. You should then rerun the install process. You can use the system libclang _only if you are sure it is version 3.9 or higher_, otherwise don't. Even if it is, we recommend using the - official binaries from llvm.org [43] if at all possible. Make sure you + official binaries from llvm.org [42] if at all possible. Make sure you download the correct archive file for your OS. We **STRONGLY recommend AGAINST use** of the system libclang instead of @@ -854,17 +836,17 @@ will notify you to recompile it. You should then rerun the install process. You will need to have 'cmake' installed in order to generate the required makefiles. Linux users can install cmake with their package manager ('sudo apt-get install cmake' for Ubuntu) whereas other users can - download and install [28] cmake from its project site. Mac users can also - get it through Homebrew [27] with 'brew install cmake'. + download and install [27] cmake from its project site. Mac users can also + get it through Homebrew [26] with 'brew install cmake'. On a Unix OS, you need to make sure you have Python headers installed. On a Debian-like Linux distro, this would be 'sudo apt-get install python- dev python3-dev'. On Mac they should already be present. - On Windows, you need to download and install Python 2 or Python 3 [39]. + On Windows, you need to download and install Python 2 or Python 3 [38]. Pick the version corresponding to your Vim architecture. You will also need Microsoft Visual C++ (MSVC) to build YCM. You can obtain it by - installing Visual Studio [40]. MSVC 14 (Visual Studio 2015) and 15 (2017) + installing Visual Studio [39]. MSVC 14 (Visual Studio 2015) and 15 (2017) are officially supported. Here we'll assume you installed YCM with Vundle. That means that the top- @@ -906,7 +888,7 @@ will notify you to recompile it. You should then rerun the install process. extracted the archive file to folder '~/ycm_temp/llvm_root_dir' (with 'bin', 'lib', 'include' etc. folders right inside that folder). On Windows, you can extract the files from the LLVM+Clang installer using - 7-zip [44]. + 7-zip [43]. **NOTE:** This _only_ works with a _downloaded_ LLVM binary package, not a custom-built LLVM! See docs below for 'EXTERNAL_LIBCLANG_PATH' when @@ -947,7 +929,7 @@ will notify you to recompile it. You should then rerun the install process. 5. _This step is optional._ - Build the regex [45] module for improved Unicode support and better + Build the regex [44] module for improved Unicode support and better performance with regular expressions. The procedure is similar to compiling the 'ycm_core' library: > @@ -961,33 +943,29 @@ will notify you to recompile it. You should then rerun the install process. 6. Set up support for additional languages, as desired: - - C# support: install Mono on non-Windows platforms [46]. Navigate to + - C# support: install Mono on non-Windows platforms [45]. Navigate to 'YouCompleteMe/third_party/ycmd/third_party/OmniSharpServer' and run msbuild /property:Configuration=Release /property:Platform="Any CPU" /property:TargetFrameworkVersion=v4.5 On Windows, be sure that the build utility 'msbuild' is in your PATH - [41]. + [40]. - - Go support: install Go [30] and add it to your path. Navigate to + - Go support: install Go [29] and add it to your path. Navigate to 'YouCompleteMe/third_party/ycmd/third_party/gocode' and run 'go build'. - - TypeScript support: as with the quick installation, simply 'npm - install -g typescript' after successfully installing Node.js and npm - [31]. + - JavaScript and TypeScript support: as with the quick installation, + simply 'npm install -g typescript' after successfully installing + Node.js and npm [30]. - - JavaScript support: install Node.js and npm [31]. Then navigate to - 'YouCompleteMe/third_party/ycmd/third_party/tern_runtime' and run - 'npm install --production' - - - Rust support: install Rust [32]. Navigate to + - Rust support: install Rust [31]. Navigate to 'YouCompleteMe/third_party/ycmd/third_party/racerd' and run 'cargo build --release'. - - Java support: install JDK8 (version 8 required) [33]. Download a - binary release of eclipse.jdt.ls [47] and extract it to 'YouCompleteM + - Java support: install JDK8 (version 8 required) [32]. Download a + binary release of eclipse.jdt.ls [46] and extract it to 'YouCompleteM e/third_party/ycmd/third_party/eclipse.jdt.ls/target/repository'. Note: this approach is not recommended for most users and is supported only for advanced users and developers of YCM on a best- @@ -1057,8 +1035,8 @@ Go ~ - Management of 'gocode' server instance ------------------------------------------------------------------------------- - *youcompleteme-typescript* -TypeScript ~ + *youcompleteme-javascript-typescript* +JavaScript and TypeScript ~ - Semantic auto-completion with automatic import insertion - Go to definition (|GoTo|, |GoToDefinition|, and |GoToDeclaration| are @@ -1074,17 +1052,6 @@ TypeScript ~ - Organize imports (|OrganizeImports|) - Management of 'TSServer' server instance -------------------------------------------------------------------------------- - *youcompleteme-javascript* -JavaScript ~ - -- Intelligent auto-completion -- Renaming variables ('RefactorRename ') -- Go to definition, find references (|GoToDefinition|, |GoToReferences|) -- Type information for identifiers (|GetType|) -- View documentation comments for identifiers (|GetDoc|) -- Management of 'Tern' server instance - ------------------------------------------------------------------------------- *youcompleteme-rust* Rust ~ @@ -1127,7 +1094,7 @@ General Usage ~ If the offered completions are too broad, keep typing characters; YCM will continue refining the offered completions based on your input. -Filtering is "smart-case" and "smart-diacritic [48]" sensitive; if you are +Filtering is "smart-case" and "smart-diacritic [47]" sensitive; if you are typing only lowercase letters, then it's case-insensitive. If your input contains uppercase letters, then the uppercase letters in your query must match uppercase letters in the completion strings (the lowercase letters still match @@ -1178,7 +1145,7 @@ and presents the results to you. Client-Server Architecture ~ YCM has a client-server architecture; the Vim part of YCM is only a thin client -that talks to the ycmd HTTP+JSON server [49] that has the vast majority of YCM +that talks to the ycmd HTTP+JSON server [48] that has the vast majority of YCM logic and functionality. The server is started and stopped automatically as you start and stop Vim. @@ -1218,8 +1185,8 @@ analysis. There are 2 methods which can be used to provide compile flags to 'libclang': ------------------------------------------------------------------------------- - *youcompleteme-option-1-use-compilation-database-50* -Option 1: Use a compilation database [50] ~ + *youcompleteme-option-1-use-compilation-database-49* +Option 1: Use a compilation database [49] ~ The easiest way to get YCM to compile your code is to use a compilation database. A compilation database is usually generated by your build system @@ -1227,13 +1194,13 @@ database. A compilation database is usually generated by your build system in your project. For information on how to generate a compilation database, see the clang -documentation [50]. In short: +documentation [49]. In short: - If using CMake, add '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON' when configuring (or add 'set( CMAKE_EXPORT_COMPILE_COMMANDS ON )' to 'CMakeLists.txt') and copy or symlink the generated database to the root of your project. -- If using Ninja, check out the 'compdb' tool ('-t compdb') in its docs [51]. -- If using GNU make, check out Bear [52]. +- If using Ninja, check out the 'compdb' tool ('-t compdb') in its docs [50]. +- If using GNU make, check out Bear [51]. - For other build systems, check out '.ycm_extra_conf.py' below. If no '.ycm_extra_conf.py' is found, YouCompleteMe automatically tries to load @@ -1314,14 +1281,14 @@ That's it! This is actually enough for most projects, but for complex projects it is not uncommon to integrate directly with an existing build system using the full power of the Python language. -For a more elaborate example, see YCM's own '.ycm_extra_conf.py' [53]. You +For a more elaborate example, see YCM's own '.ycm_extra_conf.py' [52]. You should be able to use it _as a starting point_. **Don't** just copy/paste that file somewhere and expect things to magically work; **your project needs different flags**. Hint: just replace the strings in the 'flags' variable with compilation flags necessary for your project. That should be enough for 99% of projects. -You could also consider using YCM-Generator [54] to generate the +You could also consider using YCM-Generator [53] to generate the 'ycm_extra_conf.py' file. ------------------------------------------------------------------------------- @@ -1370,8 +1337,8 @@ Java Project Files ~ In order to provide semantic analysis, the Java completion engine requires knowledge of your project structure. In particular it needs to know the class -path to use, when compiling your code. Fortunately jdt.ls [20] supports eclipse -project files [55], maven projects [56] and gradle projects [57]. +path to use, when compiling your code. Fortunately jdt.ls [19] supports eclipse +project files [54], maven projects [55] and gradle projects [56]. **NOTE:** Our recommendation is to use either maven or gradle projects. @@ -1406,16 +1373,16 @@ native Java support. This can be done temporarily with ':EclimDisable'. *youcompleteme-eclipse-projects* Eclipse Projects ~ -Eclipse style projects require two files: .project [55] and .classpath [58]. +Eclipse style projects require two files: .project [54] and .classpath [57]. If your project already has these files due to previously being set up within -eclipse, then no setup is required. jdt.ls [20] should load the project just +eclipse, then no setup is required. jdt.ls [19] should load the project just fine (it's basically eclipse after all). However, if not, it is possible (easy in fact) to craft them manually, though it is not recommended. You're better off using gradle or maven (see below). -A simple eclipse style project example [59] can be found in the ycmd test +A simple eclipse style project example [58] can be found in the ycmd test directory. Normally all that is required is to copy these files to the root of your project and to edit the '.classpath' to add additional libraries, such as: > @@ -1435,10 +1402,10 @@ don't already use eclipse to manage your projects. *youcompleteme-maven-projects* Maven Projects ~ -Maven needs a file named pom.xml [56] in the root of the project. Once again a -simple pom.xml [60] can be found in ycmd source. +Maven needs a file named pom.xml [55] in the root of the project. Once again a +simple pom.xml [59] can be found in ycmd source. -The format of pom.xml [56] files is way beyond the scope of this document, but +The format of pom.xml [55] files is way beyond the scope of this document, but we do recommend using the various tools that can generate them for you, if you're not familiar with them already. @@ -1446,10 +1413,10 @@ you're not familiar with them already. *youcompleteme-gradle-projects* Gradle Projects ~ -Gradle projects require a build.gradle [57]. Again, there is a trivial example -in ycmd's tests [61]. +Gradle projects require a build.gradle [56]. Again, there is a trivial example +in ycmd's tests [60]. -The format of build.gradle [57] files is way beyond the scope of this document, +The format of build.gradle [56] files is way beyond the scope of this document, but we do recommend using the various tools that can generate them for you, if you're not familiar with them already. @@ -1478,99 +1445,9 @@ configured the project files, in particular check that the classpath is set correctly. For anything else, contact us. Java support is experimental at present so we'd -love to hear your feedback! Please do remember to check CONTRIBUTING.md [62] +love to hear your feedback! Please do remember to check CONTRIBUTING.md [61] for the list of diagnostics we'll need. -------------------------------------------------------------------------------- - *youcompleteme-javascript-semantic-completion* -JavaScript Semantic Completion ~ - -------------------------------------------------------------------------------- - *youcompleteme-javascript-quick-start* -JavaScript quick start ~ - -1. Ensure that you have enabled the JavaScript completer. See the - installation guide for details. - -2. Create a '.tern-project' file in the root directory of your JavaScript - project, by following the instructions [63] in the Tern [18] - documentation. - -3. Edit a file from your project. - -------------------------------------------------------------------------------- - *youcompleteme-explanation* -Explanation ~ - -JavaScript completion is based on Tern [18]. This completion engine requires a -file named '.tern-project' [63] to exist in the current working directory or a -directory which is an ancestor of the current working directory when the Tern -server is started. YCM starts the Tern server the first time a JavaScript file -is edited and uses its directory as the working directory, so the directory of -that file at that time needs to be a descendent of the directory containing the -'.tern-project' file (or that directory itself). - -Alternatively, as described in the Tern documentation [64], a global '.tern- -config' file may be used. - -Multiple Tern servers are not supported. To switch to a different JavaScript -project, you need to restart the Tern server using the |RestartServer| -subcommand while editing a file of that project: -> - :YcmCompleter RestartServer -< -------------------------------------------------------------------------------- - *youcompleteme-tips-tricks* -Tips and tricks ~ - -This section contains some advice for configuring '.tern-project' and working -with JavaScript files. The canonical reference for correctly configuring Tern -is the Tern documentation [64]. Any issues, improvements, advice, etc. should -be sought from the Tern [18] project. For example, see the list of tern plugins -[65] for the list of plugins which can be enabled in the 'plugins' section of -the '.tern-project' file. - -------------------------------------------------------------------------------- - *youcompleteme-configuring-tern-for-node-support* -Configuring Tern for node support ~ - -The following simple example '.tern-project' file enables nodejs support: -> - { - "plugins": { - "node": {} - } - } -< -------------------------------------------------------------------------------- - *youcompleteme-configuring-tern-for-requirejs-support* -Configuring Tern for requirejs support ~ - -The Tern requirejs plugin requires that all included "libraries" are rooted -under the same base directory. If that's not the case for your projects, then -it is possible to make it work with appropriate symbolic links. For example, -create a directory 'ext_lib' within your project and populate it with symlinks -to your libraries. Then set up the '.tern-project' something like this: -> - { - "plugins": { - "requirejs": { - "baseURL": "./ext_lib", - } - } - } -< -Then, given the following structure: -> - ./ext_lib/mylib (symlink) - ./ext_lib/anotherlib (symlink) -< -Can be used as follows: -> - define( [ 'mylib/file1', 'anotherlib/anotherfile' ], function( f1, f2 ) { - // etc. - } ); -< ------------------------------------------------------------------------------- *youcompleteme-python-semantic-completion* Python Semantic Completion ~ @@ -1579,7 +1456,7 @@ Completion and GoTo commands work out of the box with no additional configuration. Those features are provided by the jedi [12] library which supports a variety of Python versions (2.6, 2.7, 3.2+) as long as it runs in the corresponding Python interpreter. By default YCM runs jedi [12] with the -same Python interpreter used by the ycmd server [49], so if you would like to +same Python interpreter used by the ycmd server [48], so if you would like to use a different interpreter, use the following option specifying the Python binary to use. For example, to provide Python 3 completion in your project, set: @@ -1606,7 +1483,7 @@ Completions and GoTo commands within the current crate and its dependencies should work out of the box with no additional configuration (provided that you built YCM with the '--rust-completer' flag; see the _Installation_ section for details). For semantic analysis inclusive of the standard library, you must -have a local copy of the Rust source code [66]. If using rustup [67], run the +have a local copy of the Rust source code [62]. If using rustup [63], run the following command to download the code: > rustup component add rust-src @@ -1619,18 +1496,38 @@ extract it somewhere, and set the following option so YCM can locate it: let g:ycm_rust_src_path = '/usr/local/rust/rustc-1.20.0/src' < ------------------------------------------------------------------------------- - *youcompleteme-typescript-semantic-completion* -TypeScript Semantic Completion ~ + *youcompleteme-javascript-typescript-semantic-completion* +JavaScript and TypeScript Semantic Completion ~ -All TypeScript features are provided by the TSServer [17] engine, which is -included in the TypeScript SDK. To get the SDK, install Node.js and npm [31] -and run the command: +**NOTE:** YCM originally used the Tern [64] engine for JavaScript but due to +Tern [64] not being maintained anymore by its main author and the TSServer [17] +engine offering more features, YCM is moving to TSServer [17]. This won't +affect you if you were already using Tern [64] but you are encouraged to do the +switch by deleting the 'third_party/ycmd/third_party/tern_runtime/node_modules' +directory in YCM folder. If you are a new user but still want to use Tern [64], +you should pass the '--js-completer' option to the 'install.py' script during +installation. Further instructions on how to setup YCM with Tern [64] are +available on the wiki [65]. + +All JavaScript and TypeScript features are provided by the TSServer [17] +engine, which is included in the TypeScript SDK. To get the SDK, install +Node.js and npm [30] and run the command: > npm install -g typescript < -TSServer [17] relies on the 'tsconfig.json' file [68] to analyze your project. -Ensure the file exists at the root of your project. +TSServer [17] relies on the 'jsconfig.json' file [66] for JavaScript and the +'tsconfig.json' file [67] for TypeScript to analyze your project. Ensure the +file exists at the root of your project. +To get diagnostics in JavaScript, set the 'checkJs' option to 'true' in your +'jsconfig.json' file: +> + { + "compilerOptions": { + "checkJs": true + } + } +< TypeScript 2.8.1 or later is recommended. Some features will be missing on older versions. You can check which version you are currently using by looking at the output of |:YcmDebugInfo|. If the version is 'None', your TypeScript is @@ -1640,18 +1537,18 @@ too old and should be updated. *youcompleteme-semantic-completion-for-other-languages* Semantic Completion for Other Languages ~ -C-family, C#, Go, Java, JavaScript, Python, Rust, and TypeScript languages are +C-family, C#, Go, Java, Python, Rust, and JavaScript/TypeScript languages are supported natively by YouCompleteMe using the Clang [11], OmniSharp [14], -Gocode [15]/Godef [16], jdt.ls [20], Tern [18], Jedi [12], racer [19], and -TSServer [17] engines, respectively. Check the installation section for -instructions to enable these features if desired. +Gocode [15]/Godef [16], jdt.ls [19], Jedi [12], racer [18], and TSServer [17] +engines, respectively. Check the installation section for instructions to +enable these features if desired. YCM will use your 'omnifunc' (see ':h omnifunc' in Vim) as a source for semantic completions if it does not have a native semantic completion engine for your file's filetype. Vim comes with okayish omnifuncs for various languages like Ruby, PHP, etc. It depends on the language. -You can get a stellar omnifunc for Ruby with Eclim [69]. Just make sure you +You can get a stellar omnifunc for Ruby with Eclim [68]. Just make sure you have the _latest_ Eclim installed and configured (this means Eclim '>= 2.2.*' and Eclipse '>= 4.2.*'). @@ -1668,7 +1565,7 @@ Writing New Semantic Completers ~ You have two options here: writing an 'omnifunc' for Vim's omnicomplete system that YCM will then use through its omni-completer, or a custom completer for -YCM using the Completer API [70]. +YCM using the Completer API [69]. Here are the differences between the two approaches: @@ -1687,7 +1584,7 @@ Here are the differences between the two approaches: than VimScript. If you want to use the 'omnifunc' system, see the relevant Vim docs with ':h -complete-functions'. For the Completer API, see the API docs [70]. +complete-functions'. For the Completer API, see the API docs [69]. If you want to upstream your completer into YCM's source, you should use the Completer API. @@ -1696,11 +1593,10 @@ Completer API. *youcompleteme-diagnostic-display* Diagnostic Display ~ -YCM will display diagnostic notifications for C-family and C# languages if you -compiled YCM with Clang and Omnisharp support, respectively. Diagnostics will -also be displayed for TypeScript. Since YCM continuously recompiles your file -as you type, you'll get notified of errors and warnings in your file as fast as -possible. +YCM will display diagnostic notifications for the C-family, C#, Java, +JavaScript, and TypeScript languages. Since YCM continuously recompiles your +file as you type, you'll get notified of errors and warnings in your file as +fast as possible. Here are the various pieces of the diagnostic UI: @@ -1739,7 +1635,7 @@ current file in Vim's 'locationlist', which can be opened with the ':lopen' and ':lclose' commands (make sure you have set 'let g:ycm_always_populate_location_list = 1' in your vimrc). A good way to toggle the display of the 'locationlist' with a single key mapping is provided by -another (very small) Vim plugin called ListToggle [71] (which also makes it +another (very small) Vim plugin called ListToggle [70] (which also makes it possible to change the height of the 'locationlist' window), also written by yours truly. @@ -1781,7 +1677,7 @@ Commands ~ ------------------------------------------------------------------------------- The *:YcmRestartServer* command -If the ycmd completion server [49] suddenly stops for some reason, you can +If the ycmd completion server [48] suddenly stops for some reason, you can restart it with this command. ------------------------------------------------------------------------------- @@ -1829,7 +1725,7 @@ semantic completion engine. The *:YcmToggleLogs* command This command presents the list of logfiles created by YCM, the ycmd server -[49], and the semantic engine server for the current filetype, if any. One of +[48], and the semantic engine server for the current filetype, if any. One of these logfiles can be opened in the editor (or closed if already open) by entering the corresponding number or by clicking on it with the mouse. Additionally, this command can take the logfile names as arguments. Use the @@ -1902,8 +1798,8 @@ The *GoToDeclaration* subcommand Looks up the symbol under the cursor and jumps to its declaration. -Supported in filetypes: 'c, cpp, objc, objcpp, cuda, cs, go, java, python, -rust, typescript' +Supported in filetypes: 'c, cpp, objc, objcpp, cuda, cs, go, java, javascript, +python, rust, typescript' ------------------------------------------------------------------------------- The *GoToDefinition* subcommand @@ -1978,7 +1874,7 @@ The *GoToType* subcommand Looks up the symbol under the cursor and jumps to the definition of its type e.g. if the symbol is an object, go to the definition of its class. -Supported in filetypes: 'typescript' +Supported in filetypes: 'javascript, typescript' ------------------------------------------------------------------------------- *youcompleteme-semantic-information-commands* @@ -2112,7 +2008,8 @@ indication). **NOTE:** Causes re-parsing of the current translation unit. -Supported in filetypes: 'c, cpp, objc, objcpp, cuda, cs, java, typescript' +Supported in filetypes: 'c, cpp, objc, objcpp, cuda, cs, java, javascript, +typescript' ------------------------------------------------------------------------------- *RefactorRename-new-name* @@ -2128,7 +2025,7 @@ files. Rename operations may involve changes to multiple files, which may or may not be open in Vim buffers at the time. YouCompleteMe handles all of this for you. The behavior is described in the following section. -Supported in filetypes: 'java, javascript (variables only), typescript' +Supported in filetypes: 'java, javascript, typescript' ------------------------------------------------------------------------------- *youcompleteme-multi-file-refactor* @@ -2172,7 +2069,7 @@ select it in one of Vim's visual modes (see ':h visual-use') and run the command or directly enter the range on the command line, e.g. ':2,5YcmCompleter Format' to format it from line 2 to line 5. -Supported in filetypes: 'java, typescript' +Supported in filetypes: 'java, javascript, typescript' ------------------------------------------------------------------------------- The *OrganizeImports* subcommand @@ -2181,7 +2078,7 @@ This command removes unused imports and sorts imports in the current file. It can also group imports from the same module in TypeScript and resolves imports in Java. -Supported in filetypes: 'java, typescript' +Supported in filetypes: 'java, javascript, typescript' ------------------------------------------------------------------------------- *youcompleteme-miscellaneous-commands* @@ -2197,9 +2094,6 @@ The *RestartServer* subcommand Restarts the semantic-engine-as-localhost-server for those semantic engines that work as separate servers that YCM talks to. -Use this subcommand while editing a file from a JavaScript project to switch to -that project. - An additional optional argument may be supplied for Python, specifying the python binary to use to restart the Python semantic engine. > @@ -2245,7 +2139,7 @@ For example: call youcompleteme#GetErrorCount() < Both this function and |youcompleteme#GetWarningCount| can be useful when -integrating YCM with other Vim plugins. For example, a lightline [72] user +integrating YCM with other Vim plugins. For example, a lightline [71] user could add a diagnostics section to their statusline which would display the number of errors and warnings. @@ -2309,12 +2203,12 @@ Options ~ All options have reasonable defaults so if the plug-in works after installation you don't need to change any options. These options can be configured in your -vimrc script [38] by including a line like this: +vimrc script [37] by including a line like this: > let g:ycm_min_num_of_chars_for_completion = 1 < -Note that after changing an option in your vimrc script [38] you have to -restart ycmd [49] with the |:YcmRestartServer| command for the changes to take +Note that after changing an option in your vimrc script [37] you have to +restart ycmd [48] with the |:YcmRestartServer| command for the changes to take effect. ------------------------------------------------------------------------------- @@ -2613,13 +2507,13 @@ YCM will not render it. The following filter types are supported: -- "regex": Accepts a string regular expression [73]. This type matches when +- "regex": Accepts a string regular expression [72]. This type matches when the regex (treated as case-insensitive) is found in the diagnostic text. - "level": Accepts a string level, either "warning" or "error." This type matches when the diagnostic has the same level. -**NOTE:** The regex syntax is **NOT** Vim's, it's Python's [73]. +**NOTE:** The regex syntax is **NOT** Vim's, it's Python's [72]. Default: '{}' > @@ -2708,7 +2602,7 @@ from the 'tagfiles()' Vim function which examines the 'tags' Vim option. See YCM will re-index your tags files if it detects that they have been modified. -The only supported tag format is the Exuberant Ctags format [74]. The format +The only supported tag format is the Exuberant Ctags format [73]. The format from "plain" ctags is NOT supported. Ctags needs to be called with the '-- fields=+l' option (that's a lowercase 'L', not a one) because YCM needs the 'language:' field in the tags output. @@ -2745,7 +2639,7 @@ handy; it's a way of sending data from Vim to your 'Settings' function in your '.ycm_extra_conf.py' file. This option is supposed to be a list of VimScript expression strings that are -evaluated for every request to the ycmd server [49] and then passed to your +evaluated for every request to the ycmd server [48] and then passed to your 'Settings' function as a 'client_data' keyword argument. For instance, if you set this option to "['v:version']", your 'Settings' @@ -2774,7 +2668,7 @@ YCM will by default search for an appropriate Python interpreter on your system. You can use this option to override that behavior and force the use of a specific interpreter of your choosing. -**NOTE:** This interpreter is only used for the ycmd server [49]. The YCM +**NOTE:** This interpreter is only used for the ycmd server [48]. The YCM client running inside Vim always uses the Python interpreter that's embedded inside Vim. @@ -2785,7 +2679,7 @@ Default: "''" ------------------------------------------------------------------------------- The *g:ycm_keep_logfiles* option -When this option is set to '1', YCM and the ycmd completion server [49] will +When this option is set to '1', YCM and the ycmd completion server [48] will keep the logfiles around after shutting down (they are deleted on shutdown by default). @@ -2798,7 +2692,7 @@ Default: '0' ------------------------------------------------------------------------------- The *g:ycm_log_level* option -The logging level that YCM and the ycmd completion server [49] use. Valid +The logging level that YCM and the ycmd completion server [48] use. Valid values are the following, from most verbose to least verbose: - 'debug' - 'info' - 'warning' - 'error' - 'critical' @@ -2946,7 +2840,7 @@ The *g:ycm_key_list_stop_completion* option This option controls the key mappings used to close the completion menu. This is useful when the menu is blocking the view, when you need to insert the -'' character, or when you want to expand a snippet from UltiSnips [24] and +'' character, or when you want to expand a snippet from UltiSnips [23] and navigate through it. Default: "['']" @@ -3088,7 +2982,7 @@ It's also possible to use a regular expression as a trigger. You have to prefix your trigger with 're!' to signify it's a regex trigger. For instance, 're!\w+\.' would only trigger after the '\w+\.' regex matches. -**NOTE:** The regex syntax is **NOT** Vim's, it's Python's [73]. +**NOTE:** The regex syntax is **NOT** Vim's, it's Python's [72]. Default: '[see next line]' > @@ -3174,7 +3068,7 @@ The *g:ycm_python_binary_path* option This option specifies the Python interpreter to use to run the jedi [12] completion library. Specify the Python interpreter to use to get completions. -By default the Python under which ycmd [49] runs is used (ycmd [49] runs on +By default the Python under which ycmd [48] runs is used (ycmd [48] runs on Python 2.7.1+ or 3.4+). Default: "''" @@ -3193,7 +3087,7 @@ FAQ ~ I used to be able to 'import vim' in '.ycm_extra_conf.py', but now can't ~ YCM was rewritten to use a client-server architecture where most of the logic -is in the ycmd server [49]. So the magic 'vim' module you could have previously +is in the ycmd server [48]. So the magic 'vim' module you could have previously imported in your '.ycm_extra_conf.py' files doesn't exist anymore. To be fair, importing the magic 'vim' module in extra conf files was never @@ -3264,7 +3158,7 @@ to the message log if it encounters problems. It's likely you misconfigured something and YCM is complaining about it. Also, you may want to run the |:YcmDebugInfo| command; it will make YCM spew -out various debugging information, including the YCM and ycmd [49] logfile +out various debugging information, including the YCM and ycmd [48] logfile paths and the compile flags for the current file if the file is a C-family language file and you have compiled in Clang support. Logfiles can be opened in the editor using the |:YcmToggleLogs| command. @@ -3322,7 +3216,7 @@ produced. See the full installation guide for help. I'm trying to use a Homebrew Vim with YCM and I'm getting segfaults ~ Something (I don't know what) is wrong with the way that Homebrew configures -and builds Vim. I recommend using MacVim [25]. Even if you don't like the +and builds Vim. I recommend using MacVim [24]. Even if you don't like the MacVim GUI, you can use the Vim binary that is inside the MacVim.app package (it's 'MacVim.app/Contents/MacOS/Vim') and get the Vim console experience. @@ -3332,7 +3226,7 @@ I have a Homebrew Python and/or MacVim; can't compile/SIGABRT when starting ~ You should probably run 'brew rm python; brew install python' to get the latest fixes that should make YCM work with such a configuration. Also rebuild Macvim -then. If you still get problems with this, see issue #18 [75] for suggestions. +then. If you still get problems with this, see issue #18 [74] for suggestions. ------------------------------------------------------------------------------- *youcompleteme-i-get-long_bit-definition-appears-wrong-for-platform-when-compiling* @@ -3431,15 +3325,15 @@ YCM does not read identifiers from my tags files ~ First, put 'let g:ycm_collect_identifiers_from_tags_files = 1' in your vimrc. -Make sure you are using Exuberant Ctags [76] to produce your tags files since -the only supported tag format is the Exuberant Ctags format [74]. The format +Make sure you are using Exuberant Ctags [75] to produce your tags files since +the only supported tag format is the Exuberant Ctags format [73]. The format from "plain" ctags is NOT supported. The output of 'ctags --version' should -list "Exuberant Ctags". See Universal Ctags [77] for a maintained version. +list "Exuberant Ctags". See Universal Ctags [76] for a maintained version. Ctags needs to be called with the '--fields=+l' (that's a lowercase 'L', not a one) option because YCM needs the 'language:' field in the tags output. -**NOTE:** Exuberant Ctags [76] by default sets language tag for '*.h' files as +**NOTE:** Exuberant Ctags [75] by default sets language tag for '*.h' files as 'C++'. If you have C (not C++) project, consider giving parameter '-- langmap=c:.c.h' to ctags to see tags from '*.h' files. @@ -3518,7 +3412,7 @@ asynchronicity. This feature is available since Vim 7.4.1578. *youcompleteme-nasty-bugs-happen-if-i-have-vim-autoclose-plugin-installed* Nasty bugs happen if I have the 'vim-autoclose' plugin installed ~ -Use the delimitMate [78] plugin instead. It does the same thing without +Use the delimitMate [77] plugin instead. It does the same thing without conflicting with YCM. ------------------------------------------------------------------------------- @@ -3526,7 +3420,7 @@ conflicting with YCM. Is there some sort of YCM mailing list? I have questions ~ If you have questions about the plugin or need help, please use the ycm-users -[79] mailing list, _don't_ create issues on the tracker. The tracker is for bug +[78] mailing list, _don't_ create issues on the tracker. The tracker is for bug reports and feature requests. ------------------------------------------------------------------------------- @@ -3580,7 +3474,7 @@ mismatch in assumptions causes performance problems since Syntastic code isn't optimized for this use case of constant diagnostic refreshing. Poor support for this use case also led to crash bugs in Vim caused by -Syntastic-Vim interactions (issue #593 [80]) and other problems, like random +Syntastic-Vim interactions (issue #593 [79]) and other problems, like random Vim flickering. Attempts were made to resolve these issues in Syntastic, but ultimately some of them failed (for various reasons). @@ -3616,18 +3510,7 @@ paths, prepend '-isystem' to each individual path and append them all to the list of flags you return from your 'Settings' function in your '.ycm_extra_conf.py' file. -See issue #303 [81] for details. - -------------------------------------------------------------------------------- -*youcompleteme-when-i-open-javascript-file-i-get-an-annoying-warning-about-.tern-project-file* -When I open a JavaScript file, I get an annoying warning about '.tern- ~ -project' file ~ - -Take a look at the instructions for using the JavaScript completer. - -If this is still really annoying, and you have a good reason not to have a -'.tern-project' file, create an empty '.tern-config' file in your home -directory and YCM will stop complaining. +See issue #303 [80] for details. ------------------------------------------------------------------------------- *youcompleteme-when-i-start-vim-i-get-runtime-error-saying-r6034-an-application-has-made-an-attempt-to-load-c-runtime-library-incorrectly.* @@ -3635,7 +3518,7 @@ When I start vim I get a runtime error saying 'R6034 An application has made ~ an attempt to load the C runtime library incorrectly.' ~ CMake and other things seem to screw up the PATH with their own msvcrXX.dll -versions. [82] Add the following to the very top of your vimrc to remove these +versions. [81] Add the following to the very top of your vimrc to remove these entries from the path. > python << EOF @@ -3660,7 +3543,7 @@ entries from the path. *youcompleteme-i-hear-that-ycm-only-supports-python-2-is-that-true* I hear that YCM only supports Python 2, is that true? ~ -**No.** Both the Vim client and the ycmd server [49] run on Python 2 or 3. If +**No.** Both the Vim client and the ycmd server [48] run on Python 2 or 3. If you work on a Python 3 project, you may need to set |g:ycm_python_binary_path| to the Python interpreter you use for your project to get completions for that version of Python. @@ -3671,7 +3554,7 @@ On Windows I get "E887: Sorry, this command is disabled, the Python's site ~ module could not be loaded" ~ If you are running vim on Windows with Python 2.7.11, this is likely caused by -a bug [83]. Follow this workaround [84] or use a different version (Python +a bug [82]. Follow this workaround [83] or use a different version (Python 2.7.12 does not suffer from the bug). ------------------------------------------------------------------------------- @@ -3703,12 +3586,12 @@ In recent versions of Vim, you can install YCM in a folder under *youcompleteme-ycm-does-not-shut-down-when-i-quit-vim* YCM does not shut down when I quit Vim ~ -YCM relies on the 'VimLeave' event to shut down the ycmd server [49]. Some +YCM relies on the 'VimLeave' event to shut down the ycmd server [48]. Some plugins prevent this event from triggering by exiting Vim through an autocommand without using the 'nested' keyword (see ':h autocmd-nested'). One -of these plugins is vim-nerdtree-tabs [85]. You should identify which plugin is +of these plugins is vim-nerdtree-tabs [84]. You should identify which plugin is responsible for the issue and report it to the plugin author. Note that when -this happens, ycmd [49] will automatically shut itself down after 30 minutes. +this happens, ycmd [48] will automatically shut itself down after 30 minutes. ------------------------------------------------------------------------------- *youcompleteme-ycm-does-not-work-with-my-anaconda-python-setup* @@ -3726,17 +3609,17 @@ point to the full path of your Anaconda python. Contributor Code of Conduct ~ Please note that this project is released with a Contributor Code of Conduct -[86]. By participating in this project you agree to abide by its terms. +[85]. By participating in this project you agree to abide by its terms. =============================================================================== *youcompleteme-contact* Contact ~ If you have questions about the plugin or need help, please join the Gitter -room [1] or use the ycm-users [79] mailing list. +room [1] or use the ycm-users [78] mailing list. If you have bug reports or feature suggestions, please use the issue tracker -[87]. Before you do, please carefully read CONTRIBUTING.md [62] as this asks +[86]. Before you do, please carefully read CONTRIBUTING.md [61] as this asks for important diagnostics which the team will use to help get you going. The latest version of the plugin is available at @@ -3751,7 +3634,7 @@ YouCompleteMe maintainers directly using the contact details below. *youcompleteme-license* License ~ -This software is licensed under the GPL v3 license [88]. © 2015-2018 +This software is licensed under the GPL v3 license [87]. © 2015-2018 YouCompleteMe contributors =============================================================================== @@ -3775,76 +3658,75 @@ References ~ [15] https://github.com/nsf/gocode [16] https://github.com/Manishearth/godef [17] https://github.com/Microsoft/TypeScript/tree/master/src/server -[18] http://ternjs.net -[19] https://github.com/phildawes/racer -[20] https://github.com/eclipse/eclipse.jdt.ls -[21] http://i.imgur.com/0OP4ood.gif -[22] https://en.wikipedia.org/wiki/Subsequence -[23] https://github.com/scrooloose/syntastic -[24] https://github.com/SirVer/ultisnips/blob/master/doc/UltiSnips.txt -[25] https://github.com/macvim-dev/macvim/releases -[26] https://github.com/VundleVim/Vundle.vim#about -[27] http://brew.sh -[28] https://cmake.org/download/ -[29] http://www.mono-project.com/docs/getting-started/install/mac/ -[30] https://golang.org/doc/install -[31] https://docs.npmjs.com/getting-started/installing-node -[32] https://www.rust-lang.org/ -[33] http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html -[34] https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source -[35] http://www.mono-project.com/docs/getting-started/install/linux/#debian-ubuntu-and-derivatives -[36] http://www.mono-project.com/docs/getting-started/install/linux/#centos-7-fedora-19-and-later-and-derivatives -[37] https://bintray.com/micbou/generic/vim -[38] http://vimhelp.appspot.com/starting.txt.html#vimrc -[39] https://www.python.org/downloads/windows/ -[40] https://www.visualstudio.com/downloads/ -[41] http://stackoverflow.com/questions/6319274/how-do-i-run-msbuild-from-the-command-line-using-windows-sdk-7-1 -[42] https://github.com/tpope/vim-pathogen#pathogenvim -[43] http://llvm.org/releases/download.html -[44] http://www.7-zip.org/download.html -[45] https://pypi.org/project/regex/ -[46] http://www.mono-project.com/docs/getting-started/install/ -[47] http://download.eclipse.org/jdtls/milestones -[48] https://www.unicode.org/glossary/#diacritic -[49] https://github.com/Valloric/ycmd -[50] http://clang.llvm.org/docs/JSONCompilationDatabase.html -[51] https://ninja-build.org/manual.html -[52] https://github.com/rizsotto/Bear -[53] https://raw.githubusercontent.com/Valloric/ycmd/66030cd94299114ae316796f3cad181cac8a007c/.ycm_extra_conf.py -[54] https://github.com/rdnetto/YCM-Generator -[55] https://help.eclipse.org/oxygen/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fproject_description_file.html -[56] https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html -[57] https://docs.gradle.org/current/userguide/tutorial_java_projects.html -[58] https://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.jdt.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fjdt%2Fcore%2FIClasspathEntry.html -[59] https://github.com/Valloric/ycmd/tree/master/ycmd/tests/java/testdata/simple_eclipse_project -[60] https://github.com/Valloric/ycmd/blob/java-language-server/ycmd/tests/java/testdata/simple_maven_project/pom.xml -[61] https://github.com/Valloric/ycmd/tree/master/ycmd/tests/java/testdata/simple_gradle_project -[62] https://github.com/Valloric/YouCompleteMe/blob/master/CONTRIBUTING.md -[63] http://ternjs.net/doc/manual.html#configuration -[64] http://ternjs.net/doc/manual.html#server -[65] http://ternjs.net/doc/manual.html#plugins -[66] https://www.rust-lang.org/downloads.html -[67] https://www.rustup.rs/ -[68] https://www.typescriptlang.org/docs/handbook/tsconfig-json.html -[69] http://eclim.org/ -[70] https://github.com/Valloric/ycmd/blob/master/ycmd/completers/completer.py -[71] https://github.com/Valloric/ListToggle -[72] https://github.com/itchyny/lightline.vim -[73] https://docs.python.org/2/library/re.html#regular-expression-syntax -[74] http://ctags.sourceforge.net/FORMAT -[75] https://github.com/Valloric/YouCompleteMe/issues/18 -[76] http://ctags.sourceforge.net/ -[77] https://github.com/universal-ctags/ctags -[78] https://github.com/Raimondi/delimitMate -[79] https://groups.google.com/forum/?hl=en#!forum/ycm-users -[80] https://github.com/Valloric/YouCompleteMe/issues/593 -[81] https://github.com/Valloric/YouCompleteMe/issues/303 -[82] http://stackoverflow.com/questions/14552348/runtime-error-r6034-in-embedded-python-application/34696022 -[83] https://github.com/vim/vim/issues/717 -[84] https://github.com/vim/vim-win32-installer/blob/a27bbdba9bb87fa0e44c8a00d33d46be936822dd/appveyor.bat#L86-L88 -[85] https://github.com/jistr/vim-nerdtree-tabs -[86] https://github.com/Valloric/YouCompleteMe/blob/master/CODE_OF_CONDUCT.md -[87] https://github.com/Valloric/YouCompleteMe/issues?state=open -[88] http://www.gnu.org/copyleft/gpl.html +[18] https://github.com/phildawes/racer +[19] https://github.com/eclipse/eclipse.jdt.ls +[20] http://i.imgur.com/0OP4ood.gif +[21] https://en.wikipedia.org/wiki/Subsequence +[22] https://github.com/scrooloose/syntastic +[23] https://github.com/SirVer/ultisnips/blob/master/doc/UltiSnips.txt +[24] https://github.com/macvim-dev/macvim/releases +[25] https://github.com/VundleVim/Vundle.vim#about +[26] http://brew.sh +[27] https://cmake.org/download/ +[28] http://www.mono-project.com/docs/getting-started/install/mac/ +[29] https://golang.org/doc/install +[30] https://docs.npmjs.com/getting-started/installing-node +[31] https://www.rust-lang.org/ +[32] http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html +[33] https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source +[34] http://www.mono-project.com/docs/getting-started/install/linux/#debian-ubuntu-and-derivatives +[35] http://www.mono-project.com/docs/getting-started/install/linux/#centos-7-fedora-19-and-later-and-derivatives +[36] https://bintray.com/micbou/generic/vim +[37] http://vimhelp.appspot.com/starting.txt.html#vimrc +[38] https://www.python.org/downloads/windows/ +[39] https://www.visualstudio.com/downloads/ +[40] http://stackoverflow.com/questions/6319274/how-do-i-run-msbuild-from-the-command-line-using-windows-sdk-7-1 +[41] https://github.com/tpope/vim-pathogen#pathogenvim +[42] http://llvm.org/releases/download.html +[43] http://www.7-zip.org/download.html +[44] https://pypi.org/project/regex/ +[45] http://www.mono-project.com/docs/getting-started/install/ +[46] http://download.eclipse.org/jdtls/milestones +[47] https://www.unicode.org/glossary/#diacritic +[48] https://github.com/Valloric/ycmd +[49] http://clang.llvm.org/docs/JSONCompilationDatabase.html +[50] https://ninja-build.org/manual.html +[51] https://github.com/rizsotto/Bear +[52] https://raw.githubusercontent.com/Valloric/ycmd/66030cd94299114ae316796f3cad181cac8a007c/.ycm_extra_conf.py +[53] https://github.com/rdnetto/YCM-Generator +[54] https://help.eclipse.org/oxygen/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fproject_description_file.html +[55] https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html +[56] https://docs.gradle.org/current/userguide/tutorial_java_projects.html +[57] https://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.jdt.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fjdt%2Fcore%2FIClasspathEntry.html +[58] https://github.com/Valloric/ycmd/tree/master/ycmd/tests/java/testdata/simple_eclipse_project +[59] https://github.com/Valloric/ycmd/blob/java-language-server/ycmd/tests/java/testdata/simple_maven_project/pom.xml +[60] https://github.com/Valloric/ycmd/tree/master/ycmd/tests/java/testdata/simple_gradle_project +[61] https://github.com/Valloric/YouCompleteMe/blob/master/CONTRIBUTING.md +[62] https://www.rust-lang.org/downloads.html +[63] https://www.rustup.rs/ +[64] http://ternjs.net +[65] https://github.com/Valloric/YouCompleteMe/wiki/JavaScript-Semantic-Completion-through-Tern +[66] https://code.visualstudio.com/docs/languages/jsconfig +[67] https://www.typescriptlang.org/docs/handbook/tsconfig-json.html +[68] http://eclim.org/ +[69] https://github.com/Valloric/ycmd/blob/master/ycmd/completers/completer.py +[70] https://github.com/Valloric/ListToggle +[71] https://github.com/itchyny/lightline.vim +[72] https://docs.python.org/2/library/re.html#regular-expression-syntax +[73] http://ctags.sourceforge.net/FORMAT +[74] https://github.com/Valloric/YouCompleteMe/issues/18 +[75] http://ctags.sourceforge.net/ +[76] https://github.com/universal-ctags/ctags +[77] https://github.com/Raimondi/delimitMate +[78] https://groups.google.com/forum/?hl=en#!forum/ycm-users +[79] https://github.com/Valloric/YouCompleteMe/issues/593 +[80] https://github.com/Valloric/YouCompleteMe/issues/303 +[81] http://stackoverflow.com/questions/14552348/runtime-error-r6034-in-embedded-python-application/34696022 +[82] https://github.com/vim/vim/issues/717 +[83] https://github.com/vim/vim-win32-installer/blob/a27bbdba9bb87fa0e44c8a00d33d46be936822dd/appveyor.bat#L86-L88 +[84] https://github.com/jistr/vim-nerdtree-tabs +[85] https://github.com/Valloric/YouCompleteMe/blob/master/CODE_OF_CONDUCT.md +[86] https://github.com/Valloric/YouCompleteMe/issues?state=open +[87] http://www.gnu.org/copyleft/gpl.html vim: ft=help diff --git a/python/ycm/buffer.py b/python/ycm/buffer.py index 87b1f1a2..bc24fb32 100644 --- a/python/ycm/buffer.py +++ b/python/ycm/buffer.py @@ -28,7 +28,7 @@ from ycm.diagnostic_interface import DiagnosticInterface DIAGNOSTIC_UI_FILETYPES = { 'cpp', 'cs', 'c', 'objc', 'objcpp', 'cuda', - 'typescript' } + 'javascript', 'typescript' } DIAGNOSTIC_UI_ASYNC_FILETYPES = { 'java' } diff --git a/python/ycm/client/completion_request.py b/python/ycm/client/completion_request.py index c55c72d4..5acefc24 100644 --- a/python/ycm/client/completion_request.py +++ b/python/ycm/client/completion_request.py @@ -40,6 +40,7 @@ class CompletionRequest( BaseRequest ): self._complete_done_hooks = { 'cs': self._OnCompleteDone_Csharp, 'java': self._OnCompleteDone_FixIt, + 'javascript': self._OnCompleteDone_FixIt, 'typescript': self._OnCompleteDone_FixIt, } diff --git a/python/ycm/tests/event_notification_test.py b/python/ycm/tests/event_notification_test.py index a798dc90..ce1450ae 100644 --- a/python/ycm/tests/event_notification_test.py +++ b/python/ycm/tests/event_notification_test.py @@ -107,7 +107,7 @@ def EventNotification_FileReadyToParse_NonDiagnostic_Error_test( def ErrorResponse( *args ): raise ServerError( ERROR_TEXT ) - with MockArbitraryBuffer( 'javascript' ): + with MockArbitraryBuffer( 'some_filetype' ): with MockEventNotification( ErrorResponse ): ycm.OnFileReadyToParse() ok_( ycm.FileParseRequestReady() ) @@ -145,7 +145,7 @@ def EventNotification_FileReadyToParse_NonDiagnostic_Error_NonNative_test( test_utils.VIM_MATCHES = [] test_utils.VIM_SIGNS = [] - with MockArbitraryBuffer( 'javascript' ): + with MockArbitraryBuffer( 'some_filetype' ): with MockEventNotification( None, False ): ycm.OnFileReadyToParse() ycm.HandleFileParseRequest() @@ -176,7 +176,7 @@ def EventNotification_FileReadyToParse_NonDiagnostic_ConfirmExtraConf_test( with patch( 'ycm.client.base_request.BaseRequest.PostDataToHandler', new_callable = ExtendedMock ) as post_data_to_handler: - with MockArbitraryBuffer( 'javascript' ): + with MockArbitraryBuffer( 'some_filetype' ): with MockEventNotification( UnknownExtraConfResponse ): # When the user accepts the extra conf, we load it