Error detecting icon when publishing VSCode extension - visual-studio-code

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.

Related

Visual Studio Code debug mode issue

I'm sorry to bother , I don't know if I can ask this
Visual Studio Code, suddenly can't use debug mode to set interrupts to test.
It seems that it is talking about the folder name problem, but after accessing the folder, it will not be renamed. How can I solve it now? I can't upload photos so I'm capturing the important parts.
i.e.: the module "queue" could not be imported because it is shadowed by:
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/queue/__init__.pyc
Please rename this file/folder so that the original module from the standard library can be imported.
Not sure how to change folder name or duplicate name, these actions are forbidden after accessing the folder, or is this some other problem?
This looks like an actual issue in VSCode - https://github.com/microsoft/debugpy/issues/886
In case you're using python 2.7, Downgrading the python VSCode extension should help.

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.

'${workspaceFolder}' can not be resolved. Please open a folder.' on Visual Studio Code

wondering if you could assist. Really challenging in determining a solution to this from my research.
Ive downloaded Visual Studio code two weeks ago and has come across an error once I try to debug a file. The file appears to open but once I run the debugger it shows accordingly:
'${workspaceFolder}' can not be resolved. Please open a folder.
Can't seem to find or replicate a similar solution. I've also tried to reinstall Visual Studio code (no easy feat). I'm trying to at least understand the problem and its source.
The file is a .js file that I've been working on, running a simple function. It is not meant to operate in tandem with a larger workspace/program.
In VScode go to file --> Add folder to workspace and select the folder where the program files are located.
If you are using the latest Visual Studio 1.44, make sure to upgrade to 1.44.2.
The issue microsoft/vscode issue 94725 has been resolved.
It featured the same error message:
After some investigation the problem is the following for the workspace configuration our debug extensions appends the following attribute
__workspaceFolder:'${workspaceFolder}'
And the configuration resolver properly tries to resolve this and complains because the scope of the folder is not specified.
In a multi root workspace scope has to be specified, otherwise the resolver does not know against which folder to resolve the variables.
Proposed fix: the node extension which adds this attribute should scope it if it sees that we are in a multi root folder.
So instead of ${workspaceFolder} use ${FOLDER_NAME:workspaceFolder}.
This is fixed in commit ae97613.
Replace ${workspaceFolder} with ${FOLDER_NAME:workspaceFolder} in your *.code-workspace file. (from [here][1])
By the way, same goes to ${workspaceRoot}, you can replace it with ${FOLDER_NAME:workspaceRoot}.
Any more folder variables ca be fixed with this FOLDER_NAME: prefix? My workspaces did not use them so far.
Worked for me in Version: 1.44.2.
I know this question is very old already and the answers may have been correct but none worked for me on vscode v1.57.1 at the time of this comment on 30.06.2021
I had to replace ${workspaceFolder} with ${workspaceFolder:my-folder-name} in my *.code-workspace file
Ref: Variables scoped per workspace folder
I recently had this problem and so did I read the answers above but being a beginner I was unable to solve it .In my answer I don't have exactly what you should do but I will show what worked for me.
Go to the explorer and you will see there is no folder added.
Browse for .vscode folder and select it.
Issue solved {this atleast worked for me.It**(.vscode)** had .json extension file in it}.
I was having the same issue, but I solved it this way:
1- open VS Code as administrator
2- open the sheet
3- debugging with no problem :)
enter image description here
I just create a file.json that they can debug.

Ionicons: How to add custom icons

I want to add some SVG icons to the default Ionicons set.
I'm following these steps to build them from the source without success:
Put my svg icon in src/: src/my-icon.svg
Edit my manifest file with a custom prefix "prefix": "my-",
Run, python ./builder/generate.py
ionicons.svg appear to be modified but it's not changed.
What am I doing wrong?
I would recommended you take a look at this excellent article by Omar Wazir, his instructions worked out great for me. In short, he tells you to install all the dependencies, get Ionicons, put your custom icon in the /src/ folder and to run python ./builder/generate.py after which he tells you to move some files to these folders:
ionicons\css -> <ionicApp>/www/lib/ionic/css/
ionicons\fonts -> <ionicApp>/www/lib/ionic/fonts/
ionicons\scss -> <ionicApp>/www/lib/ionic/scss/ionicons/
Also when you run the python ./builder/generate.py command, it should tell you that the script has found a new icon. Perhaps this information can help you solve your problem.

lexical or preprocessor issue file not found occurs while archiving?

I am new to this iPhone development and i have almost completed my first application but when i try for creating an archive it gives an error lexical or preprocessed issue file not found But it runs fine in simulator and also has also tested on device. I have included SDwebimage architecture for lazy loading of image in table view.Can any tell me what is the issue?
Few things to try, Ensure the Framework and all it's headers are imported into your project properly.
Also in your Build Settings set YES to Always search user paths, and make sure your User header paths are pointing to the Framework.
Finally, Build->Clean and Restart Xcode.
Hope this helps !
UPDATE: According to SDWebImage's installation, it's required you make a modification to Header Search Path and not User header paths, As seen below.
Have you done this as well? I suggest slowly, re-doing all the installation steps from the beginning.
Spaces in a folder name in your header search path can cause this problem. Make sure the folders in your project do not have spaces in their names.
My project was building fine until I updated to Xcode 10.1. After the Xcode update, started getting Lexical or preprocessor Issue errors on build. Some XCDataModel header files could not be found.
This fixed the issue.
Go to Build Settings, Header Search Paths
Change the appropriate value from $(SRCROOT) non-recursive to recursive.
This ensures that subfolders are also searched for headers during build.
I had this same issue now and found that my sub-projects 'Public Header Folder Path' was set to an incorrect path (when compared with what my main project was using as its 'Header Search Path' and 'User Header Search Path').
e.g.
My main project had the following:
Header Search Paths
Debug "build/Debug-iphoneos/../../Headers"
Release "build/Debug-iphoneos/../../Headers"
And the same for the User Header Search Paths
Whereas my sub-project (dependency) had the following:
Public Header Folder Path
Debug "include/BoxSDK"
Release "include/BoxSDK"
Changing the 'Public Header Folder Path' to "../../Headers/BoxSDK" fixed the problem since the main project was already searching that folder ('../../Headers').
PS: I took some good screenshots, but I am not allowed to post an answer with images until I hit reputation 10 :(
I had this problem after changed project name. I used all the methods mentioned on the internet but still doesn't work. Then I realized that all the header files not found was from cocoapods, so I re-installed the cocoapods using pod install, and thus solved the problem.
Hope this could help.
In my case I was developing a framework and had a test application inside it, what was missing is inside the test application target -> build settings -> Framework Search Paths:
The value needed to be the framework path (the build output - .framework) which is in my case:
"../FrameworkNameFolder/" - the 2 points indicates to go one folder up.
Also, inside the test application target -> Build Phases -> Link Binary With Libraries:
I had to remove the framework file, clean the project, add the framework file again, compile and this also solved the issue.
The new version contain fix for this, feel free to update.
Or you can just replace
#include "iPhone_View.h"
with
#if UNITY_VERSION < 450
#include "iPhone_View.h"
#endif
Delete the unit testing from your project follow the below steps this will solve the issue.
select your project from the project navigator to open the project editor. From the target delete the test from the left side of the project editor and press the Delete key.
I know this is old, but I'm gonna chime in anyway because it may be useful to someone. If you can still see the file in Finder, then click on the file in your project and delete it, selecting "remove references" and not "move to trash".
Once the reference is removed, drag and drop the file from finder into your project again and it should sort itself out.
Just adding another thing that worked for me :
react-native link
Evidently my ReactNative files were no longer there. I could figure that out by clicking on
Build Phases -> Link Binary with Libraries ->
Then right clicking a file I knew was responsible for React, and clicking Show In Finder .
But nothing opened. So assuming the library went missing, I just ran the above command which relinked everything again.
Also if you havn't, try :
rm -rf node_modules/ && npm install
This happened to me after I renamed a file. For some reason it was still looking for the file with the old name. What I did was create the file that it was complaining about and added to the project. Then I did a Project->clean, then Project->Build and verified the error was gone. Then I selected the newly added files and deleted them. This removed all references and I no longer see the error.
I fixed mine. The fb sdk downloaded (from my browser) as 'FacebookSDKs-iOS-4.22.0' -- I just had to rename the folder to FacebookSDK. So now in Build
Settings --> Framework Search Paths
the path looks something like /Users/.../Documents/FacebookSDK (where as before it was /Users/.../Documents/FacebookSDKs-iOS-4.22.0)
Hope this helps!
For what it's worth, my problem was completely unrelated to the error Xcode was giving. I stumbled onto a solution by deleting the .h reference, compiling, adding the reference back and compiling again. The actual error then became evident.