VS Code Dynamic Import syntax error statement expected - ecmascript-6

Any idea how to get rid of this warning in VS Code
const loadAnalytics = () => {
import(
/* webpackChunkName: "chunk-analytics" */ './analytics'
).then(page => page.init());
};
"Declaration or Statement expected", the code actually compiles file just annoying to keep seeing this warning in VS code.

Update - November 3, 2017
VS Code 1.14+ fully supports import expressions. You should no longer run into this issue
Original Answer
Import expressions are not supported in VSCode 1.13 but we just added support for them in VScode 1.14. You can try this today in the current insiders builds
If need to stay on 1.13, #Steffen's suggestion about setting "javascript.validate.enable": false is the way to go

Related

SSIS Compilation problems - DirectRowToOutput

Input buffer does not contain a definition for 'DirectRowToOutput0' or likewise for the the other properties below.
Row.DirectRowToOutput0();
Row.ErrorMessage = ex.Message;
Row.DirectRowToFailedValidation();
I had some packages on SSIS package store, and attempted to import them using the Package Import Wizard project. But it had some issues and compilation failed, and completely broke all previous script components so I fished the code out of some backups, and pasted it back into some new script tasks.
'ErrorMessage' I did add to a new output flow and column, but it looks like things don't work that way anymore.
New Script tasks appear to be C# 2012.
What have I missed? Am struggling to find which documentation I should be using, and these version conflicts are really hard to deal with.
Using SSDT 2017.
"DirectRowToOutputX()" means "Provide support for filtering outputs to named output groups". In other words, if you ADD SUPPORT for output filtering, then you get the functionality that you list above. Here's how:
When you configure your Script Component, you need to click Inputs and Outputs, then in the inputs and outputs pane, select the output that you'd like to filter. Then in Common Properties, select ExclusionGroup and set it to some value other than zero. Now go back and edit your script and the Row.DirectRowToOutput0() statement will work. Code example below.
public override void Input0_ProcessInputRow(Input0Buffer Row)
{
bool keepThisRow = ValidateMyRow(Row);
if (keepThisRow)
{
// Get/set Row values, do something useful
Row.DirectRowToOutput0(); // for Output0
}
/* Else do nothing - the row will be filtered OUT of the output if not explicitly
* included
*/
}

Visual Studio sorting JSON properties wrong

I've run into a weird problem with Visual Studio 2017 (Enterprise, version 15.5.2) that I can only replicate on one specific machine. The problem doesn't occur on other development machines.
Given a file foo.resources.json with the following contents:
{
"FooReparatur": "Reparatur",
"FooVerlust": "Verlust",
"FooWema": "Wema"
}
Applying the quick action Sort Properties results in the keys being in the wrong order:
{
"FooReparatur": "Reparatur",
"FooWema": "Wema",
"FooVerlust": "Verlust"
}
The configured language for Visual Studio is English, there is no schema selected for the given file. The configured language for Windows is Estonian, but the sorting order is wrong by that alphabet as well.
I checked for any funny unicode characters or anything similar via a hexdump, but found nothing of the like either. As mentioned before, the file sorts correctly on all other machines.
I've tried disabling all the (default) extensions the installation has, but that doesn't resolve the problem either.
I've looked through most of the settings for both general text editing and the specific file type, but I can't find a setting that could cause this. What could be the issue? How can I debug this further?
This is a property of Estonian collation where 'V' and 'W' are treated as the same character. Hence, the next character that differs will be the significant one. As can be demonstrated by this C# code using .Net.
var words1 = new[] { "FooR", "FooVer", "FooWem" };
var words2 = new[] { "FooR", "FooVa", "FooWb" };
var estonianCultureInfo = new System.Globalization.CultureInfo("et-EE");
var estonianComparer = StringComparer.Create(estonianCultureInfo, false);
var sortedWords = words1.OrderBy(x => x, estonianComparer);
foreach (var word in sortedWords)
{
Console.WriteLine(word);
}
Console.WriteLine("[-----]");
sortedWords = words2.OrderBy(x => x, estonianComparer);
foreach (var word in sortedWords)
{
Console.WriteLine(word);
}
Output:
FooR
FooWem
FooVer
[-----]
FooR
FooVa
FooWb
Try to use this plugin to sort :
https://marketplace.visualstudio.com/items?itemName=richie5um2.vscode-sort-json
If dosn't work, try to install again the visual studio and choose language English to test if it work
Good Chance.

write_rich_text of xlwt returns error

I am using xlwt and the following code returns the error Worksheet object has no attribute write_rich_text Why would that be?
seg1 = ("NOT ", Font1)
seg2 = (str(data['Customer'])[:-1], Font2)
sheet1.write_rich_text(row, 4, (seg1, seg2) , Style1)
Note: I am using xlwt 0.7.5 and I see write_rich_text() defined in worksheet.py file
How are you initializing your sheet1 variable?
Make sure there is a page first:
wb = xlwt.Workbook()
sheet1 = wb.add_sheet('Sheet1')
sheet1.write_rich_text(....)
Also you want to take into consideration that write_rich_text is not included in all versions of xlwt so you might want to make sure that the version of xlwt that you are using is the same version that you verified that actually has write_rich_text. Clearly the version that is imported into your app doesn't know anything about a write_rich_text method.
Thank you Max for the pointer. Yes, I had an older version of xlwt in python27 that didn't have write_rich_text method. Replacing that xlwt with the newer version fixed the issue.

classes imported from conditional compilation not available

I've got some syntax in a project I'm working on that I'm not familiar with:
CONFIG::FLASH_10_1
{
import flash.net.NetStreamAppendBytesAction;
import flash.events.DRMErrorEvent;
import flash.events.DRMStatusEvent;
}
with the following compiler flags
-define CONFIG::LOGGING false -define CONFIG::FLASH_10_1 true -define CONFIG::PLATFORM true -define CONFIG::MOCK false
The class references aren't working when the imports are inside that block and I'm wondering if it's an fb4 vs fb4.5 issue. If I pull them out, all the references work as expected.
This 'peculiar syntax' is referred to as Conditional Compilation, where certain code is compiled only if the Compilation Constant provided is true.
This question shows a different syntax for defining the compilation constants, you may want to try changing that. I will test it and update this answer shortly.
After my testing, I believe that you're doing your compiler flags incorrectly--at least in FB4.5.
-define+=CONFIG::FLASH_10_1,true
or
-define CONFIG::FLASH_10_1,true
The Compilation Constant and its value should be separated by a comma, not a space. The += syntax was shown in some of the examples I saw, and appears to work, I'm not certain what the difference is between the two options.

Entity Framework 4.1 strongly-typed Include doesn't provide IntelliSense?

I've added: using System.Data.Entity;
and now I don't get an error on compilation of this:
var k = db.Countries.Include(e => e.Cities);
but I still have to manually go into the database schema and check the current table correct name and copy-paste/type it in the code.
There is no IntelliSense after I use the period:
var k = db.Countries.Include(e => e.
So, the purpose of all this is questionable since it doesn't really help at all. Typing manually the table name (entity set name) in quotation marks isn't any different than typing it in a lambda expression - except for it is shorter as a string.
Hints?
Seems like your problem will be resolved when you add
using System.Data.Entity;
to top of your page
Seems like the problem is in ReSharper 6 IntelliSense. After turning off ReSharper 6 IntelliSense, the original VS2010 IntelliSense works fine. The bug has been reported.