Skip to content

Latest commit

 

History

History
83 lines (54 loc) · 4 KB

CONTRIBUTE.md

File metadata and controls

83 lines (54 loc) · 4 KB

build and test workflow

Codiga Visual Studio Extension

Codiga extension for Visual Studio for the fastest code analysis and code snippets management.

Table of contents

  1. Environment setup
  2. Getting started
    1. Debugging with the VS experimental instance
    2. Build and test from CLI
  3. Development

Environment setup

To get started with VSIX development I recommend watching this video.

Prerequisites

Getting started

Debugging with the VS experimental instance

This section describes how you can build and debug the extension with the experimental instance of Visual Studio.

Start the experimental instance

  1. Open Extension.sln with Visual Studio
  2. Hit Ctrl + F5 to bring up the experimental instance

The experimental instance will have the extension automatically installed and updated.

Always check that you don't have a installation of the extension from the marketplace in your experimental instance. If the id changed it can happen that you have two versions of the same extension which will result in conflicts.

If you encounter an error dialog saying A project with Output Type of Class Library cannot be started directly., make sure to set the Extension project as the startup project in the Solution settings. Here's an article to help you with that: https://ourcodeworld.com/articles/read/194/a-project-with-an-output-type-of-class-library-cannot-be-started-directly

Resetting/cleaning the experimental instance

If you are looking to change the default settings values, you will probably need to reset the VS experimental instance to see it taking effect. You can find details about it here:

Alternatively, you can just delete the mentioned directory.

Test out the extension

To see how the extension is working create or open a .cs-File and type . anywhere to bring up the shortcut completion window. The extension should also appear under Extensions -> Manage Extensions -> Installed.

Run unit tests in Visual Studio

To run the unit tests with the Visual Studio Test Explorer just right click the Test.csproj and hit Run Tests.

Build and test from CLI

This section describes how you can build and test the extension with your local Visual Studio installation. Building Visual Studio extension with the dotnet command is not supported yet.

Prerequisites

MSBuild can be found in this folder for a standard installation:

C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin

You might want to add this folder to your PATH.

Build the extension

To build the extension navigate to the project root and execute

msbuild .\Extension.sln

Run unit tests

To run the unit tests execute

nunit3-console .\src\Tests\Tests.csproj

Install the extension

Navigate to the project root and double click

bin\Debug\Extension.vsix .

This will install the extension to your local Visual Studio installation.