Zara  Bryant

Zara Bryant

1622103013

Enhancing the JavaScript Experience in Visual Studio | OD554

Creating SPA Applications with JavaScript in Visual Studio is changing and for the better! This new experience brings in tooling and features that will make enhance your JavaScript development, even while you are working in .NET/.NET Core solutions. Come take a look at how Visual Studio is working to bring you the best JavaScript development experience possible.

Explore Deeper Content and Training – https://aka.ms/learnatbuild

Microsoft Build 2021

#javascript #vscode

What is GEEK

Buddha Community

Enhancing the JavaScript Experience in Visual Studio | OD554
Juanita  Apio

Juanita Apio

1618243440

[Guest post] Learn C# with Visual Studio, Visual Studio for Mac, and Unity

UPDATE: The book giveaway challenge is complete. We will be announcing winners on the Visual Studio blog within the next week. Thank you for your submissions!

Visual Studio is an amazing development tool. But Visual Studio and Visual Studio for Mac are more than just intuitive, state-of-the-art development environments. They’re also remarkably powerful learning and exploration tools, with features to help you create and understand your code. I love teaching and learning about C## with Visual Studio. That’s why my co-author, Jenny Greene, and I put Visual Studio and Visual Studio for Mac right at the center of our latest book, _Head First C# _(4th edition), published by O’Reilly Media. _Head First C# _incorporates Visual Studio directly in the learning. combining Visual Studio with the unique and innovative “brain-friendly” Head First approach to teaching helps us make learning C## easier and more fun for our readers.

#visual studio #c# #unity #visual studio 2019 for mac #visual studio for mac

Brain  Crist

Brain Crist

1597014000

JavaScript Unit Testing with Visual Studio

Mark Michaelis walks you through the Visual Studio tooling and project setup you’ll need to get the most out of your JavaScript unit testing.

As I detailed in my recent article “A TypeScript Primer,” I, like many developers, have a love/hate relationship with JavaScript. I love JavaScript because of its ubiquity; from iPhone to Android to Windows Phone, JavaScript just works. From iOS to UNIX to Windows, JavaScript continues to just work. (Admittedly, there are some idiosyncrasies, but for the most part – at least from a language perspective – it just works.)

Unfortunately, JavaScript is lacking in its ability to verify intent. It does what you tell it to do – not necessarily what you want it to do. (If you figure out the secret for getting a computer to consistently do what you want rather than what you tell it, please let me know! I would like to partner with you on a business idea or two.) Table 1has a summary of JavaScript’s good and bad:

Table 1. JavaScript, the Good and the Bad

Of all these characteristics, it’s JavaScript’s lack of type safety coupled with not having a compiler fail in the capacity to verify intent. That is, of course, if you don’t have unit tests. Unit tests can compensate for the lack of type safety. And unlike with .NET, where unit tests focus mainly on functional verification (since the compiler eliminated the majority of typos), unit tests in JavaScript do both. In summary, JavaScript unit testing is all the more critical because it’s responsible to not only verify functionality, but also to verify syntax and language semantics.

In this article, I’m going to focus on the Visual Studio tooling and project setup requirements needed to get the most out of your JavaScript unit testing.

Tooling

The two most popular Visual Studio integrated tools for JavaScript unit testing are ReSharper and Chutzpah (a Yiddish word about having the audacity to say things as they are – good or bad). Chutzpah is an open source Visual Studio extension and JavaScript test runner written by Matthew Manela. ReSharper is the well-known JetBrains tool, famous for its C## and JavaScript refactoring capabilities.

Both tools are Visual Studio extensions, so installing either into Visual Studio is nothing more than clicking the Tools->Extensions and Updates… menu and searching for “JavaScript Unit Testing” or simply “Chutzpah” or “ReSharper.”

At the core of most JavaScript unit testing lies a headless browser, PHATOMJS.EXE. When this browser launches, it hosts HTML that in turn references your JavaScript files. In addition to the JavaScript files that you supply from your Web project (and the frameworks like JQuery that you reference as part of your production code), JavaScript unit testing generally relies on a unit testing framework. The two primary unit testing frameworks, both of which are open source, are QUnit and Jasmine. Both are well suited for the task of unit testing but each brings a slightly different style to the unit test. QUnit follows the traditional unit-testing style test format, while Jasmine is a behavioral-driven design (BDD) testing framework.

QUnit

As stated on the QUnit Web site, “QUnit is a powerful, easy-to-use JavaScript unit testing framework. It’s used by the jQuery, jQuery UI and jQuery Mobile projects and is capable of testing any generic JavaScript code, including itself!” Code Listing 1provides a sample QUnit test file.

Code Listing 1: A Sample QUnit Series of Tests

/// <reference path="QUnit.js" />
/// <reference path="../../intellitect.sharepoint.web/scripts/SampleRestService.js" />

var restService = null;
module("SampleRestService.getToken()", {
  setup: function () {
    restService = new SampleRestService("http://IntelliTect.com/Blog");
  },
  teardown: function () {
    restService = null;
  }
});
  test("Provide valid credentials", function () {
    var token = restService.getToken("Inigo.Montoya", "Ykmfptd!");
    equal(token, "ecy8b081wh6owf8o", 
	"The token value returned was not as expected.");
  });
  test("Prevent empty string for the name", function () {
    raises(function() {
      var token = restService.getToken("", "Ykmfptd!");
    }, "Unexpectedly, no error was raised given a blank name.");
  });
  test("Prevent empty null for the password", function () {
    raises(function () {
      var token = restService.getToken("Inigo.Montoya", null);
    }, "Unexpectedly, no error was raised given a null password.");
  });

module("SampleRestService.downloadFile()")
  test("Throw an exception if file does not exist.", function () {
    raises(function () {
      var restService =
        new SampleRestService("http://IntelliTect.com/Blog", 
		"Inigo.Montoya", null);
      var file = restService.downloadFile("Bog.us");
    }, "Unexpectedly, no error was raised given an invalid file.");
  });

As one would expect, QUnit supports the standard unit testing constructs, including grouping tests into constructs (using module), pre- and post-test execution steps (setup/teardown members), and a variety of assertions: ok, equal, notEqual, strictEqual, notStrictEqual, deepEqual, notDeepEqual, raises. Essentially, the structure mimics that of a developer unit-testing library.

Jasmine

Although very similar, Jasmine’s BDD-based API involves defining a Spec – a grouping of tests or conditions to verify. The spec places each test into a context or scenario and comprises a suit of tests (see Code Listing 2).

#visual studio code #visual studio #code #java #javascript

Brain  Crist

Brain Crist

1595337660

Visual Studio 2019 v16.7 Preview 2 Available Today!

C++ Updates

Visual Studio v16.7 Preview 2 delivers various improvements in the C++ space. Within the Connection Manager, you’re now able to edit remote SSH connections, e.g. if the IP address of your target system changes and needs to be updated. You’re also able to set default remote connections to be consumed via **${defaultRemoteMachineName} **in CMakeSettings.json and launch.vs.json.

When you edit a remote connection, Visual Studio will no longer need to recopy headers to Windows for a native IntelliSense experience. Likewise, setting default remote connections is useful for checking CMakeSettings.json and launch.vs.json into source control with no user or machine-specific information. These remote connections over SSH allow you to build and debug your C++ projects on a remote Linux system directly from Visual Studio.

CPP Add or Remove SSH Connections

C++ Add or Remove SSH Connections with Connection Manager

This release also brings enhanced IntelliSense support for Clang on Windows (clang-cl) in Visual Studio. The clang include path now includes the clang libraries, we’ve improved the display of in-editor squiggles (particularly when using the std library), and we’ve added support for C++2a is supported in clang mode.

The Preview release also contains four new code analysis rules to incorporate additional safety features into C++: C26817C26818C26819, and C26820. Please see the C++ Team Blog for more info.

In addition, new C++20 Standard Library features have been implemented. A detailed list is provided in the STL Changelog on GitHub.

.NET Productivity

Quick Info now displays the diagnostic ID along with a help link where you can easily navigate to our documentation to learn more about warnings and errors in your code.

Diagnostic ID with help links in .NET Productivity

Diagnostic ID with help links in .NET Productivity

Git Productivity

We continue to release more Git functionality in Visual Studio 2019. This time we focus on merge conflict resolution. We’ve revamped the Visual Studio merge editor by decoupling it from TFVC and focusing it on Git.

A new gold info bar at the top of a file will tell you when there are merge conflicts that need to be manually resolved. Clicking will take you to the merge editor, which now has more informative tiles and captions to help you distinguish between the conflicting branches. We’ve reduced the clutter around the zoom margin, health margin, and the toolbar. In addition, it is easier to parse conflicts with aligned matching lines, word level differences, and visible whitespace when it is the only difference. You can turn off non-conflicting differences to just focus on the conflicts. You can also resolve add/add conflicts at the file level now with a two-way merge. Finally, we have added a checkbox to resolve all conflicts on one side or the other with a single click.

Try the new features by toggling the Preview Feature for New Git user experience in Tools > Options.

Improved Git Functionality in Visual Studio 2019 under the Tools Menu

Improved Git Functionality in Visual Studio 2019 under the Tools Menu

In other Git improvements, we will now close any open folders or solutions before starting a new clone operation, so that Visual Studio can open the newly cloned repo to help you get to your code faster. We’ve improved upon the commit text box, adding inline error checking. And we’ve added UI to help you more clearly understand what is happening when you initialize and push a repository to a remote host like GitHub or Azure Repos.

Local Process with Kubernetes

Local Process with Kubernetes allows you to write, test and debug your .NET code on your development workstation while connected to your Kubernetes cluster with the rest of your application or services. By connecting your development workstation to your cluster, you eliminate the need to manually run and configure dependent services on your development machine. Environment variables, connection strings and volumes from the cluster are available to your microservice code running locally.

For more information on Local Process with Kubernetes, we have detailed it out in our team blog.

#visual studio #announcement #visual studio 2019 #visual studio code

Brain  Crist

Brain Crist

1596975120

Writing Visual Studio Extensions with Mads - Episode 1: Item Templates

Join Mads Kristensen from the Visual Studio team each week as he builds extensions for Visual Studio live!

#visual studio code #visual studio #code #microsoft #visual studio extensions

Brain  Crist

Brain Crist

1595396940

Visual Studio Code June 2020

Welcome to the June 2020 release of Visual Studio Code. There are a number of updates in this version that we hope you will like, some of the key highlights include:

If you’d like to read these release notes online, go to Updates on code.visualstudio.com.

Join us live at the VS Code team’s livestream on Monday, July 13 at 9am Pacific (5pm London), to see a demo of what’s new in this release and ask us questions live.

Insiders: Want to try new features as soon as possible? You can download the nightly Insiders build and try the latest updates as soon as they are available. And for the latest Visual Studio Code news, updates, and content, follow us on Twitter @code!

Accessibility#

This milestone, we again received helpful feedback from our community, which helped us identify and tackle many accessibility issues. Highlights:

  • Compact folders in the File Explorer now properly narrate expanded/collapsed state and the ARIA level.
  • Screen readers can now update the cursor offset in the editor. As a result, the screen reader “Say All” command should work better when stopped and resumed.
  • Same ARIA live messages will now properly be re-read by the screen reader.

Workbench#

Edit object settings from the Settings editor#

Before, the Settings editor could only be used to edit the settings of primitive types, like strings and booleans, and you needed to edit settings.json directly for more complicated settings types. Now, you can edit non-nested object settings from the Settings editor. Extension authors can use this functionality to increase the visibility of these kinds of settings.

Before

In the Settings editor:

Object setting in the old Settings editor

And in settings.json:

Object setting in the JSON editor

After

In the Settings editor:

Object setting in the new Settings editor

Select and keep focus in a list view#

There is a new command, list.selectAndPreserveFocus, which lets you select an item from a list, while keeping focus in that list. This can be helpful if you want to select multiple files from a list, such as the File Explorer, without having focus go to the file editor.

The command is not bound to any keyboard shortcut by default, but you can add your own keybinding:

{
  "key": "ctrl+o",
  "command": "list.selectAndPreserveFocus"
}

Stable Windows ARM builds#

VS Code for Windows on ARM is now available for the stable release! 🎉

Install VSIX through drag and drop#

VS Code now supports installing an extension VSIX file through drag and drop onto the Extensions view.

New Search editor command arguments#

There are two new arguments added to the Search editor commands (search.action.openNewEditorsearch.action.openNewEditorToSide) to allow keybindings to configure how a new Search editor should behave:

  • triggerSearch - Whether a search be automatically run when a Search editor is opened. Default is true.
  • focusResults - Whether to put focus in the results of a search or the query input. Default is true.

For example, the following keybinding runs the search when the Search editor is opened but leaves the focus in the search query control.

{
  "key": "ctrl+o",
  "command": "search.action.openNewEditor",
  "args": { "query": "VS Code", "triggerSearch": true, "focusResults": false }
}

New Search editor context default#

The search.searchEditor.defaultNumberOfContextLines setting has been updated to have a default value of 1 instead of 0, meaning one context line will be shown before and after each result line in the Search editor. To go back to the old behavior, set the value back to 0.

List/Tree: Dynamic horizontal scrolling#

The previously existing workbench.list.horizontalScrolling setting can now be toggled at runtime without forcing you to reload the workbench.

Editor#

Case changing in regex replace#

VS Code now supports changing the case of regex matching groups while doing a find/replace in the editor. This is done with the modifiers \u\U\l\L, where \u and \l will upper/lowercase a single character, and \U and \L will upper/lowercase the rest of the matching group.

Example:

Changing case while doing find and replace

The modifiers can also be stacked - for example, \u\u\u$1 will uppercase the first three characters of the group, or \l\U$1 will lowercase the first character, and uppercase the rest.

Currently, these are only supported in the editor’s Find control, and not in global Find in Files.

Debugging#

New JavaScript Debugger#

Our new JavaScript debugger, after being the default debugger on Insiders last month, is now the default debugger for JavaScript (Node.js and Chrome) in VS Code. If you skipped the “Preview Features” section of the last few VS Code changelogs, you can catch up on the what’s new section of the debugger README.

You should not need to change any settings or launch configurations to take advantage of the new debugger. If you run into any problems, please open an issue!

Single file debugging#

Until today, the VS Code debugger had no standard way of showing that a file in the editor could be easily debugged with just a click of a button. Some debug extensions would allow you to do so, usually with a debug configuration that prompted you to “Debug file in editor.” However, users still had to select the correct configuration in the debug configuration dropdown menu before they can use F5. Other debug extensions implement a fallback strategy for F5: if no launch.json exists, F5 will try to debug the file currently open in the active editor.

Since both approaches are not easily discoverable, some debug extensions (for example, Python) have started to add a Run button to the editor’s title area.

Since we haven’t found a better approach, and this method can be implemented without any need for new APIs, we wrote some guidelines for how to implement it in a standard way. Extension authors can find these guidelines below in the “Extension Authoring” section.

Users need only to remember these icons:

Run and debug action in editor title

If one or both show up on the left-hand side of the editor’s title area, then running or debugging the file in the editor is just one click away.

Less cluttered CALL STACK view#

We’ve started to make the CALL STACK less crowded for common cases: the CALL STACK view now supports hiding debug session nodes that exist for technical reasons, but do not provide much value to users.

The first debug extension that has opted into this feature is the new JavaScript debugger, which could eliminate a parent debug session whenever there is only a single child session.

Screenshot of two "Call Stack" views. Without compaction, there is an extra child session between the parent session and each attached worker processes.

We hope that other debug extensions will follow. Please see the new proposed API below.

New command alias Set Next Statement for Jump to Cursor#

To make the command Jump to Cursor more discoverable for users coming from Visual Studio, we’ve added the command alias Set Next Statement.

If you don’t know what Jump to Cursor does: it lets you move program execution to a new location without executing any of the source code in between.

Breakpoint Path on Hover#

When hovering over a source breakpoint in the BREAKPOINTS view, VS Code now shows the absolute path of the breakpoint.

Tasks#

pnpm package manager support#

pnpm is now a valid choice for the npm.packageManager setting, along with npm and yarn, to run your scripts.

Source Control#

Single view#

The Source Control view has been consolidated into a single view:

Source Control with a single view

All repositories are rendered in a single view, so you can get a better overview of the entire workspace status. Additionally, the Source Control view can now be moved to the panel and other views can be moved to the Source Control view container.

View and Sort#

We have added support for sorting your changes in the source control view by name, path (default), and state when using the list view option. We have consolidated the view options (list vs. tree) and sort options into a new View & Sort menu item in the context menu.

View & Sort in Source Control

Git: Restore squash message#

Similar to usual git merge command, the SCM view will now restore the SCM input with the default message if the user is in the middle of a git merge --squash command.

Languages#

TypeScript 3.9.6#

VS Code now bundles TypeScript 3.9.6. This minor update fixes a few bugs, including one that could cause the TypeScript server to crash on certain source code patterns.

Browser support#

Large file upload support#

You can now upload large files and folders to the web version of VS Code and progress will be reported accurately so that you can track the number of bytes that have been uploaded, as well as the upload speed.

Web upload indicator in bottom Status bar

Towards text file encoding support#

During this milestone, a lot of work went into full support for text encodings in the browser for reading and writing files. We rely on two libraries that are now supported in browsers by leveraging webpack:

  • [iconv-lite](https://github.com/ashtuchkin/iconv-lite) to read and write encodings
  • [jschardet](https://github.com/aadsm/jschardet): to guess encodings from textual content

This work will continue in July and should be generally available soon.

Preview features#

Preview features are not ready for release but are functional enough to use. We welcome your early feedback while they are under development.

Settings Sync#

We have been working the last couple of months to support synchronizing VS Code preferences across machines and this feature is available for preview on the Insiders release.

You can now disable sync on other machine using Turn off Preferences Sync context menu action on the machine entry in Synced Machines view.

Turn off preferences sync for a machine

We’ve also improved progress information when turning on sync.

TypeScript 4.0 support#

This iteration, we’ve continued improving our support for TypeScript 4.0. Some highlights include:

  • Highlight calls to deprecated symbols in the editor with strikethrough
  • Call to a deprecated function rendered in the editor
  • Explain reasons why a given refactoring cannot be applied
  • Displaying the reason a refactoring cannot be applied

#visual studio code #visual studio #java #coding #javascript