Cucumber reference support in VSCode - visual-studio-code

In VsCode I am using Cypress with Cucumber preprocessor.
I have installed Cucumber (Gherkin) Full Support v2.15.2 plugin. The problem is, the lines from feature files are not recognized - not referencing to the code itself.
My feature files are placed under:
app/cypress/e2e/features/**/*.feature
and step definitions are in:
app/cypress/support/step_definitions/**/*.js"
I also tried to edit the settings.js (placed under C:/Users AppData) for cucumber:
{
"cucumberautocomplete.steps": [
"support/step_definitions/**/*.js"
],
"cucumberautocomplete.syncfeatures": "e2e/features/**/*.feature"
}
also tried with full path, e.g. app/cypress/support... but still not working. All lines in feature files are underlined with warning - Unable to find step for "And do something..."

ok, for anyone who is struggling with this issue, this worked for me:
in C:\Users\Username\AppData\Roaming\Code\User\settings.json just put:
{
"cucumberautocomplete.steps": [ "cypress/support/step_definitions/**/*.js"],
"cucumberautocomplete.syncfeatures": "cypress/e2e/features/**/*.feature"
}
change it to your path, but the issue was, I need to use full path including cypress. After that restart VSCode and the referencing works.

Related

Visual studio path configuration on Windows for LEAN theorem prover

I am trying to set up my VS Code environment to work with LEAN the automated theorem prover.
I set up a new project following the tutorial at here and have a file called test.lean, given as follows:
import data.real.basic
I get the following error:
invalid import: data.real.basic
could not resolve import: data.real.basic
The error message suggested I call lean --path, so I did, and obtained:
PS C:\Users\user\lean_test2> lean --path
{
"is_user_leanpkg_path": false,
"leanpkg_path_file": "C:\\Users\\user\\lean_test2\\leanpkg.path",
"path": [
"C:\\Users\\user\\.elan\\toolchains\\leanprover-community--lean---3.35.1\\bin\\..\\library",
"C:\\Users\\user\\.elan\\toolchains\\leanprover-community--lean---3.35.1\\bin\\..\\lib\\lean\\library",
"C:\\Users\\user\\lean_test2\\_target/deps/mathlib/src",
"C:\\Users\\user\\lean_test2\\./src"
]
}
I noticed the paths use a mix of / and \\, but I don't think this will be a problem. I checked the third entry in the paths list, and found that the following file
C:\Users\user\lean_test2\_target\deps\mathlib\src\data\real\basic.lean
does indeed exist. So, what might be going wrong?
I don't know exactly what the problem is, but you should usually either use the "open folder" feature in VScode to open the folder containing mathlib or open the folder containing a project depending on mathlib. There's also a leanproject global-install command you can use to globally install mathlib without having to open a folder in VScode, but I've never used this command myself.

My TailWind CSS Intellisense plugin just isn't working on my VSCode

So the description of the plugin is that it'll display suggestions of classes when am working on the markup, but it doesn't. I've reloaded the plugin countless times. I even restarted vscode and eventually re-installed it.
Of course, I did the npm install tailwind and other utilities needed... I even have my tailwind.config.js file in my project if that helps to answer my question. Thank you.
I'm using tailwindcss in a react app. Tailwindcss Intellisense plugin was not working in my VSCode but then i installed HTML CSS Support extension and now i am getting suggestions of classes.
HTML CSS Support
Its actually a pretty simple fix. open your settings.json file then add this to get the intellisense working on all files
"tailwindCSS.includeLanguages": {
"html": "html",
"javascript": "javascript",
"css": "css"
},
"editor.quickSuggestions": {
"strings": true
}
To fix this issue try using ctrl + space
This is the easiest way I found to get Tailwind IntelliSense to work with .js files to React. You need to do this every time you are adding a new class but it's quicker than checking the documentation every time.
Credit: Reddit
What helped me was to check whether the plugin had any issue loading. You can do this by checking the output view:
CTRL + SHIFT + P to bring up the command palette
Search for "Output: Focus on Output View"
In the Output View, search for tailwindcss-intellisense
For me the error was
Failed to initialise: ReferenceError: defaultTheme is not defined - I was missing a require for the defaultTheme.
for me..
I installed 'IntelliSense for CSS class names in HTML', 'HTML CSS Support', 'CSS Peek' all together with reinstalling..
It works now.
To anyone still facing this problem, I found that the tailwind extension doesn't recognize your tailwind.config.js file if it's untracked (not added to source control). Once I added the file and did git commit, the extension worked.
if you're using nuxt/tailwind module be sure to init tailwind.config.js as doc says.
npx tailwindcss init
then restart the vs-code. it should automatically be active.
I'm using tailwind + create-react-app + typescript, I solved it by changing the extension setting "Tailwind CSS: Include Languages", to {"plaintext": "ts"}.
I don't know why it didn't work in the first place, it was working for my other projects.
Just go to the
Tailwind CSS IntelliSense
extension in Vs code
and install the old version and reload it.
It works.
This is the solution for autosuggestion on typing. So you don't need to use space+ctrl or just space. In case anyone needs it.
editor.suggest.snippetsPreventQuickSuggestions: false
Without pressing ctrl-space, I just need to press space and the classes will come out.
I am using Tailwindcss with Django.
Facing the same issue where Tailwindcss IntelliSense plugin is already installed and autocomplete wasn't working.
Finally I got the perfect solution.
For most projects (and to take advantage of Tailwind’s customization features), you’ll want to install Tailwind and its peer-dependencies via npm.
npm install -D tailwindcss#latest postcss#latest autoprefixer#latest
In my case the postcss and autoprefixer was not installed.
You can run the above command and npm will take care of it if you have Tailwindcss already installed.
Also don't forget to put these lines in your settings.json in VSCode (Recommended VS Code Settings for Tailwind CSS IntelliSense):
// VS Code has built-in CSS validation which may display errors when using Tailwind-specific syntax, such as #apply. You can disable this with the css.validate setting
"css.validate": false,
// By default VS Code will not trigger completions when editing "string" content, for example within JSX attribute values. Updating the editor.quickSuggestions setting may improve your experience:
"editor.quickSuggestions": {
"strings": true
},
// This setting allows you to add additional language support. The key of each entry is the new language ID and the value is any one of the extensions built-in languages, depending on how you want the new language to be treated (e.g. html, css, or javascript):
"tailwindCSS.includeLanguages": {
"plaintext": "django-html"
},
I disabled and re-enabled the plugin. Wait a bit for it to re-indexing. And it works.
I fixed it by creating a tailwind.config.js file with the help of npx tailwindcss init command. I was following tutorials of net ninja (youtube channel) and he mentioned this solution.
If you are using tailwind with react, typescript, javascript, styled-components, and twin-macro, you have to add classRegEx manually to get the IntelliSense
To achieve this edit the user settings as below
"tailwindCSS.experimental.classRegex": [
"tw`([^`]*)",
["classnames\\(([^)]*)\\)", "'([^']*)'"]
],
For more information and to see what classRegEx should use with other techs read this
This setting is good working for react.js application
{
"tailwindCSS.experimental.classRegex": [
"class:\\s*\"([^\"]*)\""
],
"emmet.triggerExpansionOnTab": true,
"tailwindCSS.emmetCompletions": true,
"editor.quickSuggestions": {
"strings": true
}
}
Update VS Code
I had the same issue I just fixed it by updating VS Code.
At first, write in your project npm install tailwindcss postcss-cli autoprefixer, Then write in your terminal npx tailwind init, at last write npm tailwind"postcss.config.js and then write in the file:
module.export = { plugins: [require('tailwindcss'), require('autoprefixer')]};
last step u can build your tailwindcss in packagein accordance with the package.json.
For more info u can visited this link.
Running Tailwind CSS: Show Output from View -> Command Palette (or Ctrl + Shift + P), as suggested here, unveils that the "Tailwind CSS IntelliSense" plugin is looking for a proper npm installation of the module tailwindcss.
Solution: We can therefore fix the issue by simply running
npm install tailwindcss
within our project directory.
Make sure that you open the project from its root folder. I happened to me that there were multiple package.json files in the a different folder, the VS code plugin will be confused with tailwindcss path.
Just open the Explorer view and you should see one and only one package.json file and tailwindcss is listed as the dependencies.
For React project with .tsx file, adding this works for me.
// .vscode/settings.json
{
"tailwindCSS.includeLanguages": {
"typescriptreact": "html"
}
}
Credit: https://github.com/tailwindlabs/tailwindcss-intellisense/issues/72#issuecomment-674386396
for me helps installed plugin IntelliSense for CSS class names in HTML
Rails erb - Custom class name completion contexts
Add to settings (ctrl + shift + p)
"tailwindCSS.experimental.classRegex": [
"class:\\s*\"([^\"]*)\""
]
See github issue reply
I did Smit #Barmase solution but also added "plaintext" and "tsx".
Now everything works when I hit space after previous class.
In my case, the code completion not working without the start tag >.
Not work:
<div class=""
Work:
<div class="">
My best practice
Strictly speaking, it doesn't work without the start tag >. But My best practice is to write the closing tag and then write the class.
First write:
<div class=""></div>
Second write:
<div class="w-10"></div>
I solved the problem only by deleting the space between the equal sign and and quote.
So instead of writing className= "tailwind classes..." write className="tailwind classes...". I hope that this answer will help.
Had the same issue with Intellisense, the output in VSCode for the "TailWind CSS IntelliSense" had
[Error - 1:36:36 PM] Tailwind CSS: Cannot set property 'parent' of undefined
TypeError: Cannot set property 'parent' of undefined
This seemed to be coming from the postcss-nested plugin, however after reading a few other SO posts on the similar issue it actually came down to my setup.
The main project folder was failing to parse a file that existed inside a sub-project (td;lr. using a wordpress theme git repo that is build with the template as the root).
Since the original setup to process the TailWind wasn't needed, I noticed that the root project was TailWind v3, while the sub-project was TailWind v2. After removing the base package.json dependancies Intellisense kicked in picked up the [sub-project] tailwind config, postcss and tailwind version.
Not sure if that might be similar to your setup, but what is suggested is checking the package versions, and that your tailwind config files (if any) are setup right.
The moment you fix it, you should immediately be able to see in the Output tab for "TailWind CSS IntelliSense" something similar to the following....
Found Tailwind CSS config file: /.../tailwind.config.js
Loaded postcss v8.3.0: /.../node_modules/postcss
Loaded tailwindcss v2.2.0: /..../node_modules/tailwindcss
Hope there's something you can take away from this. :)
The extension HTML CSS Support extension is not the correct way to go. As specified in the official installation section of the detail page in the extension page in VSC.
In order for the extension to activate you must have tailwindcss installed and a Tailwind config file named tailwind.config.js or tailwind.config.cjs in your workspace.
so adding a file (even empty) named tailwind.config.js or tailwind.config.cjs at the root of your app will make it work.
My issue was with the tailwind.config.js. Since I followed the Tailwind installation step by step, I put the content as
content: ["./src/**/*.{html,js}"]
While I had no src folder, rather my html file was at the root. So I changed it to below and the IntelliSense started working.
content: ["/*.{html,js}"]
So just in case someone is making this silly mistake like me :)
How to get it working with denoland's Fresh framework
Check that the extension is not loading by opening the OUTPUT tab of the console and verifying that the dropdown menu has an entry for Tailwind CSS IntelliSense.
If it does not figure there you need to make a blank tailwind.config.js file at the root directory.
This file is completely redundant with Deno, but required by the extension.
If it still does not help, try other methods shown in this thread. With the extension loading latest version of it does work on with setup.

WebdriverIO autocomplete in VSCODE

I am wonder, if it is way how to enable autocompletion for WDIO global variables ( $, $$, browser ) in VSCode. I know, that wdio has support for Webstorm, but it doesn't work for VSCode.
Any idea, how to use autocompletion in VSCode? Without it is pretty hard to create some tests.
I struggled with this as well. Firstly, ensure you've followed the "Autocompletion" Setup described on the website; for example, they require something like the following exist in a file called jsconfig.json at the root of your project:
{
"include": [
"**/*.js",
"**/*.json",
"node_modules/#wdio/sync",
"node_modules/#wdio/mocha-framework"
]
}
You may already have a jsconfig.json; if so, ensure that the node_modules directories are not in a section called "exclude": { ... }. When setting up other things like Babel (for mocha) this may get installed as a default configuration entry. When node_modules is in both include and exclude, exclude takes precedence.
I had zero success importing npm #types pacakges, adding typeAcquisition: {} to jsconfig.json, or adding interface browser; into the file global.d.ts as other people have suggested in various forums.
Auto completion is pre-installed on vs code. If it is not working you might want to check through extension and install. And to use, once the open tag is created, it often auto suggest, just do appropriately then input your attribute.

Error detecting icon when publishing VSCode extension

I'm putting together a VSCode extension and I've already packaged up the .vsix file a few times with no issue.
However, I've just added "icon": "images/icon.png" to the package.json and started getting an error message I just can't shake:
Error: The specified icon 'extension/images/icon.png' wasn't found in the extension.
The file definitely exists (though I don't quite understand why it looks for it under extension as a hardcoded value).
I've tried setting the baseImagesUrl in the command line for packaging, but it seems to have made no difference.
Any help/insight here would be appreciated :)
It turns out the default .vscodeignore file that is dropped when you generate the extension boiler plate code has the images/** file ignored. That stops the vsix package command from pulling the icon into the package and it won't find it.
Hope this helps someone else!
I had a similar problem, but it came down to the fact that the package.json had trouble with a leading forward slash. I am on windows, and was using "./" to prefix local resources in the README.md. I thought this would also work in the package.json for the icon field, but it doesn't. I removed the ./ and it started working find. It doesn't recognize either "./" or "/" BTW.
I saved my icon with the name "icon.PNG" in the "images" folder and
in my package.json I used "icon": "images/icon.png". It worked fine for me in the past but now I had to change it to "icon": "images/icon.PNG" (case sensitive!).
I faced the same problem too.. I just renamed my icon from "Dark Icon 250.png" to "icon.png" and re-started vscode and vsce package worked.

Lost validation and autocomplete when upgrading to February release

It seems something is wrong with my installation (osx 10.11.3) but I can't determine why and i'm not sure how it worked prior to the February release of vs code.
For example:
var express = require('express'),
app = express();
app.post('/upload', function (req, res) {
//Some code
}
if I replace app.post with app.FOO it won't signal that there is an error and that foo is unknown. Also I don't get auto complete for 'post' after app.
Furthermore I don't get any light bulb that would allow to download the definitions from typescript to get auto complete.
What could cause this issue ?
(this is for Vs CODE, not standard vs)
Edit: also noticed this: when on a js file, when I change file type to let's say CSS, it will show all the errors of course because it's not a CSS file. When I revert back file type to js.... it will still show the errors of CSS ??!! I think this is a bug in the latest update. See attached image.
Edit: I manually added in project root a jsonfing.json file with:
{
"compilerOptions": {
"target": "ES6"
}
}
and I added a 'typings' folder in project root, with node, pg and express typings files.
I faced a similar issue it seems vscode team has removed the quick fix for type definitions in the release. We have to add the d.ts using below plugin
https://github.com/typings/typings
once you installed the typings for the library you wanted, you need to create a jsconfig.json file. Steps below
https://code.visualstudio.com/docs/languages/javascript#_javascript-projects-jsconfigjson
[note: i left this file empty]
Now the vs automatically loads the d.ts files if it is under typings directory
Below is the issue that I created in Github
https://github.com/Microsoft/vscode/issues/3867
Hope this helps
OK, I was able to reproduce this bug, seems like now you have to set up project with jsconfig.json and explicitly add excluded folders. Example jsconfig.json
{
"compilerOptions": {
"target": "ES5",
"module": "commonjs"
},
"exclude": [
"node_modules"
]
}
Also don't forget to "Reload Javascript Project".
More details https://github.com/Microsoft/vscode/issues/3901 and https://github.com/Microsoft/vscode/issues/3791