npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

resharper-vs-code-bridge

v0.0.4

Published

Bridges the gap between the ReSharper CLI's code inspection tools and Visual Studio Code's Problem Matchers to allow ReSharper issues to be exposed in the Visual Studio Code IDE

Downloads

6

Readme

ReSharper -> VS Code Bridge

This is an extremely shabby attempt at getting ReSharper's inspections into Visual Studio Code now that JetBrains have expressed no interest in bringing ReSharper across officially.

Usage

  1. Install as a dev dependency: npm i -D resharper-vs-code-bridge
  2. Download the ReSharper Command Line Tools from https://www.jetbrains.com/resharper/download/#section=resharper-clt
  3. Extract the tools to a known location and add that directory to your system's PATH variable. Note: This must be added to either the system's PATH or the PATH of the user that runs your VS Code tasks
  4. Add a task to your .vscode\tasks.json as follows:
{
    "label": "inspect",
    "command": "node",
    "type": "process",
    "args": [
        "node_modules\\resharper-vs-code-bridge",
        "MySolution.sln"
    ],
    "problemMatcher": {
        "owner": "resharper-vs-code-bridge",
        "fileLocation": [
            "relative",
            "${workspaceFolder}"
        ],
        "pattern": {
            "regexp": "Code=\"(.+?)\" Severity=\"(.+?)\" File=\"(.+?)\" Line=\"(.+?)\" Message=\"(.+?)\"",
            "code": 1,
            "severity": 2,
            "file": 3,
            "line": 4,
            "message": 5
        }
    }
}
  1. Run the inspect task from the Tasks -> Run Task... menu in VS Code

How it works

The task itself simply runs the resharper-vs-code-bridge NodeJS package, listens for output on STDOUT and then parses it with the provided regex pattern in order to extract code inspection issues and pass them to the IDE.

The package takes one required argument and another optional one. For example:

node node_modules\\resharper-vs-code-bridge MySolution.sln InspectCode.exe

Where:

  • MySolution.sln is a required argument defining the path to the solution to inspect relative to the root of your workspace
  • InspectCode.exe is an optional argument (default value is InspectCode.exe) that defines where the package can find ReSharper's executable. This is not required if the PATH was set up as explained above.

The package then does the following:

  1. Runs InspectCode.exe for the solution you defined and outputs the report as a temporary XML file in the root of your workspace
  2. Reads and parses this temporary report in order to collate metadata about each issue into a more suitable format for output to VS Code
  3. Removes the temporary report file
  4. Outputs the modified report onto STDOUT in the format specified in the task's pattern
  5. VS Code then reads this output, runs the regex against it and ends up with a list of inspection issues that it can display in the IDE

Known Limitations

  • It's far too slow for any automated approach, because of this I've not put any effort into writing an extension to run the inspections automatically as you code
  • Resulting inspection issues do not expose the exact columns of the errors, instead you'll see a squiggly across the whole line. More fine grained reporting is possible, but has not been implemented in this MVP
  • No support for specifying the minimum severity ReSharper will report on, currently it will show Suggestions and upwards (i.e. hints are ignored)