From dd3e67b1b7493096132caa262aac202134ff4432 Mon Sep 17 00:00:00 2001 From: Gleb Bahmutov Date: Tue, 3 Sep 2019 16:10:16 -0400 Subject: [PATCH 1/2] add jsconfig section --- .../guides/tooling/intelligent-code-completion.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/source/guides/tooling/intelligent-code-completion.md b/source/guides/tooling/intelligent-code-completion.md index 1dae31fed9..3c1e6728ee 100644 --- a/source/guides/tooling/intelligent-code-completion.md +++ b/source/guides/tooling/intelligent-code-completion.md @@ -50,6 +50,21 @@ See the {% url `cypress-example-todomvc` https://github.com/cypress-io/cypress-e If the triple slash directive does not work, please refer to your code editor in {% url "TypeScript's Editor Support doc" https://github.com/Microsoft/TypeScript/wiki/TypeScript-Editor-Support %} and follow the instructions for your IDE to get {% url "TypeScript support" typescript-support %} and intelligent code completion configured in your developer environment first. TypeScript support is built in for {% url "Visual Studio Code" https://code.visualstudio.com/ %}, {% url "Visual Studio" https://www.visualstudio.com/ %}, and {% url "WebStorm" https://www.jetbrains.com/webstorm/ %} - all other editors require extra setup. +### Reference type declarations via `jsconfig` + +Instead of adding triple slash directives to each JavaScript spec files, some IDEs (like VSCode) understand a common `jsconfig.json` file placed in the root of the repository. In that file include Cypress module and your test folders. + +```json +{ + "include": [ + "./node_modules/cypress", + "cypress/**/*.js" + ] +} +``` + +The Intelligent Code Completion should now show help for `cy` commands inside regular JavaScript spec files. + ### Reference type declarations via `tsconfig` Adding a {% url "`tsconfig.json`" http://www.typescriptlang.org/docs/handbook/tsconfig-json.html %} inside your {% url "`cypress` folder" writing-and-organizing-tests#Folder-Structure %} with the following configuration should get intelligent code completion working. From d3d9ca361b126fcba13aceecf92df46d5507ff80 Mon Sep 17 00:00:00 2001 From: Jennifer Shehane Date: Mon, 9 Sep 2019 14:38:43 -0400 Subject: [PATCH 2/2] VS Code, minor grammar --- .textlintrc | 1 + source/guides/tooling/intelligent-code-completion.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.textlintrc b/.textlintrc index 060d892e1d..ffee7ed36e 100644 --- a/.textlintrc +++ b/.textlintrc @@ -54,6 +54,7 @@ "Sinon–Chai", "TypeScript", "YouTube", + ["VSCode", "VS Code"], ["^Vue", "Vue.JS"], "webpack", ["WebSocket(s?)", "WebSocket$1"], diff --git a/source/guides/tooling/intelligent-code-completion.md b/source/guides/tooling/intelligent-code-completion.md index 3c1e6728ee..4e041ec0f2 100644 --- a/source/guides/tooling/intelligent-code-completion.md +++ b/source/guides/tooling/intelligent-code-completion.md @@ -52,7 +52,7 @@ If the triple slash directive does not work, please refer to your code editor in ### Reference type declarations via `jsconfig` -Instead of adding triple slash directives to each JavaScript spec files, some IDEs (like VSCode) understand a common `jsconfig.json` file placed in the root of the repository. In that file include Cypress module and your test folders. +Instead of adding triple slash directives to each JavaScript spec file, some IDEs (like VS Code) understand a common `jsconfig.json` file in the root of the project. In that file, you can include the Cypress module and your test folders. ```json {