├── README.md
├── art
├── dialog.png
└── context-menu.png
├── src
├── Resources
│ ├── Icon.png
│ ├── Images.png
│ └── Preview.png
├── Properties
│ └── AssemblyInfo.cs
├── source.extension.cs
├── source.extension.vsixmanifest
├── GeneratorDialog.xaml
├── Helpers
│ └── ProjectHelpers.cs
├── TextGenerator.cs
├── TextGenerator.vsct
├── VSPackage.cs
├── GeneratorDialog.xaml.cs
└── TextGenerator.csproj
├── .gitignore
├── .gitattributes
├── LICENSE
├── appveyor.yml
├── TextGenerator.sln
└── CONTRIBUTING.md
/README.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/TextGenerator/HEAD/README.md
--------------------------------------------------------------------------------
/art/dialog.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/TextGenerator/HEAD/art/dialog.png
--------------------------------------------------------------------------------
/art/context-menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/TextGenerator/HEAD/art/context-menu.png
--------------------------------------------------------------------------------
/src/Resources/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/TextGenerator/HEAD/src/Resources/Icon.png
--------------------------------------------------------------------------------
/src/Resources/Images.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/TextGenerator/HEAD/src/Resources/Images.png
--------------------------------------------------------------------------------
/src/Resources/Preview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/TextGenerator/HEAD/src/Resources/Preview.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | packages
2 | node_modules.7z
3 |
4 | # User files
5 | *.suo
6 | *.user
7 | *.sln.docstates
8 | .vs/
9 |
10 | # Build results
11 |
12 | [Dd]ebug/
13 | [Rr]elease/
14 | x64/
15 | [Bb]in/
16 | [Oo]bj/
17 |
18 | # MSTest test Results
19 | [Tt]est[Rr]esult*/
20 | [Bb]uild[Ll]og.*
21 |
22 | # NCrunch
23 | *.ncrunchsolution
24 | *.ncrunchproject
25 | _NCrunch_WebCompiler
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 |
7 | # Standard to msysgit
8 | *.doc diff=astextplain
9 | *.DOC diff=astextplain
10 | *.docx diff=astextplain
11 | *.DOCX diff=astextplain
12 | *.dot diff=astextplain
13 | *.DOT diff=astextplain
14 | *.pdf diff=astextplain
15 | *.PDF diff=astextplain
16 | *.rtf diff=astextplain
17 | *.RTF diff=astextplain
18 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright 2015 Mads Kristensen
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License");
4 | you may not use this file except in compliance with the License.
5 | You may obtain a copy of the License at
6 |
7 | http://www.apache.org/licenses/LICENSE-2.0
8 |
9 | Unless required by applicable law or agreed to in writing, software
10 | distributed under the License is distributed on an "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | See the License for the specific language governing permissions and
13 | limitations under the License.
--------------------------------------------------------------------------------
/src/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 | using MadsKristensen.TextGenerator;
4 |
5 | [assembly: AssemblyTitle(Vsix.Name)]
6 | [assembly: AssemblyDescription(Vsix.Description)]
7 | [assembly: AssemblyConfiguration("")]
8 | [assembly: AssemblyCompany(Vsix.Author)]
9 | [assembly: AssemblyProduct(Vsix.Name)]
10 | [assembly: AssemblyCopyright(Vsix.Author)]
11 | [assembly: AssemblyTrademark("")]
12 | [assembly: AssemblyCulture("")]
13 | [assembly: ComVisible(false)]
14 |
15 | [assembly: AssemblyVersion(Vsix.Version)]
16 | [assembly: AssemblyFileVersion(Vsix.Version)]
--------------------------------------------------------------------------------
/appveyor.yml:
--------------------------------------------------------------------------------
1 | image: Visual Studio 2019
2 |
3 | install:
4 | - ps: (new-object Net.WebClient).DownloadString("https://raw.github.com/madskristensen/ExtensionScripts/master/AppVeyor/vsix.ps1") | iex
5 |
6 | before_build:
7 | - ps: Vsix-IncrementVsixVersion | Vsix-UpdateBuildVersion
8 | - ps: Vsix-TokenReplacement src\source.extension.cs 'Version = "([0-9\\.]+)"' 'Version = "{version}"'
9 |
10 | build_script:
11 | - nuget restore -Verbosity quiet
12 | - msbuild /p:configuration=Release /p:DeployExtension=false /p:ZipPackageCompressionLevel=normal /v:m
13 |
14 | after_test:
15 | - ps: Vsix-PushArtifacts | Vsix-PublishToGallery
--------------------------------------------------------------------------------
/src/source.extension.cs:
--------------------------------------------------------------------------------
1 | // ------------------------------------------------------------------------------
2 | //
3 | // This file was generated by VSIX Synchronizer
4 | //
5 | // ------------------------------------------------------------------------------
6 | namespace MadsKristensen.TextGenerator
7 | {
8 | internal sealed partial class Vsix
9 | {
10 | public const string Id = "0007e9e3-b11a-4d10-8565-9c6ce2ccc286";
11 | public const string Name = "Dummy Text Generator";
12 | public const string Description = @"Easily insert dummy text into the editor in Visual Studio. Lorem Ipsum and other vocabularies are supported.";
13 | public const string Language = "en-US";
14 | public const string Version = "1.2";
15 | public const string Author = "Mads Kristensen";
16 | public const string Tags = "lorum ipsum, strings";
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/TextGenerator.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.24720.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TextGenerator", "src\TextGenerator.csproj", "{5E741B6D-3FFB-4DEA-A2DA-16A9FD66EBF3}"
7 | EndProject
8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C6670977-0655-434A-A0B1-AB39544B3420}"
9 | ProjectSection(SolutionItems) = preProject
10 | appveyor.yml = appveyor.yml
11 | README.md = README.md
12 | EndProjectSection
13 | EndProject
14 | Global
15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
16 | Debug|Any CPU = Debug|Any CPU
17 | Release|Any CPU = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
20 | {5E741B6D-3FFB-4DEA-A2DA-16A9FD66EBF3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {5E741B6D-3FFB-4DEA-A2DA-16A9FD66EBF3}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {5E741B6D-3FFB-4DEA-A2DA-16A9FD66EBF3}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {5E741B6D-3FFB-4DEA-A2DA-16A9FD66EBF3}.Release|Any CPU.Build.0 = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | EndGlobal
29 |
--------------------------------------------------------------------------------
/src/source.extension.vsixmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Dummy Text Generator
6 | Easily insert dummy text into the editor in Visual Studio. Lorem Ipsum and other vocabularies are supported.
7 | https://github.com/madskristensen/textgenerator
8 | Resources\LICENSE
9 | Resources\Icon.png
10 | Resources\Preview.png
11 | lorum ipsum, strings
12 |
13 |
14 |
15 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/src/GeneratorDialog.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/Helpers/ProjectHelpers.cs:
--------------------------------------------------------------------------------
1 | using Microsoft;
2 | using Microsoft.VisualStudio;
3 | using Microsoft.VisualStudio.ComponentModelHost;
4 | using Microsoft.VisualStudio.Editor;
5 | using Microsoft.VisualStudio.Shell;
6 | using Microsoft.VisualStudio.Text.Editor;
7 | using Microsoft.VisualStudio.TextManager.Interop;
8 |
9 | namespace MadsKristensen.TextGenerator
10 | {
11 | static class ProjectHelpers
12 | {
13 | ///Gets the TextView for the active document.
14 | public static IWpfTextView GetCurentTextView()
15 | {
16 | IComponentModel componentModel = GetComponentModel();
17 | if (componentModel == null) return null;
18 | IVsEditorAdaptersFactoryService editorAdapter = componentModel.GetService();
19 | IVsTextView nativeView = GetCurrentNativeTextView();
20 |
21 | if (nativeView != null)
22 | return editorAdapter.GetWpfTextView(nativeView);
23 |
24 | return null;
25 | }
26 |
27 | public static IVsTextView GetCurrentNativeTextView()
28 | {
29 | ThreadHelper.ThrowIfNotOnUIThread();
30 |
31 | var textManager = (IVsTextManager)ServiceProvider.GlobalProvider.GetService(typeof(SVsTextManager));
32 | Assumes.Present(textManager);
33 |
34 | textManager.GetActiveView(1, null, out IVsTextView activeView);
35 | return activeView;
36 | }
37 |
38 | public static IComponentModel GetComponentModel()
39 | {
40 | return (IComponentModel)Package.GetGlobalService(typeof(SComponentModel));
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/TextGenerator.cs:
--------------------------------------------------------------------------------
1 | // ------------------------------------------------------------------------------
2 | //
3 | // This file was generated by Extensibility Tools v1.9.179
4 | //
5 | // ------------------------------------------------------------------------------
6 | namespace MadsKristensen.TextGenerator
7 | {
8 | using System;
9 |
10 | ///
11 | /// Helper class that exposes all GUIDs used across VS Package.
12 | ///
13 | internal sealed partial class PackageGuids
14 | {
15 | public const string guidTextGeneratorPkgString = "0007e9e3-b11a-4d10-8565-9c6ce2ccc286";
16 | public const string guidTextGeneratorCmdSetString = "ea633062-6817-4827-a113-c839f5d878e7";
17 | public const string HtmlCmdSetString = "78f03954-2fb8-4087-8ce7-59d71710b3bb";
18 | public const string CssCmdSetString = "64da400e-b4ad-4d67-aa92-4b7acb01ecd5";
19 | public const string JsonCmdSetString = "f718ca06-cf4f-4a0c-9106-e79e9ee5e7cd";
20 | public const string guidImagesString = "f5ac8b23-8a65-4428-a41c-b7af2747066c";
21 | public static Guid guidTextGeneratorPkg = new Guid(guidTextGeneratorPkgString);
22 | public static Guid guidTextGeneratorCmdSet = new Guid(guidTextGeneratorCmdSetString);
23 | public static Guid HtmlCmdSet = new Guid(HtmlCmdSetString);
24 | public static Guid CssCmdSet = new Guid(CssCmdSetString);
25 | public static Guid JsonCmdSet = new Guid(JsonCmdSetString);
26 | public static Guid guidImages = new Guid(guidImagesString);
27 | }
28 | ///
29 | /// Helper class that encapsulates all CommandIDs uses across VS Package.
30 | ///
31 | internal sealed partial class PackageIds
32 | {
33 | public const int cmdGenerate = 0x0100;
34 | public const int htmlClipboard = 0x0064;
35 | public const int cssClipboard = 0x0064;
36 | public const int jsonClipboard = 0x0064;
37 | public const int abc = 0x0001;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/TextGenerator.vsct:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/src/VSPackage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel.Design;
3 | using System.Runtime.InteropServices;
4 | using System.Threading;
5 | using System.Windows;
6 | using EnvDTE;
7 | using EnvDTE80;
8 | using Microsoft;
9 | using Microsoft.VisualStudio.Shell;
10 | using Microsoft.VisualStudio.Text.Editor;
11 | using Task = System.Threading.Tasks.Task;
12 |
13 | namespace MadsKristensen.TextGenerator
14 | {
15 |
16 | [PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
17 | [InstalledProductRegistration("#110", "#112", Vsix.Version, IconResourceID = 400)]
18 | [ProvideMenuResource("Menus.ctmenu", 1)]
19 | [Guid(PackageGuids.guidTextGeneratorPkgString)]
20 | public sealed class VSPackage : AsyncPackage
21 | {
22 | protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress progress)
23 | {
24 | await JoinableTaskFactory.SwitchToMainThreadAsync();
25 |
26 | var mcs = await GetServiceAsync(typeof(IMenuCommandService)) as OleMenuCommandService;
27 | Assumes.Present(mcs);
28 |
29 | var commandId = new CommandID(PackageGuids.guidTextGeneratorCmdSet, PackageIds.cmdGenerate);
30 | var command = new MenuCommand(Execute, commandId);
31 | mcs.AddCommand(command);
32 | }
33 |
34 | private void Execute(object sender, EventArgs e)
35 | {
36 | IWpfTextView view = ProjectHelpers.GetCurentTextView();
37 |
38 | if (view != null)
39 | {
40 | var dte = (DTE2)GetService(typeof(DTE));
41 | var text = GetText();
42 |
43 | if (!string.IsNullOrEmpty(text))
44 | {
45 | InsertText(view, dte, text);
46 | }
47 | }
48 | }
49 |
50 | private string GetText()
51 | {
52 | ThreadHelper.ThrowIfNotOnUIThread();
53 | var dialog = new GeneratorDialog(this, 0)
54 | {
55 | Owner = Application.Current.MainWindow
56 | };
57 |
58 | var result = dialog.ShowDialog();
59 |
60 | if (result.HasValue && result.Value)
61 | {
62 | if (result.HasValue && result.Value)
63 | {
64 | return dialog.Text;
65 | }
66 | }
67 |
68 | return null;
69 | }
70 |
71 | private static void InsertText(IWpfTextView view, DTE2 dte, string text)
72 | {
73 | ThreadHelper.ThrowIfNotOnUIThread();
74 |
75 | try
76 | {
77 | dte.UndoContext.Open("Generate text");
78 |
79 | using (Microsoft.VisualStudio.Text.ITextEdit edit = view.TextBuffer.CreateEdit())
80 | {
81 | if (!view.Selection.IsEmpty)
82 | {
83 | edit.Delete(view.Selection.SelectedSpans[0].Span);
84 | view.Selection.Clear();
85 | }
86 |
87 | edit.Insert(view.Caret.Position.BufferPosition, text);
88 | edit.Apply();
89 | }
90 | }
91 | catch (Exception ex)
92 | {
93 | System.Diagnostics.Debug.Write(ex);
94 | }
95 | finally
96 | {
97 | dte.UndoContext.Close();
98 | }
99 | }
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/src/GeneratorDialog.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Text;
3 | using System.Windows;
4 | using System.Windows.Input;
5 | using System.Windows.Media.Imaging;
6 | using Microsoft.VisualStudio.Settings;
7 | using Microsoft.VisualStudio.Shell.Settings;
8 | using NLipsum.Core;
9 |
10 | namespace MadsKristensen.TextGenerator
11 | {
12 | public partial class GeneratorDialog : Window
13 | {
14 | private SettingsManager _settings;
15 |
16 | public GeneratorDialog(IServiceProvider serviceProvider, int length)
17 | {
18 | InitializeComponent();
19 |
20 | Loaded += (s, e) =>
21 | {
22 | _settings = new ShellSettingsManager(serviceProvider);
23 | Icon = BitmapFrame.Create(new Uri("pack://application:,,,/TextGenerator;component/Resources/images.png", UriKind.RelativeOrAbsolute));
24 |
25 | Title = Vsix.Name;
26 |
27 | SetLipsumTypes();
28 | SetSelection();
29 |
30 | txLength.Text = (length == 0 ? 20 : length).ToString();
31 | txLength.Focus();
32 | txLength.SelectAll();
33 | };
34 |
35 | PreviewKeyDown += (a, b) =>
36 | {
37 | if (b.Key == Key.Escape)
38 | Close();
39 | };
40 | }
41 |
42 | public string Text { get; private set; }
43 |
44 | private void SetSelection()
45 | {
46 | try
47 | {
48 | SettingsStore store = _settings.GetReadOnlySettingsStore(SettingsScope.UserSettings);
49 | int index = store.GetInt32(Vsix.Name, "type", 0);
50 | cbType.SelectedIndex = index;
51 | }
52 | catch (Exception ex)
53 | {
54 | System.Diagnostics.Debug.Write(ex);
55 | }
56 | }
57 |
58 | private void SaveSelection()
59 | {
60 | try
61 | {
62 | WritableSettingsStore wstore = _settings.GetWritableSettingsStore(SettingsScope.UserSettings);
63 |
64 | if (!wstore.CollectionExists(Vsix.Name))
65 | wstore.CreateCollection(Vsix.Name);
66 |
67 | wstore.SetInt32(Vsix.Name, "type", cbType.SelectedIndex);
68 | }
69 | catch (Exception ex)
70 | {
71 | System.Diagnostics.Debug.Write(ex);
72 | }
73 | }
74 |
75 | private void SetLipsumTypes()
76 | {
77 | Type type = typeof(Lipsums);
78 |
79 | foreach (System.Reflection.PropertyInfo p in type.GetProperties())
80 | {
81 | string name = Prettify(p.Name);
82 | cbType.Items.Add(name);
83 | }
84 | }
85 |
86 | private string Prettify(string text)
87 | {
88 | var sb = new StringBuilder();
89 |
90 | foreach (char c in text)
91 | {
92 | if (char.IsUpper(c))
93 | sb.Append(" ");
94 |
95 | sb.Append(c);
96 | }
97 |
98 | return sb.ToString().Trim();
99 | }
100 |
101 | private void btnOk_Click(object sender, RoutedEventArgs e)
102 | {
103 | SaveSelection();
104 |
105 | if (int.TryParse(txLength.Text, out int length))
106 | {
107 | Type type = typeof(Lipsums);
108 | string propName = ((string)cbType.SelectedItem).Replace(" ", string.Empty);
109 | System.Reflection.PropertyInfo prop = type.GetProperty(propName);
110 | string vocab = (string)prop.GetValue(null, null);
111 |
112 | var generator = new LipsumGenerator(vocab, false);
113 | string[] words = generator.GenerateWords(length);
114 |
115 | Text = UppercaseFirst(string.Join(" ", words));
116 |
117 | DialogResult = true;
118 | }
119 | }
120 |
121 | static string UppercaseFirst(string s)
122 | {
123 | if (string.IsNullOrEmpty(s))
124 | {
125 | return string.Empty;
126 | }
127 |
128 | return char.ToUpper(s[0]) + s.Substring(1);
129 | }
130 | }
131 | }
132 |
--------------------------------------------------------------------------------
/src/TextGenerator.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(VisualStudioVersion)
5 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
6 | Program
7 | $(DevEnvDir)\devenv.exe
8 | /rootsuffix Exp
9 |
10 |
11 |
12 |
13 |
14 |
15 | Debug
16 | AnyCPU
17 | 2.0
18 | {5E741B6D-3FFB-4DEA-A2DA-16A9FD66EBF3}
19 | {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
20 | Library
21 | Properties
22 | MadsKristensen.TextGenerator
23 | TextGenerator
24 | v4.6
25 |
26 |
27 | true
28 | full
29 | false
30 | bin\Debug\
31 | DEBUG;TRACE
32 | prompt
33 | 4
34 |
35 |
36 | pdbonly
37 | true
38 | bin\Release\
39 | TRACE
40 | prompt
41 | 4
42 | true
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 | GeneratorDialog.xaml
60 |
61 |
62 |
63 | True
64 | True
65 | source.extension.vsixmanifest
66 |
67 |
68 | True
69 | True
70 | TextGenerator.vsct
71 |
72 |
73 |
74 |
75 |
76 |
77 | Resources\LICENSE
78 | true
79 |
80 |
81 | Designer
82 | VsixManifestGenerator
83 | source.extension.cs
84 |
85 |
86 |
87 |
88 | Menus.ctmenu
89 | VsctGenerator
90 | TextGenerator.cs
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 | true
99 |
100 |
101 | true
102 |
103 |
104 |
105 |
106 | Designer
107 | MSBuild:Compile
108 |
109 |
110 |
111 |
112 |
113 | 17.0.2120-preview2
114 | runtime; build; native; contentfiles; analyzers
115 | all
116 |
117 |
118 | 1.1.0
119 |
120 |
121 |
122 | true
123 |
124 |
125 |
126 |
133 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | Looking to contribute something? **Here's how you can help.**
4 |
5 | Please take a moment to review this document in order to make the contribution
6 | process easy and effective for everyone involved.
7 |
8 | Following these guidelines helps to communicate that you respect the time of
9 | the developers managing and developing this open source project. In return,
10 | they should reciprocate that respect in addressing your issue or assessing
11 | patches and features.
12 |
13 |
14 | ## Using the issue tracker
15 |
16 | The issue tracker is the preferred channel for [bug reports](#bug-reports),
17 | [features requests](#feature-requests) and
18 | [submitting pull requests](#pull-requests), but please respect the
19 | following restrictions:
20 |
21 | * Please **do not** use the issue tracker for personal support requests. Stack
22 | Overflow is a better place to get help.
23 |
24 | * Please **do not** derail or troll issues. Keep the discussion on topic and
25 | respect the opinions of others.
26 |
27 | * Please **do not** open issues or pull requests which *belongs to* third party
28 | components.
29 |
30 |
31 | ## Bug reports
32 |
33 | A bug is a _demonstrable problem_ that is caused by the code in the repository.
34 | Good bug reports are extremely helpful, so thanks!
35 |
36 | Guidelines for bug reports:
37 |
38 | 1. **Use the GitHub issue search** — check if the issue has already been
39 | reported.
40 |
41 | 2. **Check if the issue has been fixed** — try to reproduce it using the
42 | latest `master` or development branch in the repository.
43 |
44 | 3. **Isolate the problem** — ideally create an
45 | [SSCCE](http://www.sscce.org/) and a live example.
46 | Uploading the project on cloud storage (OneDrive, DropBox, et el.)
47 | or creating a sample GitHub repository is also helpful.
48 |
49 |
50 | A good bug report shouldn't leave others needing to chase you up for more
51 | information. Please try to be as detailed as possible in your report. What is
52 | your environment? What steps will reproduce the issue? What browser(s) and OS
53 | experience the problem? Do other browsers show the bug differently? What
54 | would you expect to be the outcome? All these details will help people to fix
55 | any potential bugs.
56 |
57 | Example:
58 |
59 | > Short and descriptive example bug report title
60 | >
61 | > A summary of the issue and the Visual Studio, browser, OS environments
62 | > in which it occurs. If suitable, include the steps required to reproduce the bug.
63 | >
64 | > 1. This is the first step
65 | > 2. This is the second step
66 | > 3. Further steps, etc.
67 | >
68 | > `` - a link to the project/file uploaded on cloud storage or other publicly accessible medium.
69 | >
70 | > Any other information you want to share that is relevant to the issue being
71 | > reported. This might include the lines of code that you have identified as
72 | > causing the bug, and potential solutions (and your opinions on their
73 | > merits).
74 |
75 |
76 | ## Feature requests
77 |
78 | Feature requests are welcome. But take a moment to find out whether your idea
79 | fits with the scope and aims of the project. It's up to *you* to make a strong
80 | case to convince the project's developers of the merits of this feature. Please
81 | provide as much detail and context as possible.
82 |
83 |
84 | ## Pull requests
85 |
86 | Good pull requests, patches, improvements and new features are a fantastic
87 | help. They should remain focused in scope and avoid containing unrelated
88 | commits.
89 |
90 | **Please ask first** before embarking on any significant pull request (e.g.
91 | implementing features, refactoring code, porting to a different language),
92 | otherwise you risk spending a lot of time working on something that the
93 | project's developers might not want to merge into the project.
94 |
95 | Please adhere to the [coding guidelines](#code-guidelines) used throughout the
96 | project (indentation, accurate comments, etc.) and any other requirements
97 | (such as test coverage).
98 |
99 | Adhering to the following process is the best way to get your work
100 | included in the project:
101 |
102 | 1. [Fork](http://help.github.com/fork-a-repo/) the project, clone your fork,
103 | and configure the remotes:
104 |
105 | ```bash
106 | # Clone your fork of the repo into the current directory
107 | git clone https://github.com//.git
108 | # Navigate to the newly cloned directory
109 | cd
110 | # Assign the original repo to a remote called "upstream"
111 | git remote add upstream https://github.com/madskristensen/.git
112 | ```
113 |
114 | 2. If you cloned a while ago, get the latest changes from upstream:
115 |
116 | ```bash
117 | git checkout master
118 | git pull upstream master
119 | ```
120 |
121 | 3. Create a new topic branch (off the main project development branch) to
122 | contain your feature, change, or fix:
123 |
124 | ```bash
125 | git checkout -b
126 | ```
127 |
128 | 4. Commit your changes in logical chunks. Please adhere to these [git commit
129 | message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
130 | or your code is unlikely be merged into the main project. Use Git's
131 | [interactive rebase](https://help.github.com/articles/interactive-rebase)
132 | feature to tidy up your commits before making them public. Also, prepend name of the feature
133 | to the commit message. For instance: "SCSS: Fixes compiler results for IFileListener.\nFixes `#123`"
134 |
135 | 5. Locally merge (or rebase) the upstream development branch into your topic branch:
136 |
137 | ```bash
138 | git pull [--rebase] upstream master
139 | ```
140 |
141 | 6. Push your topic branch up to your fork:
142 |
143 | ```bash
144 | git push origin
145 | ```
146 |
147 | 7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/)
148 | with a clear title and description against the `master` branch.
149 |
150 |
151 | ## Code guidelines
152 |
153 | - Always use proper indentation.
154 | - In Visual Studio under `Tools > Options > Text Editor > C# > Advanced`, make sure
155 | `Place 'System' directives first when sorting usings` option is enabled (checked).
156 | - Before committing, organize usings for each updated C# source file. Either you can
157 | right-click editor and select `Organize Usings > Remove and sort` OR use extension
158 | like [BatchFormat](http://visualstudiogallery.msdn.microsoft.com/a7f75c34-82b4-4357-9c66-c18e32b9393e).
159 | - Before committing, run Code Analysis in `Debug` configuration and follow the guidelines
160 | to fix CA issues. Code Analysis commits can be made separately.
161 |
--------------------------------------------------------------------------------