Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript snippets in VS #312

Closed
craigktreasure opened this issue Jul 30, 2014 · 67 comments
Closed

TypeScript snippets in VS #312

craigktreasure opened this issue Jul 30, 2014 · 67 comments
Assignees
Labels
Fixed A PR has been merged for this issue Visual Studio Integration with Visual Studio

Comments

@craigktreasure
Copy link
Member

Moving this over from CodePlex (23 votes, assigned to jonturner, http://typescript.codeplex.com/workitem/938):

I would really like to be able to use a TypeScript version of the JavaScript code snippets when writing TypeScript in Visual Studio.

@RyanCavanaugh
Copy link
Member

What kind of snippets would you like to see?

@craigktreasure
Copy link
Member Author

I think all of the existing snippets for the JavaScript language would be a good start.
JSDoc snippets and auto completion would be a huge win! I would love it if TypeScript code was as quick and easy to document as it is in C# today. For example, a /// is all it takes to generate the documentation scaffolding and then I just need to add descriptions.

Also, TypeScript doesn't appear as a language in the Code Snippets Manager, so I can't add custom snippets (that i'm aware of anyways).

@Cotspheer
Copy link

I miss the language too within the Code Snippets Manager. So for me it would be great if I just could add custom snippets. That's all what I need.

@knazeri
Copy link

knazeri commented Aug 7, 2014

What kind of snippets would you like to see? @RyanCavanaugh

For starter I love /// to create a template of a documentation comment and fill in the parameters and other information. There are loads of different snippets that could make coding quicker and easier:

  • ctor
  • prop
  • switch
  • for
  • try
  • tryf

And a shortcut to launch the Insert Snippet menu (ie. CTRL+K, X) would be nice.
I also miss the magical smart tag (ctrl + .) to automatically import, implement interfaces, etc.. like everyday when I'm coding TypeScript in VS!

@mhegazy
Copy link
Contributor

mhegazy commented Aug 7, 2014

@KamyarNazeri /// comments template support should be an issue by itself. Just having snippets will not give you what you are looking for.

@knazeri
Copy link

knazeri commented Aug 7, 2014

@mhegazy What kind of issue are we talking about?

@danquirk
Copy link
Member

danquirk commented Aug 7, 2014

He just means it's a separate feature from code snippets and should be tracked in a separate issue on the issue tracker.

@mhegazy
Copy link
Contributor

mhegazy commented Aug 7, 2014

yup. thanks @danquirk for the clarification, we need two issues here :)

@frodegil
Copy link

AngularJS code snippets for controllers, services, directives, etcetera would be really nice to have available in VS.

@NoelAbrahams
Copy link

@frodegil, AngularJS and code snippets for other frameworks will need to be handled by custom snippets. A custom snippet for JavaScript is defined as follows:

<CodeSnippet Format="1.0.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
    <Header>
        <Title>Closure</Title>
        <Author>Me</Author>
        <Shortcut>closure</Shortcut>
        <Description>Code snippet for a JavaScript closure</Description>
        <SnippetTypes>
            <SnippetType>Expansion</SnippetType>
            <SnippetType>SurroundsWith</SnippetType>
        </SnippetTypes>
    </Header>
    <Snippet>
        <Code Language="JavaScript">
            <![CDATA[(function () {
  $selected$
})($end$);]]>
        </Code>
    </Snippet>
</CodeSnippet>

I believe this request is for TypeScript files to support the following:
(a). Launch the "Insert Snippet" dialogue on Control+K, Control+X.
(b). Provide a set of built-in snippets (for if, try etc)
(c). Permit defining custom snippets as above.

@danquirk
Copy link
Member

Personally I don't think snippets should be in their own menu with a long, awkward key chord to invoke. There's no reason they can't be treated like any other completion result as many other languages/editors do.

@NoelAbrahams
Copy link

Personally I don't think snippets should be in their own menu with a long, awkward key chord to invoke. There's no reason they can't be treated like any other completion result as many other languages/editors do.

👍

@sumitkm
Copy link

sumitkm commented Sep 10, 2014

I second @NightkingCH ! If TypeScript were visible as a language in Snippet Manager we could create our own snippets and use them. Currently I if make TS snippets as JavaScript they are not usable in TS files :-(

@CodeZombieCH
Copy link

Totally agree with @NightkingCH .

@vilicvane
Copy link
Contributor

Here's a dark way to make JS snippets work in TS... But certainly we won't use it in practice, just for fun.

  1. Create a JS file and open it.
  2. Rename it to .ts...
  3. LOL...

And it's a shame that there is still no snippet support in TS 1.3 for VS 2013.

@knazeri
Copy link

knazeri commented Nov 14, 2014

Just out of curiosity, are snippets going to make into VS2015 final release? Or the preview release is pretty much everything we will see the final release?

@mwilc0x
Copy link

mwilc0x commented Nov 25, 2014

Just ran into this issue today. 👍 please!

@Mogikan
Copy link

Mogikan commented Jan 12, 2015

Add TS language to Code Snippets Manager, please!

@gravidThoughts
Copy link

12 more votes for TS Code Snippets!!!! Custom Snippets at a minimum, and maybe useful snippets out of the box.

I am repping my colleagues :)

@jon49
Copy link

jon49 commented Feb 18, 2015

@vilicvane
Copy link
Contributor

Can we expect this to be in 1.5 tools?

@billti billti added this to the TypeScript 1.6 milestone Apr 8, 2015
@paulvanbrenk
Copy link
Contributor

@vilic this looks like something we would add for 1.6, most of the work is probably in the creation of the snippet files (inc. translation, setup etc.).

@vilicvane
Copy link
Contributor

Good to know, thanks! @paulvanbrenk

@NoelAbrahams
Copy link

I hope the new snippets are a bit radical - along the lines of @danquirk's suggestion:

Personally I don't think snippets should be in their own menu with a long, awkward key chord to invoke. There's no reason they can't be treated like any other completion result as many other languages/editors do.

I should just be able to start typing my-custom-snippet anywhere on a code file, and the snippet should be rendered at the point of the cursor upon selection.

@MCKRUZ
Copy link

MCKRUZ commented Jun 6, 2016

Omar,

It’s more the ability to “create new” snippets that is the real rub.  The community has a ton of snippets ready to go (me included).  Any idea of when that will be available?

From: Omar Mefire notifications@github.com
Reply-To: Microsoft/TypeScript reply@reply.github.com
Date: Monday, June 6, 2016 at 12:43 PM
To: Microsoft/TypeScript TypeScript@noreply.github.com
Cc: Matt Kruczek kruz79@gmail.com, Comment comment@noreply.github.com
Subject: Re: [Microsoft/TypeScript] TypeScript snippets in VS (#312)

Thank you all for the suggestions.

So far, here's the list of snippets that are being added to VS:
alert
cl: console.log
class
do: do while
else
for
forin
forr
function
if
iife : (function(x) { })();
switch
try
while
with
Please, let me know if you have further suggestions.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

@omefire
Copy link

omefire commented Jun 6, 2016

@MCKRUZ Yes, included with these changes, will also be the ability to add custom snippets.

@AkosLukacs
Copy link

Omar,

IIFE on typescript feels kind of strange with namespaces and modul
systems...

But the main news is that ts snippets are coming to VS, thanks!
On 6 Jun 2016 18:43, "Omar Mefire" notifications@github.com wrote:

Thank you all for the suggestions.

So far, here's the list of snippets that are being added to VS:

  • alert
  • cl: console.log
  • class
  • do: do while
  • else
  • for
  • forin
  • forr
  • function
  • if
  • iife : (function(x) { })();
  • switch
  • try
  • while
  • with

Please, let me know if you have further suggestions.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#312 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAziKx16sMlvjWqliU4myNWrw7I1UPQ5ks5qJE4hgaJpZM4CSceb
.

@knazeri
Copy link

knazeri commented Jun 6, 2016

@omefire

Please, let me know if you have further suggestions.

I would say ctor to create a constructor for the containing class, which is quite handy snippet in C#

@zpdDG4gta8XKpMCd
Copy link

zpdDG4gta8XKpMCd commented Jun 6, 2016

@omefire

consider allowing regex, javascript or c# expressions in the scripts placeholders so that they are not just dumb templates but capable of some transformations

@paulvanbrenk
Copy link
Contributor

paulvanbrenk commented Jun 6, 2016

@Aleksey-Bykov we will consider that, but not for the initial release... the snippet infrastructure in VS doesn't allow that, and we don't want to delay this feature further ;-). Do you have an example where that would be useful.

@zpdDG4gta8XKpMCd
Copy link

here is an example of regex transformations https://manual.macromates.com/en/snippets

@paulvanbrenk
Copy link
Contributor

@Aleksey-Bykov I was looking for a TypeScript specific example what is a case where you would use this?

@zpdDG4gta8XKpMCd
Copy link

@paulvanbrenk, as far as see it snippets are language agnostic, because they just generate output text (that happened to be a piece of code) based on some input text or lack of thereof

back to your question, in my pet project in TypeScript I use the following snippet a lot:

export type SomeSingletonKind = 'some-singleton-kind';
export const someSingletonKind : SomeSingletonKind = 'some-singleton-kind';

Example: https://github.com/aleksey-bykov/commandlining/blob/master/failing.ts

export type UnexpectedCharacter = 'unexpected-character';
export const unexpectedCharacter: UnexpectedCharacter = 'unexpected-character';

export type UnhandledState = 'unhandled-state';
export const unhandledState: UnhandledState = 'unhandled-state';

export type UnspecifiedParameterName = 'unspecified-parameter-name';
export const unspecifiedParameter: UnspecifiedParameterName = 'unspecified-parameter-name';

export type UnfinishedArgument = 'unfinished-argument';
export const unfinishedArgument: UnfinishedArgument = 'unfinished-argument';

export type UnspecifiedArgument = 'unspecified-argument';
export const unspecifiedArgument: UnspecifiedArgument = 'unspecified-argument';

export type UnspecifiedCommand = 'unspecified-command';
export const unspecifiedCommand: UnspecifiedCommand = 'unspecified-command';

export type UnexpectedEndOfInput = 'unexpected-end-of-input';
export const unexpectedEndOfInput: UnexpectedEndOfInput = 'unexpected-end-of-input';

export type UnspecifiedCommandOrParameter = 'unspecified-command-or-parameter';
export const unspecifiedCommandOrParameter: UnspecifiedCommandOrParameter = 'unspecified-command-or-parameter';

export type UnattendedCharacter = 'unattended-character';
export const unattendedCharacter: UnattendedCharacter = 'unattended-character';

export type UnexpectedCommand = 'unexpected-command';
export const unexpectedCommand: UnexpectedCommand = 'unexpected-command';

export type UnexpectedBuilderState = 'unexpected-builder-state';
export const unexpectedBuilderState: UnexpectedBuilderState = 'unexpected-builder-state';

export type UnexpectedParameterName = 'unexpected-parameter-name';
export const unexpectedParameterName: UnexpectedParameterName = 'unexpected-parameter-name';

export type ErrorCode = UnhandledState | UnspecifiedParameterName | UnfinishedArgument
    | UnspecifiedArgument | UnexpectedCharacter | UnattendedCharacter
    | UnexpectedEndOfInput | UnspecifiedCommand | UnspecifiedCommandOrParameter
    | UnexpectedCommand | UnexpectedBuilderState | UnexpectedParameterName;

As you can see the spellings of type-literal, type-alias-name and constant-identifier are all different: Pascal, Dashed, Camel

It means I cannot use snippets based solely on templates, because I need to apply a transformation to get the case I need. This is where I wish snippets had transformations.

@ruslanss
Copy link

i desperately need these for TypeScript: https://visualstudiogallery.msdn.microsoft.com/5d11e28f-0f7c-4f6e-ae50-699fcd5a3500

would save me a LOTTA of time

@zpdDG4gta8XKpMCd
Copy link

for those who can't wait anymore, VS Code can do TypeScript very well and it has snippets

@paulvanbrenk
Copy link
Contributor

Snippets will be part of VS "15" post Preview 4.

For smarter snippets I opened: #10309

@paulvanbrenk paulvanbrenk added Fixed A PR has been merged for this issue and removed Committed The team has roadmapped this issue Suggestion An idea for TypeScript labels Aug 12, 2016
@mhegazy mhegazy added this to the Visual Studio "15" Preview 4 milestone Aug 17, 2016
@MaklaCof
Copy link

MaklaCof commented Sep 8, 2016

I installed Microsoft Visual Studio Enterprise 15 Preview 4, but I don't see any options to insert snippet.
Tried with:

  • Edit -> InstalliSense -> Insert snippet (doesn't exist)
  • Ctrl + k, Ctrl + x
  • Right click -> Insert Snippet

In Tools -> Code Snippets Manager I don't see TypeScript in Language drop down.
How can I insert snippet?

@paulvanbrenk
Copy link
Contributor

@MaklaCof Snippets for TypeScript is not available in Preview 4, but will be in the next release.

@MaklaCof
Copy link

MaklaCof commented Sep 9, 2016

Then someone should fix Milestone to avoid confusion.

mjbvz added a commit to mjbvz/nodejstools that referenced this issue Sep 9, 2016
**Bug**
Now that our Node.js editor has been replaced with TypeScript, users can no longer access code snippets. This was already the case when using ES6 IntelliSense

**Fix**
Code snippet functionality will now be provided by TypeScript: microsoft/TypeScript#312 This change removes the code snippets themselves from our code.
mjbvz added a commit to microsoft/nodejstools that referenced this issue Sep 12, 2016
* Remove Node Code Snippets in Favor of Typescript

**Bug**
Now that our Node.js editor has been replaced with TypeScript, users can no longer access code snippets. This was already the case when using ES6 IntelliSense

**Fix**
Code snippet functionality will now be provided by TypeScript: microsoft/TypeScript#312 This change removes the code snippets themselves from our code.

* Remove snippets from installer too

* Restore test file, but delete single bad test
jcansdale added a commit to jcansdale/nodejstools that referenced this issue Sep 27, 2016
* Remove GlobalModulesNode

**Bug**
We currently populate a npm node with a list of global modules for every NTVS project. For users with a few globals installed and/or lots of NTVS projects in a solution, this can lead to perf issues with both memory and CPU, since the global modules node includes the entire dependency tree of modules.

**Fix**
Simply remove this node.

Closes microsoft#1125

* Add basic node module info

* Remove extra space

* Prepend vars with _

* REmove npm bin command

* Remove a few more dead code paths for globals

* Remove global install ui option

* Remove global options from ui backing class

* Remove now unused strings

* Log Top Level Npm Packages in Diagnostics Window

Bug
To investigate perf issues with Typescript/Salsa, we would like to be able to collect a list of installed node modules from users.

Fix
Adds this information to the Diagnostic window. If a user is running into perf issues, we can requires that they provide the output of the Diagnostics window to us in order to help with out investigations

Testing
Tested with a few different project/solution types

Here's an example for a solution with two express projects:

```
Use Ctrl-C to copy contents

Projects:
    Project: ExpressApp17\ExpressApp17.njsproj
        Kind: Node.js
        StartupFile: C:\Users\matb.REDMOND\documents\visual studio 2015\Projects\ExpressApp17\ExpressApp17\bin\www
        WorkingDirectory: .
        PublishUrl: <undefined>
        SearchPath: <undefined>
        CommandLineArguments: <undefined>
        Analysis Log:
        Analysis loading...
        Top Level Node Packages (9):
            body-parser 1.8.4
            cookie-parser 1.3.5
            debug 2.0.0
            express 4.9.8
            jade 1.6.0
            mocha 2.5.3
            morgan 1.3.2
            serve-favicon 2.1.7
            stylus 0.42.3

        Project Info:
            .js (included in project):
                Number of Files: 4
                Average Line Count: 22
                Max Line Count: 61
            .d.ts (included in project):
                Number of Files: 14
                Average Line Count: 418
                Max Line Count: 2557
            .js (excluded from project):
                Number of Files: 641
                Average Line Count: 194
                Max Line Count: 15226
            .html (excluded from project):
                Number of Files: 6
                Average Line Count: 106
                Max Line Count: 324

    Project: ExpressApp1\ExpressApp1.njsproj
        Kind: Node.js
        StartupFile: C:\Users\matb.REDMOND\documents\visual studio 2015\Projects\ExpressApp17\ExpressApp1\bin\www
        WorkingDirectory: .
        PublishUrl: <undefined>
        SearchPath: <undefined>
        CommandLineArguments: <undefined>
        Analysis Log:
        Analysis loading...
        Top Level Node Packages (8):
            body-parser 1.8.4
            cookie-parser 1.3.5
            debug 2.0.0
            express 4.9.8
            jade 1.6.0
            morgan 1.3.2
            serve-favicon 2.1.7
            stylus 0.42.3

        Project Info:
            .js (included in project):
                Number of Files: 3
                Average Line Count: 26
                Max Line Count: 61
            .d.ts (included in project):
                Number of Files: 13
                Average Line Count: 432
                Max Line Count: 2557
            .js (excluded from project):
                Number of Files: 430
                Average Line Count: 179
                Max Line Count: 15226
            .html (excluded from project):
                Number of Files: 3
                Average Line Count: 88
                Max Line Count: 188

```

* Move to using local copy of workspaces instead

* Copy validation package internal too

* Remove validation from package.config list

* fix swixproj & vsmanproj build issues

* add sideload vsmanproj

* generate vsixs

* update vsix certificate

* add script to download microbuild packages

* build setup project and properly sign vsix's

* Add PackagesPath environment variable

* copy swix outputs to staging directory

* mkdir vsdrop

* update setup script for microbuild

* fix profiling vsix path

* fix build script

* Gate swix include to vs15 builds

* Update to github link

* Added empty lighweight install targets

* Remove commented out sections of swixproj files

* Try updatingswr path

* Correct path

* Revert payload path change

* Bump SwixBuild version

* Correctly set DepType

* Fix product name NodeJs -> NodeJsTools

* Restore max_path tests

* Fix a few errors with max path tests

* REstore async logic

* Fix targets vsix path

* Fix targets vsix name in swixproj

* Reorder targets swixproj

* Rename targets file

* Revert targets changes

* Change target mapping name

* Rename swr targets

* Update targets to point to VisualStudio.targs

* reorder property groups

* Rename targets file source

* Revert assembly version

* Create Wrapper Script for Installing Typings

**Bug**

**Fix**
Create a node script that wraps `typings-core`. This script will continue installation of all packages, even if some packages do not have typings files.

Closes microsoft#1140

* dont ignore bin files

* Remove other bin ignore

* Fix some spells

* Small name cleanup

* Use msbuild for vs version

* Issue microsoft#1141

**Bug**
Some template ids are duplicated. This makes VS lightweight very sad

**Fix**
Use unique ids for each template.

Closes microsoft#1141

* Update azureexpressapp id

* Remove duplicate Vstman Project Template manifest entries

Follow up on microsoft#1064

This removes duplicate entries for the main project templates.

* Update vstman entry ids as well

* Swap Project and Item Template Files

**Bug**
Item templates are currently stored in a file called `VS_Nodejs.project.vstman` while project templates are stored in a file called `VS_Nodejs.item.vstman`. I believe these should be swapped

**Fix**
Swap the contents of the two files.

* Move main logic to index and fix spell

* Lock packages to specific version

* small cleanups

* Fix visual studio file names

* Remove package registration logic

* Remove pkgdef file

* Exclude pkgdef from vsix

* Update scripts/node.d.ts

**Bug**
The current scripts/node/node.d.ts file we use for typescript projects is out of date.

**Fix**
Copy in the latest node.d.ts file.

**Testing**
Created new typescript project. Completions now match expected node 6 apis.

* Revert gitignore change

* Add license to package.json

* Build v1.2.x branch on AppVeyor

This ensures we run AppVeyor CI for the v1.2.x branch using the same settings as master currently. Will also take this change into the v1.2.x branch.

* Fix spelling of tool to reflect new directory name

* Remove non-willow dep link

* Try removing templates from vsix manifest

* Remove testWwindow dep

* Revert removing project template manifests from vsixmanifest

* Added typings acquisition tool files to installer

* Fix duplicate template installs for willow

* Fix duplicate dir name

* Fix duplicate typescript project template ids

* Revert project template changes

* Remove vstman files

* Revert vsman change since it breaks regular cases

* Atttempting to contribute to Issue microsoft#496. Altered DeafaultName tag to match target replacement filename.

* Changed CreateNewFolder tag of FromExistingCode template to true.

* Run ClearCache on Setup Install

This is an attempt to fix microsoft#1162. For some reason, the component model cache is not being cleared properly on upgrade installs with VS 2015 update 3. This force clears the cache.

* Disable typescript error on vs15

* Updated readme for 1.2 RTW

* Added ProvideCodeBase to assembly info

* Revert provide project item

* Add other codebases to pkgdef

* Add reference to dev15 telemetry

* Update telemetry version

* Copy webroledll

* Updating item templates to not be zipped

* Fix xml

* Use correct path for item templates

* Move file templates up a level

* Update filetemplates path

* Various fix measures for Issue microsoft#496. Solved by preventing deletion of appropriate directory folders for each respective project created.

* Comment formatting.

* address most CR comments

* fix sideload script

* Revert "Update filetemplates path"

This reverts commit 7644815.

* Revert "Move file templates up a level"

This reverts commit de9b6a2.

* Revert "Use correct path for item templates"

This reverts commit 27748fd.

* Revert "Fix xml"

This reverts commit 4b9adba.

* Revert "Updating item templates to not be zipped"

This reverts commit 25e9047.

* remove .vstman files

* remove .vstman files from *.csproj

* Remove unused IScopeNode file

* Reverted changes to solution config info, and updated  internal documentation within ImportWizard.cs.

* Make minor version a constant

* Remove commented out section

* Removed unnecessary try block.

* Upgrade Newtonsoft.json to 6.x

After dropping dev11 and dev12 support, we can now get rid of the hack to support both newtonsoft.json 4 and 6. This workaround prevented tools like the nuget package management console from working properly.

Closes microsoft#645

* Remove one more refernce

* Use signed version of webrole.dll

* Use full path for CopyOutputsToPath

* Use WebRoleDllPath based on existance of SignedBinariesPath

* Delete custom target for targets build

* pull webrole from webrole binaries

* Revert removal of  _CopyWixOutputsToPath

* Add a few debug messages

* Remove reference to swix from setup files

* Remove correct line in dirs.proj

* revert dirs.proj changes

* Try adding custom MSBuildAllProjects path to trigger rebuild

* Clean up change and remove log statements

* Fixed an issue where certain tests would be skipped under Mocha 3.0.0.

* Swtich to force clean build root output

* Fix WebRoleDll paths

* Redo dirs.proj change

* Restore workaround to retrigger build and revert dirs.proj change

* Use buildversion variable instead of hardcoded 1.2 version for vsix packages

* Use build.buildnumber instead

* Use custom defined buildversion

* Update other swix files

* Use Signed Binary Path For WebRole.Dll in Lightweight install (microsoft#1196)

* Use signed version of webrole.dll

* Use full path for CopyOutputsToPath

* Use WebRoleDllPath based on existance of SignedBinariesPath

* Delete custom target for targets build

* pull webrole from webrole binaries

* Revert removal of  _CopyWixOutputsToPath

* Add a few debug messages

* Remove reference to swix from setup files

* Remove correct line in dirs.proj

* revert dirs.proj changes

* Try adding custom MSBuildAllProjects path to trigger rebuild

* Clean up change and remove log statements

* Swtich to force clean build root output

* Fix WebRoleDll paths

* Redo dirs.proj change

* Restore workaround to retrigger build and revert dirs.proj change

* Use buildversion variable instead of hardcoded 1.2 version for vsix packages

* Use build.buildnumber instead

* Use custom defined buildversion  (microsoft#1199)

* Use custom defined buildversion

* Update other swix files

* Use MsiVersion instead of custom version logic

* REmove custom build logic

* Use signed webrole.dll for VS15  (microsoft#1200)

* Use signed version of webrole.dll

* Use full path for CopyOutputsToPath

* Use WebRoleDllPath based on existance of SignedBinariesPath

* Delete custom target for targets build

* pull webrole from webrole binaries

* Revert removal of  _CopyWixOutputsToPath

* Add a few debug messages

* Remove reference to swix from setup files

* Remove correct line in dirs.proj

* revert dirs.proj changes

* Try adding custom MSBuildAllProjects path to trigger rebuild

* Clean up change and remove log statements

* Swtich to force clean build root output

* Fix WebRoleDll paths

* Redo dirs.proj change

* Restore workaround to retrigger build and revert dirs.proj change

* Use buildversion variable instead of hardcoded 1.2 version for vsix packages

* Use build.buildnumber instead

* Use custom defined buildversion

* Update other swix files

* Use custom defined buildversion  (microsoft#1199)

* Use custom defined buildversion

* Update other swix files

* Use MsiVersion instead of custom version logic

* REmove custom build logic

* Remove dev11 and dev12 references from msbuild files (microsoft#1202)

* Remove additional dev11 and dev12 references from msbuild files

NTVS 1.2 no longer supports VS11 or VS12. This change removes a few remaining references from the msbuild files. Also removes the c++ targets logic.

* Revert assemblyversion change

* Fix breaking on plain old errors (microsoft#1193)

* Fix breaking on plain old errors

closes microsoft#1192

**bug**
```js
throw new Error('I am');
```
is not handled, even with all node.js exceptions enabled

**fix**
Use correct name when enabling or disabling errors.

**testing**
Tested this case before and after fix. See error being handled correctly now.

* Fix core duplication problem that was the root cause of this issue

* Remove ProjectTemplatesDir from main pkgdef (microsoft#1201)

**Bug**
Duplicate template entries showing up in VS15 microsoft#1177

**Fix**
The root cause seems to be our `*.pkgdef` file, which sets `ProjectTemplatesDir`. Set this to nullpath instead of the actual path. Also updated the dev pkgdef to point to the correct location for testing.

* Lightweight remote debug (microsoft#1203)

* Include remotedebug.js in vsix

* Remove unused file

* Move remotedebug folder to match msi install location and remove registry lookup

* Remove remote debug registry set msi step

* Fix build to copy webrole.dll to correct location

* Change remotedebug.js back to old location but make sure it is copied to the correct location for vsix and dev builds

* Revert file path change for msi proj

* Fix file path for msi builds

* Delete Starter Express App Templates

**Bug**
The starter express app templates are very out of date and do not provide a good example of best practices while developing a modern node web application. We do not have the resources to keep them up to date. We also do not want to ship templates that are out of date and promote bad design (for example, we still are referencing Jade in all of these templates, which has been renamed to Pug).

If we ever do want to provide a more feature-rich template for new users, starting from scatch would be better IMO would be better than trying to update all these templates.

**Fix**
Just delete all these templates. Any projects created from these templates will continue to work fine, this only effects the new project experiance.

We would want to take this into NTVS 1.3 and probably VS15 Preview 5.

* Remove setup references from setup

* Reverting main change

* REmove all starter express app templates except the azure ones

* Fix potential crash for weird %PATH%

**Bug**
If the %PATH% env var contains path entries which are not valid, NTVS can end up crashing in `GetPathToNodeExecutableFromEnvironment` when calling `Path.combine`

**Fix**
Wrap this section in a try catch block to handle these entries.

* Support *.pug extension for Jade Templates

**Bug**
The Jade was renamed Pug, and they no longer support `*.jade` files natively. NTVS only supports `*.jade` files

**Fix**
As first part of Jade -> Pug update, add support to use jade editor for both `*.jade` and `*.pug` files.

* Alert User if Typescript is not Installed

From microsoft#1208

**Bug**
If TS is not properly installed, NTVS will silently crash when loaded. The root cause is GetNodejsLanguagePreferencesFromTypeScript

**fix**
Instead of throwing right away, alter the user that there is something wrong. Fixing this requires user intervention.

* Check hr and then throw, instead of catching exception

* Make it more clear that NTVS cannot load if this error happens

* Handle Semver parse errors in NpmGetCatalogCommand for 'versions' field

**Bug**
Semver parsing is failing for version strings like `'latest'`. This prevents users from downloading the npm package catalog.

**Fix**
Instead of blocking users in this case, we should catch these exceptions and continue on.

* Remove added parameter

* Delete Man Field from Npm package.json parser

This field is only consumed by our tests, and therefore not very useful.

* Automatic Refactor - Remove Unused Using Statements (microsoft#1231)

Just applying the remove unused using statement automatic vs fix to the entire NTVS solution.

* Fix Building NTVS with devenv /Build (microsoft#1236)

* Fix Building NTVS with devenv /Build

Issue microsoft#1230

**Bug**
Crash when trying to build an NTVS project from the command line with `devenv /build`. The root cause is in the `UIThread` where we attempt to call `TaskScheduler.FromCurrentSynchronizationContext`. In non-ui flows, this throws an `InvalidOperationException`.

**Fix**
If `TaskScheduler.FromCurrentSynchronizationContext` fails, try setting the current syntronization context manually and retrying the call. This fixes the `UIThread`, but also fixes all other code paths (including some in the VS extension bases themseleves) that use `TaskScheduler.FromCurrentSynchronizationContext` or assume a SyncronizationContext exists.

closes microsoft#1230

* Better scope fix

* Default NodejsTools.targets to VS2015 (microsoft#1239)

**Bug**
The current `Microsoft.NodejsTools.targets` falls back to vs 10.0 if no version is explicitly provided in the environment.

**Fix**
Fallback to VS 2015 instead.

* Remove Dockerfile Template (microsoft#1237)

* Remove Dockerfile Template

**Bug**
I believe at some point, NTVS planned to integrate with Docker. This does not appear to have really happened, but we still have this weird DockerFile template hanging around. This file template is not a general dockerfile, but NTVS specific. I do not believe we should include it anymore.

**Fix**
Delete.

* Remove docker file from setup files list

* Add azure tools vs15 link (microsoft#1244)

* Fix diagnostic window icon (microsoft#1251)

**Bug**
Diagnostics window embeds old pyhton icon.

**Fix**
Switch to node icon

**Testing**

closes microsoft#1248

* Delete Add Website Templates (microsoft#1234)

* Delete Add Website Templates

**Bug**
In the best case, we see under 10% of users creating new node website projects from `new Website` flow vs the `new project` flow (10% number taken for `NodeJsWebapp` vs `AddWebsiteNodejsWebapp`. Other templates compare less favorably, with a grand total of 1 users over the past 10 days creating a AzureExpressApp through the new website flow). This suggests to me that this flow is not discoverable. For NTVS, `new website` also adds zero actual value since the templates are exactly the same as with `new project`.

The cost is that we have another copy of templates to maintain and another set of flows we have to cover in our test passes. And we only present an incomplete subset of node website templates in this flow to begin with.

**Fix**
Just delete these templates.

* Update csproj

* Remove ES5 IntelliSense Option (microsoft#1255)

* Remove ES5 IntelliSense Option

As explained in microsoft#1254, there are few reasons for anyone to switch back to the old ES5 based intellisense. Our telemtry also shows that very very few people are switching back too.

This change removes the option to switch from the VS entirely. This locks all main editors in ES6/Typescript backed mode. We'll keep around the old analysis engine code a bit longer in order to power the Interactive window, but will eventually rip it out too.

Closes microsoft#1254

* Remove unused intellisense level changed logging call

* Remove two more unused options and disable intellisense page on vs15

* Remove horizontal divider from options page

* Small cleanup for diagnosticscommand

* Remove unused TelemtryEvent name

* Remove Update contentType function

* Remove old Node.js Editor and Instead Use Typescript Editor (microsoft#1260)

* Remove ES5 IntelliSense Option

As explained in microsoft#1254, there are few reasons for anyone to switch back to the old ES5 based intellisense. Our telemtry also shows that very very few people are switching back too.

This change removes the option to switch from the VS entirely. This locks all main editors in ES6/Typescript backed mode. We'll keep around the old analysis engine code a bit longer in order to power the Interactive window, but will eventually rip it out too.

Closes microsoft#1254

* Remove unused intellisense level changed logging call

* Remove two more unused options and disable intellisense page on vs15

* Remove horizontal divider from options page

* Remove Node.js Editors

**Bug**
We are moving to fully use Typescript to power our editors. microsoft#1255 removed the option to switch to the old ES5 IntelliSense in the UI, but users can still reach this by switching to the old Node.js editor. We do not want this behavior.

**Fix**
Delete the old Node.js edtiors and editor factories entirely.

* Small cleanup for diagnosticscommand

* Remove unused TelemtryEvent name

* Remove Update contentType function

* Add SendFeedback menu item for NTVS (microsoft#1253)

* Add SendFeedback menu item for NTVS

Adds a simple menu item to send feedback about ntvs. See microsoft#1252 for details

Closes microsoft#1252

* Move send feedback to NTVS menu. Add documentaiton link

* Add documentation command

* Remove JavaScriptOutliningTagger (microsoft#1262)

* Remove ES5 IntelliSense Option

As explained in microsoft#1254, there are few reasons for anyone to switch back to the old ES5 based intellisense. Our telemtry also shows that very very few people are switching back too.

This change removes the option to switch from the VS entirely. This locks all main editors in ES6/Typescript backed mode. We'll keep around the old analysis engine code a bit longer in order to power the Interactive window, but will eventually rip it out too.

Closes microsoft#1254

* Remove unused intellisense level changed logging call

* Remove two more unused options and disable intellisense page on vs15

* Remove horizontal divider from options page

* Remove Node.js Editors

**Bug**
We are moving to fully use Typescript to power our editors. microsoft#1255 removed the option to switch to the old ES5 IntelliSense in the UI, but users can still reach this by switching to the old Node.js editor. We do not want this behavior.

**Fix**
Delete the old Node.js edtiors and editor factories entirely.

* Small cleanup for diagnosticscommand

* Remove unused TelemtryEvent name

* Remove Update contentType function

* Remove node outlining

* Delete Brace Matching Tagger (microsoft#1264)

This functionality is no longer used now that we've moved to the Typescript based editor.

* Remove Snippets (microsoft#1263)

* Remove Node Code Snippets in Favor of Typescript

**Bug**
Now that our Node.js editor has been replaced with TypeScript, users can no longer access code snippets. This was already the case when using ES6 IntelliSense

**Fix**
Code snippet functionality will now be provided by TypeScript: microsoft/TypeScript#312 This change removes the code snippets themselves from our code.

* Remove snippets from installer too

* Restore test file, but delete single bad test

* Limit Depth of Npm Package Tree to a Single Level (microsoft#1261)

* Limit Depth of Npm Modules

This is a resbumission of microsoft#944

**Bug**
Now that our Node analyzer cannot be used in the main editor, there no real reason why we need to build a complete tree of npm installs. As microsoft#944 documented, this is a major source of memory and cpu usage at boot

**Fix**
Limit depth of explored npm tree to a single level. This brings some very nice perf gains for projects that have complex depdency tress.

* Fix unit test for recurisve read

* Delete Old Comment Logic (microsoft#1266)

**Bug**
We are removing the old node editor. Our custom comment logic is no longer needed. This functionality can only be reached through the interactive window, and the use case for commenting a block of code in the repl is rather limited.

**Fix**
Remove this logic.

* Remove Remaining Starter Express Templates (microsoft#1270)

* Remove Start Express Tempaltes

**Bug**
Following up on microsoft#1210, I still feel all the same arguments apply. Going forward, we do not want to maintain these templates as they provide a poor example of how to organize a modern Node project and are out of date.

**Fix**
Remove the remaining starter express templates. Projects that used these templates will continue to work just fine. The existing basic express templates will also allow users to quickly get started with Express, without pulling in all this other stuff.

* Remove references from setup too

* Remove Old Go To Definition and Find All References Logic  (microsoft#1268)

* Remove Old Go To Definition Code

This logic is now supplied by typescript.

* Delete a few more classes

* Switch Express Templates to Use Css Instead of Stylus (microsoft#1272)

* Remove Start Express Tempaltes

**Bug**
Following up on microsoft#1210, I still feel all the same arguments apply. Going forward, we do not want to maintain these templates as they provide a poor example of how to organize a modern Node project and are out of date.

**Fix**
Remove the remaining starter express templates. Projects that used these templates will continue to work just fine. The existing basic express templates will also allow users to quickly get started with Express, without pulling in all this other stuff.

* Remove references from setup too

* Swap Express Styl Files to CSS

Part of microsoft#1271

Switches our express templates from using styl to using plain old css files instead. We want our project templates to be as generic as possible and starting users off with stylus does not fit this. Instead, use simple static css files. Users can bring whatever stylesheet language they prefer.

Also removes the empty styl file template NTVS includes.

* Remove styl file template item entries

* REmove styl fromm setup

* Fix a few styl references that were not saved

* Remove Advanced Editor Options Page (microsoft#1274)

With our editor now powered by TypeScript, the node.js advanced editor options page is no longer needed.

This change fully removes that page, along with a few tests that were testing functionality of the old editor.

* Remove Global Registry NodeJs InstallDir fallback (microsoft#1273)

**Bug**
With VS15 (and prior versions too), we do not want to write data to a global registry location. We currently persist and `InstallDir` field to the NTVS registry.

**Fix**
Remove this fallback. This code is used to lookup files from the NTVS package. We should always use the files relative to the node.js tools dll instead.

* Switch Jade to Pug in Express Templates (microsoft#1275)

* Switch Jade to Pug in Express Templates

**Bug**
Jade has been renamed to pug. Our templates still install Jade and this generates a warning.

**Fix**
Switch from Jade to Pug. Rename all template file extensions. NTVS 1.3 already supports viewing *.pug files as if they were Jade files.

closes microsoft#895

* Rename new jade file template to pug

* Rename jade token test files to pug tokens

* Add Typescript Version Check (microsoft#1267)

**Bug**
With NTVS 1.3, we will depend on TypeScript being installed. With VS15, this is enforced during instalation, but this dependency is not enforced in VS2015. However, we see the majority of users do have TypeScript installed.

**Fix**
Add runtime check to alert users if TypeScript is not installed.

Closes microsoft#1259

* Update Express Template Dependecy Versions (microsoft#1276)

* Update Express Js Template Versions

Part of microsoft#1271

This bumps the express templates to use the most recent versions of packages. It also relaxes the version matching to use ^ instead of ~

* Reorder deps

* Add use-strict to Js Template Files (microsoft#1278)

* Add use-strict to Js Template Files

**Bug**
Javascript templates should encourage the use of strict mode for modern Javascript.

**Fix**
Append `'use strict';` to all js files in templates.

```
Get-Childitem *\*.js -Recurse  | ForEach-Object { set-content -path $_.FullName -value ("'use strict';`r`n" + (get-content -path $_.FullName |out-string)) }
```

* Small spacing cleanup

* Upgrade TypeScript Express App Template To Express 4 (microsoft#1277)

Moves the existing TypeScriptExpressApp Template to use express 4. This includes:

* Updating to use new/changed apis.
* Including modern typings files in a way that emulates what `typings` does
* Adding a bin/www file.
* Small other fixes.

* Remove old node analyzer and intellisense (microsoft#1280)

* Remove Old Node Analysis and Intellisense/Analysis Code

**bug**
With NTVS 1.3, we have removed the old Node.js editor. This means that the old analyzer and intellisense logic are no longer required. This code has been the source of a lot of problems and we do want to maintain our own implementation of this. We instead rely on TypeScript for this functionality. TypeScript provides

**fix**
Delete all the analysis logic and anything and everything connected with this.

This change does remove some functionality. Perhaps most significantly, IntelliSense and syntax highlighting are no longer supported in the repl window (both work just fine in the editor). I beleive that the positives of this change for the entire NTVS project outweigh these regressions.

* Fix build scripts and few other references to analyzer

* Revert ruleset

* REvert assembly version

* Fix a few more references to jsanalysistest and remove unsued vars

* Remove some unused ui tests

* Remove two more analysis.dll references

* Remove reference generator

* Remove a few more references to reference generator

* Fix reference test

* Remove some unused constants

* Remove analysis level enum

* Trigger typing acq correctly on install

* Copy Dlls for Test Adapter into VSIX for VS15 (microsoft#1250)

**Bug**
Test adapter is not working in VS15.

One cause is that it cannot resolve two dlls: shell.interop and newtonsoft.json. The first is in the GAC in vs14 and the second is installed by our MSI (not entirely sure how it works for devbuilds)

**Fix**
Copy these dlls into the vsix explicitly. I tried embedding shell.interop, but it cannot be embedded.

* Ensure Test Adapter Dependency DLLs are Copied to VSIX (microsoft#1257)

**Problem**
Test adapter depends on newtonsoft.json and Microsoft.VisualStudio.Shell.Interop. These are not included on their own in our vsix.

My previous fix just updated the vsix manifest and did not properly include these files

**Fix**
Add copy  step to ensure we copy these files to the vsix.

* Delete the TypeScriptAzureExpressWebRole Template (microsoft#1284)

* Delete the TypeScriptAzureExpressWebRole Template

**Bug**
This template is identical to TypeScriptAzureExpressApp, except for setting `<hidden>true</hidden>`. It is not clear what value this template offers.

**Fix**
Delete it

* Remove template from installer as well

* Move TypeScript Azure Express App to Express 4 (microsoft#1286)

Part of microsoft#1271

This moves the TypeScript Azure Express App from Express 3 to Express 4. The changes are based on the TypeScript Express app template.

* Remove DEV14_OR_LATER Guards (microsoft#1281)

We currently only target VS2015+ so these guards are always true.

* Delete Azure solution listener (microsoft#1282)

* Delete Provide Brace completion attribute (microsoft#1283)

* Remove ProvideLanguageTemplates for Web Templates (microsoft#1285)

**Bug**
We no longer ship templates in the web group. This attribute creates a `JavaScript` group under web that is empty.

**Fix**
Remove this attribute

**Testing**
Confirmed that existing templates continue to work after this change.

* fix IntelliSense capitalization (microsoft#1290)
@lorenlew
Copy link

@paulvanbrenk, as you mentioned "Snippets will be part of VS "15" post Preview 4."
what about VS 2015?

@paulvanbrenk
Copy link
Contributor

@lorenlew unfortunately we won't be back porting them VS 2015.

@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Fixed A PR has been merged for this issue Visual Studio Integration with Visual Studio
Projects
None yet
Development

No branches or pull requests