/com.tsk.ide.vscode

Enhance your Unity development workflow with seamless code editor integration for VSCode.

Primary LanguageC#

TSK VSCode Editor

openupm Discord

Code editor integration for VSCode. (2021.3+)

See Changelog.

If you find my package useful, please consider giving it a Star 🌟 to show your support. Thank you!

Features

Project SDK Support

This package offers comprehensive project SDK support based on .Net 7 and .Net 6 standards. By leveraging this support, you can utilize the latest C# features and language enhancements within your Unity projects, subject to Unity's compatibility.

Organized .csproj Files

To enhance project structure and maintain cleanliness, the com.tsk.ide.vscode package facilitates the automatic separation of .csproj files into individual folders. These folders are consolidated within a main directory named "CSProjFolders." This organization ensures a more streamlined and organized project structure, contributing to improved clarity and ease of navigation.

Successful Dotnet Build

The com.tsk.ide.vscode package ensures a seamless build process by guaranteeing successful execution of the dotnet build command. This means that your project can be compiled and built without any issues, ensuring a smooth development experience.

Microsoft.Unity.Analyzers Integration NuGet

In addition to its core features, this package includes seamless integration with the Microsoft.Unity.Analyzers library. This integration provides you with access to a wide range of code analysis and validation tools specifically designed for Unity projects. With the support of these analyzers, you can enhance code quality, identify potential issues, and adhere to best practices, ultimately improving the overall robustness and maintainability of your Unity projects.

Automated Configuration Setup

The com.tsk.ide.vscode package provides a professional solution for effortlessly setting up Visual Studio Code to seamlessly integrate with Unity. It automates the generation of essential configuration files, namely omnisharp.json and .editorconfig, sparing you valuable time and effort that would otherwise be spent on manual setup.

Enable the Full Potential of Modern .NET

By eliminating the need to disable the use of ModernNet, you can effortlessly access the complete range of modern .NET features within your Unity projects. This seamless integration unlocks a multitude of benefits, including enhanced performance and improved stability, empowering you to optimize your projects like never before.

Customization Options with Externals Tools

Furthermore, the package introduces a dedicated configuration section within External Tools. This empowers users to exercise complete control over the settings files generated by the package, allowing for manual customization to accommodate individual preferences and project-specific requirements. With this added flexibility, you can fine-tune your development environment to achieve optimal results.

Prerequisites

  1. Install both the .Net 7 and .Net 6 SDKs - https://dotnet.microsoft.com/en-us/download
  2. Crossroad choice between Omnisharp (Unsupported) or C# Devkit (Preview but supported by Microsoft)

Windows Only

  • Logout or restart Windows to allow changes to %PATH% to take effect.
  • The C# extension no longer ships with Microsoft Build Tools, so they must be installed manually.

MacOS Only

  • To avoid seeing "Some projects have trouble loading. Please review the output for more details", make sure to install the latest stable Mono release.
  • If you aren't using C# Devkit, do the following:
    1. In your Visual Studio Code (VS Code) user settings, ensure that the configuration "omnisharp.useModernNet": is set to false. This configuration must be in place to prevent VS Code from utilizing the Mono version included in the official C# extension (specifically, version 6.0.X as of the latest release).
    2. Upon installing the latest version of Mono directly, set the following configuration value: "omnisharp.monoPath": "/Library/Frameworks/Mono.framework/Versions/Current"
      • Ensure you replace the provided path with the location where you installed Mono. By doing so, VS Code will strictly utilize the newly installed version of Mono for all operations.

Install via Package Manager

Unity

  • Open Window/Package Manager
  • Click +
  • Select Add package from git URL
  • Paste https://github.com/Chizaruu/com.tsk.ide.vscode.git#upm into URL
  • Click Add

OpenUPM

Please follow the instrustions:

  • Open Edit/Project Settings/Package Manager
  • Add a new Scoped Registry (or edit the existing OpenUPM entry)
  Name: package.openupm.com
  URL: https://package.openupm.com
  Scope(s): com.tsk.ide.vscode
  • Click Save (or Apply)
  • Open Window/Package Manager
  • Click +
  • Select Add package by name... or Add package from git URL...
  • Paste com.tsk.ide.vscode into name
  • Paste 1.4.2 into version
  • Click Add

Alternatively, merge the snippet to Packages/manifest.json

{
    "scopedRegistries": [
        {
            "name": "package.openupm.com",
            "url": "https://package.openupm.com",
            "scopes": ["com.tsk.ide.vscode"]
        }
    ],
    "dependencies": {
        "com.tsk.ide.vscode": "1.4.2"
    }
}

Post Installation

After installing the package, follow these steps to regenerate the .csproj files:

  1. Open the Preferences window.
  2. Go to the External Tools tab.
  3. Click on the Regenerate .csproj Files option.

Please note that any previously existing configuration files will be overwritten during the package installation.

Extras

  • To enable grammar and highlighting for jslib files, install the jslib-for-unity package.

Contributing

Thank you for considering contributing to the com.tsk.ide.vscode package! To contribute, please follow these guidelines:

  • Create a new branch for your changes.
  • Discuss your changes by creating a new issue in the repository before starting work.
  • Follow the existing coding conventions and style.
  • Provide a clear description of your changes in your pull request.
  • Submit your pull request to the default branch.

We appreciate all contributions to com.tsk.ide.vscode!