How do I compile Elm code within Visual Studio Code?
I am currently using Ctrl + F5 to compile my code.
However, I am not sure why I am NOT receiving any compilation errors based on the code I have below:
I expect an error reflecting "blah" not being defined.
NOTE:
I am attempting to learn Elm and VS Code.
Hence, all of this is new to me.
Related
I'm using Live Sass Compiler v3.0.0 in my VS Code and it throws a compilation error whenever I use the #use rule to import variables from another file. However, when I use the Sass command line interface (sass --watch) to compile my files, it throws no errors.
Therefore, I want to ask is this caused by a syntax error in my code or a bug of Live Sass Compiler.
Steps to Reproduce
File Structure & Code
This is the file structure of the folder called sass-test that I opened in VS Code:
sass-test
| style.scss
| _variables.scss
style.scss
#use "variables";
html {
color: variables.$primaryColor;
}
_variables.scss
$primaryColor: #ff0000;
Live Sass Compiler Output
Open style.scss in a new tab in VS Code. Then, click the "Watch Sass" button located in the bottom right of the window. Live Sass Compiler would output the following error:
Compiling Sass/Scss Files:
d:\Web Development\sass-test\style.scss
--------------------
Compilation Error
Error: Invalid CSS after " color: variables": expected expression (e.g. 1px, bold), was ".$primaryColor;"
on line 4 of sass/d:\Web Development\sass-test\style.scss
>> color: variables.$primaryColor;
------------------^
--------------------
Watching...
-------------------
Sass CLI Output
Open Terminal and run sass --watch style.scss:style.css. The compiler successfully compiles without any errors:
Compiled style.scss to style.css.
Sass is watching for changes. Press Ctrl-C to stop.
Since my code can compile successfully with Sass CLI, does it mean that my code is syntactically correct and it's caused by a bug from the Live Sass Compiler extension?
I had same/similar problem two days ago.
#use is a new directive introduced in the new official Version 'Dart Sass' and replaces '#import' which is depricated now.
The popular Extension 'Live Sass Compiler' in VS Code is not longer supported by the maintainer for some time. So unfortunately the Sass Version is not updated in that extension...
In VS Code for 'Dart Sass' I found the the Extension 'DartJS Sass Compiler':
https://marketplace.visualstudio.com/items?itemName=codelios.dartsass
Actual I just did a quick testing so I cannot report much about it. But on the first glance it is running well. But as it is another extension you may have to change some settings.
UPDATE
Additional to the above reported exentsion DartJS Sass Compiler with actual SASS version I found an actualised and actual maintained fork of Live Sass Compiler. It has been deep hidden in the searching reuslts. As it is a very popular extension in VS Code here the link to the fork:
https://marketplace.visualstudio.com/items?itemName=glenn2223.live-sass
Remark:
I played arround with both extension. Both are doing the job well and have advantages.
'DartJS Sass Compiler' has the additional possibility for more detailed output like information about sass version and watchers. And additional to included SASS version it allows to use your own SASS version if installed to your system or locally to your project. So there is no/less dependency on updates by the maintainer.
'Live Sass Compiler' runs out of the box with included sass version. As it is a very popular extension in VS Code there is a special advantage: it seems it keeps your settings in the old projects running.
I think both are good solutions.
I'm playing around with typescript in an existing coffeescript project that uses gulp and webpack.
I noticed when there's a syntax error in the coffeescript, it will fail the gulp task and not continue with the following steps, which is the desired behavior. With the typescript loader I'm using (ts-loader), I can see error messages in the terminal, but the webpack task succeeds from gulp's perspective and continues on. I imagine this is a difference in how the coffeescript loader and the typescript loader handle errors.
For example, I can add the following typescript file:
function greet(name: string) {
return 'Hello '+name;
}
export = greet;
{
and see the error in the build:
ERROR in ./bin/arranged/webkit/hcube/dummy.ts
(8,1): error TS1005: '}' expected.
but it still continues with the rest of the build like webpack didn't return any errors.
I realize that unlike coffeescript, typescript has a lot of inter-file dependencies, which makes the ts-loader much more complex, but I feel like it should still be failing at some point. Running the typescript compiler on the command line returns the expected exit code when there are syntax errors, so I feel like the problem lies in the loader itself.
In the after-compile plugin of ts-loader should it be reporting errors to webpack differently to propogate up? Right now it looks like it just attaches the errors to webpack in the after-compile plugin and webpack just keeps on trucking (see https://github.com/TypeStrong/ts-loader/blob/master/index.ts#L398). Should the loader be raising an error in this plugin if errors are encountered? Or calling the callback differently? Or should this be handled in some other part of the loader? Again, this particular example is a syntax error, so I imagine it would be caught/raised before after-compile is executed.
I have VB project, which is compiling/building perfectly using vb6 IDE in XP mode.
My objective is to automate the deployment process, so am trying to build this project in command line using VBC.
But while compiling vb project in window 7 using VBC.exe and cmd its throwing following error/exception.
Example:
error: BC30203: Identifier expected.
error: BC30481:'class' statement must end with matching end class.
error: BC30617:'Module' statement can occur only at file or namespace level.
Does anybody have any suggestion ideas what am missing here.
Thanks in advance.
I´m trying to get a simple TypeScript file working in PHPStorm, but sadly there seem to be some misconfiguration by default as the class keyword is not recognized properly
This is my TypeScript file:
class Test{
}
And this is the error I´m facing:
And this is my FieWatcher configuration of TypeScript
How can I get TypeScript working?
The Program options should not be node.exe (that would mean you are trying to typescript code as javascript). It needs to be tsc or node tsc(that means you want to run tsc to compile the file to javascript).
PS: this video might be helpful : https://www.youtube.com/watch?v=RWXGMug_Rmo&hd=1
I am using the Dart plugin for Eclipse (not the standalone Dart Editor).
How do I configure the project/build so that static type warnings appear as errors in the Eclipse "Problems" tab? For example, this line of code actually compiles, which seems ludicrous:
int newtodo = new LIElement();
Running dartanalyzer at the command line gives an error, as desired:
dartanalyzer foo.dart
But instead of having to run dartanalyzer at the command line (or discovering them at runtime), I would like to have these errors reported on-the-fly in Eclipse.
If this doesn't produce a warning this is a bug according to this discussion new user question. type warnings as errors in Eclipse
(Also initiated from #Justin M. Keyes)