Git Product home page Git Product logo

encourage's Introduction

encourage's People

Contributors

alsaydi avatar calvinallen avatar haacked avatar jaredpar avatar jbubriski avatar jcansdale avatar jimgraham avatar philoushka avatar rprouse avatar sklivvz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

encourage's Issues

Can't install in VS2012

Trying to install the latest version 1.1.2 and get the following error:

The extension could not be installed because the following error occurred:

This extension is not support on the current product.

Encourage doesn't work with "Save All"

Encourage works perfectly with Visual Studio 2013 when I use "Save" (or hit Ctrl+S) but it doesn't seem to work when I use "Save All" (or hit Ctrl+Shift+S).

Issue formatting .cs files

There is a problem while formatting (indenting, adding/erasing whitespaces and/or newlines, etc.) directives such as #endregion, #pragma, etc..

The problem lies within the following classes/functions:

  • SyntaxFormatter
  • NormalizeWhitespaceCore
  • NormalizeWhitespace

These functions are inconsistent with the CSharp compiler, which allows lines such as:

#endregion foo

where the conventional way of doing this is:

#endregion //foo

The formatting erases the whitespace after the directive, giving a non-compilable file like this:

#endregionfoo <--- here, having written "#endregion //foo" wouldn´t cause any problem, because one would be getting a compilable "#endregion//foo"

Similar problem with #pragma, where an extra enter is erased while formatting the following:

#pragma warning disable 123

namespace foo {
}

#pragma warning restore 123

one gets the following non-compilable code:

#pragma warning disable 123
namespace foo {
}#pragma warning restore 123  <--- extra enter erased here, after the closing bracket

Sample repro for the #pragma issue:

using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Formatting;
using static System.Console;
class Program
{
    static void Main(string[] args)
    {
        var tree = SyntaxFactory.ParseSyntaxTree(@"
            #pragma warning disable 123
            namespace foo {
            }
            #pragma warning restore 123
            ");
        WriteLine("NormalizeWhitespace()");
        WriteLine("=====================");
        WriteLine(tree.GetRoot().NormalizeWhitespace().ToFullString());
        WriteLine();
        WriteLine("Formatter.Format()");
        WriteLine("=====================");
        WriteLine(Formatter.Format(tree.GetRoot(), new AdhocWorkspace()).ToFullString());
    }
}

Build & Stage Artifacts using GitHub Actions

Curious if you'd want something like this - I started to add it with the other PR but then realized that was a bad idea :)

I have some pre-existing art for doing it if interested.

Intermittent Exception While Working

While working I get a random error, so far I couldn't figure out a scenario, here is the error window I get:

encourage error

The log has the following entry for the error:

801 2014/07/01 09:37:05.314 Error Editor or Editor Extension System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: index at Microsoft.VisualStudio.Text.NormalizedSnapshotSpanCollection.get_Item(Int32 index) at Microsoft.VisualStudio.Language.Intellisense.Implementation.Helpers.GetEncapsulatingSpan(ITextView textView, ITrackingSpan span1, ITrackingSpan span2) at Microsoft.VisualStudio.Language.Intellisense.Implementation.DefaultSignatureHelpPresenter.ComputePresentationSpan() at Microsoft.VisualStudio.Language.Intellisense.Implementation.DefaultSignatureHelpPresenter.OnSessionSignaturesChanged(Object sender, NotifyCollectionChangedEventArgs e) at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e) at System.Collections.ObjectModel.ReadOnlyObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs args) at System.Collections.ObjectModel.ReadOnlyObservableCollection`1.HandleCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) at Microsoft.VisualStudio.Language.Intellisense.BulkObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) at System.Collections.ObjectModel.ObservableCollection`1.RemoveItem(Int32 index) at Microsoft.VisualStudio.Language.Intellisense.BulkObservableCollection`1.RemoveItem(Int32 index) at System.Collections.ObjectModel.Collection`1.Remove(T item) at Microsoft.VisualStudio.Language.Intellisense.Implementation.SignatureHelpSession.OnCaretPositionChanged(Object sender, CaretPositionChangedEventArgs e) at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.RaiseEvent[TArgs](Object sender, EventHandler`1 eventHandlers, TArgs args)

I hope this is enough to figure out the problem.

Add Icon for the Marketplace

This VSIX doesn't have an icon displayed in the marketplace. The icon should be 90x90.

image

The icon is added to the metadata section of the vsixmanifest, here is the line from the NUnit adapter,

<Icon>nunit_90.png</Icon>

In the CSPROJ, the icon should be set to IncludeInVsix=true

You can set a 200x200 preview image the same way, but it isn't displayed in VS2017 anymore, just previous versions.

Any ideas for an icon? Speech bubble with an exclamation point?

Not working in visual studio 2017

I saw the closed ticket: #40 and it was closed because someone didn't want to test with resharper. I can confirm that with resharper ultimate that it does not work on files like .cs or .cshtml. I did notice that it worked in a web.config file however. I am also using visual studio 2017 15.7.4 on windows 10 and resharper JetBrains ReSharper Ultimate 2018.1.2 Build 112.0.20180530.113618

I would be interested in investigating this further!

Uses syntax highlighting?

One of my "discouragements" has the word this in it

initialhighlight

when shown on top of a C# file, the discouragement seemed to have syntax highlighting. To confirm, I replaced my list of encouragements with nonsense that would syntax highlight

testencouragelist

and they as well seem to syntax highlight.

moresyntax

Is this by design?

What's the right way to do this?

Hey @jaredpar, I hope you don't mind another VS question. I'm trying to write a stupid silly extension that will show a tool tip wherever the cursor is when you save your document.

Seems pretty simple, eh?

I thought I'd try to leverage the QuickInfo stuff because it provides the right tooltip behavior. But I can't seem to trigger it programmatically on save. Also, it seems intrinsically tied to mouse hover.

Am I going about this totally wrong? Got any suggestions for how I should be doing this?

Add Visual Studio 2017 Support

The RC and RTM releases of Visual Studio require v3 VSIX format, so the previous changes to enable support no longer work. The following is the screenshot from the marketplace,

image

Converting the VSIX to v3 format is easy, add Prerequisites,

<Prerequisites>
  <Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0.25904.2,16.0)" DisplayName="Visual Studio core editor" />
</Prerequisites>

This allows Visual Studio to install missing components if required. This extension likely doesn't need much more than the shell/core editor, so the code above is fine.

Not installing in VS 2017

VS 2017 Enterprise (ver 15.4.4)
Error and log for it attached

image

27.11.2017 18:33:33 - Microsoft VSIX Installer
27.11.2017 18:33:33 - -------------------------------------------
27.11.2017 18:33:33 - Initializing Install...
27.11.2017 18:33:33 - Extension Details...
27.11.2017 18:33:33 - Identifier : f38d29e7-cd86-43d5-9c32-4be26302b55e
27.11.2017 18:33:33 - Name : Encourage
27.11.2017 18:33:33 - Author : Phil Haack
27.11.2017 18:33:33 - Version : 1.2.1
27.11.2017 18:33:33 - Description : Adds a bit of whimsy to your work day.
27.11.2017 18:33:33 - Locale : en-US
27.11.2017 18:33:33 - MoreInfoURL : https://github.com/haacked/encourage
27.11.2017 18:33:33 - InstalledByMSI : False
27.11.2017 18:33:33 - SupportedFrameworkVersionRange : [4.5,)
27.11.2017 18:33:33 -
27.11.2017 18:33:33 - Supported Products :
27.11.2017 18:33:33 - Microsoft.VisualStudio.Community
27.11.2017 18:33:33 - Version : [11.0,15.0]
27.11.2017 18:33:33 -
27.11.2017 18:33:33 - References :
27.11.2017 18:33:33 - -------------------------------------------------------
27.11.2017 18:33:33 - Identifier : Microsoft.VisualStudio.MPF.11.0
27.11.2017 18:33:33 - Name : Visual Studio MPF 11.0
27.11.2017 18:33:33 - Version : [11.0]
27.11.2017 18:33:33 - MoreInfoURL :
27.11.2017 18:33:33 - Nested : No
27.11.2017 18:33:33 -
27.11.2017 18:33:33 -
27.11.2017 18:33:33 - Searching for applicable products...
27.11.2017 18:33:33 - Found installed product - Global Location
27.11.2017 18:33:33 - Found installed product - ssms
27.11.2017 18:33:33 - VSIXInstaller.NoApplicableSKUsException: This extension is not installable on any currently installed products.
в VSIXInstaller.App.InitializeInstall(Boolean isRepairSupported)
в VSIXInstaller.App.InitializeInstall()
в System.Threading.Tasks.Task.InnerInvoke()
в System.Threading.Tasks.Task.Execute()

Support for VS2013?

Encourage, what a sweet extension.
Tried to install on 'Microsoft Visual Studio Ultimate 2013'. Got 'VSIXInstaller.NoApplicableSKUsException'.
The logfile explains that supported products are 'Microsoft.VisualStudio.Community [11.0,15.0]', and thus I am out of luck. Is this by design or would you be willing to fix this? Thank so much in advance! Way to go!! :)

VSIXInstaller_log.txt

Encouragements are displayed in the wrong window

I have two monitors. Sometimes I tear out a tab from the main window Visual Studio and put it on the other monitor. When I do this and hit save in the main window, the encouragement appears on the other monitor.

Note: I could reproduce this with both cs and js files.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.