VS Code 3rd Party Intellisense not working - visual-studio-code

I am using the latest release build of VS Code (1.13.1) and I am having some issues with the IntelliSense when trying to use 3rd party libraries.
My example is using JQuery, I have installed JQuery via NPM and imported this into my main.ts file. according to the VS Code website, the IntelliSense should automatically pick up common libraries and display functions and members that are available to that language, so when I type $ and click the '.' key I should see "ajax" for example. I can get the IntelliSense working by installing the types in NPM (npm install #types/jquery).
Am I doing something wrong that might be stopping the automated process from occuring?
Many thanks
Stuart

Related

Vs-code extension error: This extension is deprecated as it is no longer being maintained

there are problems in this way in some extensions that I have installed.
have you seen this problem ?
When I deleted vs code and uploaded it back, nothing changed.
This is just a way for the authors to explicitly tell that the extension is no longer being maintained (see this github discussion about how it works).
As for the npm extension, in the Details section the authors say:
❗IMPORTANT: This extension has been deprecated. Support for running
npm scripts is now provided by VS Code. You can run npm scripts as
tasks using task auto detection or from the npm scripts explorer.
Basically it means that VSCode supports this functionality out of the box now, and there is no need for an extension to run npm stripts.

When I install SASS with NPM, where is the executable on my computer?

I am developing in Windows 10. I do some of my web development in Eclipse and like to use SASS in developing my CSS. Eclipse needs to access SASS in order to compile the SCSS into CSS.
I went to the SASS website and they give a variety of options for installing SASS. I chose to install it with npm and did so successfully on my C: drive. Now I need to know the name of the SASS executable and where it is on my C: drive so I can point to it in my Eclipse tool builders.
I've tried searching for files containing "sass" in the file name but the Windows search utility is useless: it's been running for hours and most of the file names it finds don't even contain "sass". It finds nothing at all when I search on "sass.exe".
I got it working on my own.
First, I should explain that I was initially using Ruby Sass but that wouldn't work when I tried to use it yesterday for the first time in a few months. I vaguely remember something about Ruby Sass being scheduled for deprecation so maybe that's why it stopped working suddenly? Anyway, I needed it to work again but found the information at the SASS website so vague as to raise more questions than it answered so I posted here.
Insomnia has me up in the middle of the night so I started digging and decided to try the SASS website again. This time, I opted for the "Install Anywhere (standalone)" instructions and grabbed Dart SASS. It wasn't intuitively obvious how to install that either but I searched here at StackOverflow and found this article, which I followed carefully.
I found that for my particular situation, I didn't need to create the two files, style.css and style.scss, and I didn't have to execute the watch command either. However, the syntax of the SASS command for the Eclipse Builder had changed a bit: --sourcemaps=none changed to --no-source-maps and I didn't need the --style parameter at all since the default value for style is exactly what I wanted, namely expanded. By the way, the executable isn't an .exe file, it's sass.bat.
Now my SCSS compiles to CSS cleanly and I'm back in business.

How to use npm packages with ReasonML?

I'm quite experienced with ReactJS and now I'm trying to learn ReasonML. But one thing that I've been struggling to understand, is how to import npm packages with React/Reason.
The instructions on the website are kinda unclear to me (https://reasonml.github.io/guide/javascript/interop/).
So, if I have a React/Reason project and want to use a npm package, how do I do it? How do I import it, using Reason lang?
First off, thanks for the feedback! I'll make sure to get this improved.
Now, to be able to use a javascript library published on npm, you'll need to either find or make some bindings for it, as a bridge between Reason/BuckleScript and JavaScript. Ideally, the bindings you need have already been written (or generated) and published to npm, but in case it hasn't you'll have to write them yourself.
Most readily available bindings are listed in redex, the package index, and will include instructions on how to use it. But if they don't, all you need to do is run npm install --save <package-name>, as usual, then add the package name to the bs-dependencies array in bsconfig.json (see also the BuckleScript manual). Make sure to run bsb -make-world to get the new dependency built, then you should be able to use the modules exported by the bindings directly.
If there are no bindings, and you want to make your own, all you need to do is add the javascript package as normal using npm install --save <pacakge-name>, then just start writing externals. How to do so is described in the BuckleScript manual. You may also find my FFI cheatsheet useful.
Lastly, you're welcome to join us on our Discord where there's lots of friendly people eager to help!

How to install extension for Resharper command-line tools

We're currently using the Resharper command-line tool 2016.3 on our CI build server to inspect code for issues at build time. It's working pretty well but I still have an issue and I can't find any proper documentation on that : how do I install and configure an extension using the command line. For example, I want to add the Cyclomatic complexity extension to my analysis. Documentation said to use the -x switch with the name of the extension (PowerToys.CyclomaticComplexity). The code inspection runs but the complexity warning aren't included in my result file, probably because the extension isn't installed on my build server which make sense. I don't have VS installed on my build machine (and I would prefer not to have to) so how can I install the extension "manually" ?
Thanks
The command line tools in 2016.3 don't currently fully support loading extensions. This comment in the issue tracker has some steps that might be able to support - basically put the .nupkg of the extension in the product folder. YMMV.

Eclipse IDE and Sass

I've recently started using the Eclipse IDE for web development.
In the past when I've used Scout to complie my Sass.
Is there a way in Eclispe to automatically compile my Sass.
Is this the best option - http://www.only10types.com/2012/02/get-eclipse-to-automatically-compile.html
I've tried this but I get a BUILD FAILED becuase of
<apply dest="css" executable="/var/lib/gems/1.9.1/bin/sass">
I realise that executable needs to point to sass on my system but how do I find where sass is on my system?
I posted about this recently here: http://mikekelly.myblog.arts.ac.uk/2015/02/09/sass-with-eclipse-in-os-x/
My post refers to OS X but it should be easy enough to adapt the process to other setups.
Here's the text from my post:
Preparation
1. Make sure Ruby is installed. You’re going to need this as SASS is a ruby app. OS X should have Ruby installed by default. To check, open a terminal window and enter:
ruby -v
This should display the version information, something like:
ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]
If you don’t have Ruby, install it now. Come back once you’ve figured it out.
If you develop using Ruby at times, you are likely to be using RVM to manage different Ruby versions. If you’re using RVM we need to take some precautions. Don’t worry – we don’t need to get rid of RVM. We just need to make sure we install SASS to the system version of Ruby.
Let’s check to see if we have RVM installed:
rvm -v
If we get version information back, then we have RVM. (If we don’t we can just move on to step 2 below.) Let’s see which versions of Ruby we have installed:
rvm list
This should show you a list of Ruby versions, along with info. about which one is the default and which is the current version. We want to install SASS to the OS X default version of Ruby, not the RVM-installed versions, so enter this:
rvm use system
And now check again on our current Ruby version:
ruby -v
OK, if we’re happy that we have Ruby and that we’re using the OS X default Ruby, let’s proceed.
2. Install SASS
Do we have SASS?
sass -v
If that doesn’t return version information, you will need to install SASS:
gem install sass
If you get permission errors, use sudo:
sudo gem install sass
Once you have installed SASS, let’s check on its location:
which sass
That should return:
/usr/bin/sass
If a different path was returned, look again at the information above about RVM.
OK, now that we have SASS installed in the OS X default version of Ruby, we can now switch back to a different version of Ruby via RVM, if required.
Set up a Builder in your Eclipse project
In Eclipse, we’re going to use a Builder to set up SASS auto-compilation.
Ctrl-click on the title of your project in the Explorer view (I’m working on a PHP project in this case, so I’m using the PHP Explorer view.)
Select Properties.
Click on Builders, then on New… to make a new Builder.
Select the Program option and click OK.
Now we can give our Builder a name, e.g. sass.compiler
In the Main tab we need to put in the path to the installed sass application:
/usr/bin/sass
N.B. If you were using SASS with an RVM-installed Ruby, at this point you might have tried putting in something like:
/Users/myusername/.rvm/gems/ruby-2.1.5/bin/sass
However that gives problems as SASS then tries to find required resources but they're not in the path, and so the operation fails with the error:
sass env: ruby_executable_hooks: No such file or director
Hence the need to install SASS into the OS X default version of Ruby.
Now we need to pass the appropriate arguments to SASS, so that it knows what to do and what files to do it with. If we were running SASS from the command line, we would probably do something like this at the start of our development session:
sass --watch sourcefolder:destinationfolder
In a real project that might look something like this:
sass --watch app/sass:public/stylesheets
This is a one-off command which forces compilation of any scss files in app/sass, into css files in public/stylesheets, whenever changes are made to the scss files. However, we want our Builder to trigger the compile process each time we save our scss files, so --watch is inappropriate.
If we enter:
sass --help
we discover that the option we want is --update. Luckily this works just like --watch in that it checks the designated folder recursively – so if we have many folders with scss files, we just specify a common parent folder.
You may have some scss files which you want to include into other scss files, and should not be compiled into their own css files. If that is the case, rename those files with an underscore at the beginning, e.g. rename mixins.scss to _mixins.scss Sass will still recognise those files for inclusion, but won’t compile css equivalents.
In my Arguments field I have this:
--update ${workspace_loc:/project1/htdocs/theme}:${workspace_loc:/project1/htdocs/theme} --sourcemap=none --style compressed
In my case, the scss files are in the same folder as the compiled css files, so my source folder and destination folder are the same. I used the Browse Workspace button in one of the form fields to generate the ${workspace_loc} placeholder values for my source folders and destination folders.
I also added a few more SASS options – one to turn off the generation of .map files, the other to output css in a compressed style.
Under the Build Options tab I have Allocate Console and During auto builds ticked, but nothing else.
Click on OK to finish.
Now, when I edit one of the scss files in my project1/htdocs/theme folder, in the Eclipse console view I see that SASS is doing its work, compiling the scss into css. Success!
Alternative method
Use Webstorm ; )
An easy solution would be to use Eclipse Wild Web Developer:
https://github.com/eclipse/wildwebdeveloper#-get-it-now
The editor will simplify developing with web technologies. Besides automatically compiling SCSS files to CSS files it provides many more features. Check them out, I think you will like them.