diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..7aa1ec4d8 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +* text=auto + +# Preserve line endings in gradle scripts +gradlew* -text diff \ No newline at end of file diff --git a/Docs/EditorsAndCICD.md b/Docs/EditorsAndCICD.md index 96a3b94be..d3b430490 100644 --- a/Docs/EditorsAndCICD.md +++ b/Docs/EditorsAndCICD.md @@ -3,17 +3,8 @@ Check out [WillFuqua.RunOnSave](https://marketplace.visualstudio.com/items?itemName=WillFuqua.RunOnSave) ### Visual Studio Code Use the [official extension](https://marketplace.visualstudio.com/items?itemName=csharpier.csharpier-vscode) - - ### Rider -1. Open Settings -2. Tools - File Watchers -3. Add New File Watcher - * File Type: C# File - * Program: dotnet - * Arguments: csharpier $FilePath$ - * Output paths to refresh: $FilePath$ - * Advanced Options - Auto-save edited files...: This should probably be off otherwise if you pause while coding csharpier will reformat the file as is. +Use the [official plugin](https://plugins.jetbrains.com/plugin/18243-csharpier) ## Continuous Integration Normally when using a code formatter like CSharpier, you'll want to ensure that all code that makes it to your main branch has been formatted. This can be accomplished by doing the following diff --git a/Src/CSharpier.Cli/Program.cs b/Src/CSharpier.Cli/Program.cs index d9c9efa1a..11d5d87ca 100644 --- a/Src/CSharpier.Cli/Program.cs +++ b/Src/CSharpier.Cli/Program.cs @@ -1,5 +1,6 @@ using System.CommandLine; using System.CommandLine.Invocation; +using System.Diagnostics; using System.IO.Abstractions; using System.Text; using Microsoft.Extensions.Logging; @@ -27,6 +28,7 @@ public static async Task Run( CancellationToken cancellationToken ) { + Log("Starting"); var console = new SystemConsole(); var logger = new ConsoleLogger(console); @@ -80,6 +82,23 @@ CancellationToken cancellationToken ); } + // this is used for troubleshooting new IDE plugins and can eventually go away. + [Conditional("DEBUG")] + private static void Log(string message) + { + try + { + File.AppendAllText( + @"C:\projects\csharpier\Src\CSharpier.Cli\bin\Debug\net6.0\log.txt", + message + "\n" + ); + } + catch (Exception) + { + // we don't care if this fails + } + } + private static async Task PipeMultipleFiles( SystemConsole console, ILogger logger, @@ -106,8 +125,10 @@ CancellationToken cancellationToken return exitCode; } var character = Convert.ToChar(value); + Log("Got " + character); if (character == '\u0003') { + Log("Got EOF"); break; } diff --git a/Src/CSharpier.Rider/.gitignore b/Src/CSharpier.Rider/.gitignore new file mode 100644 index 000000000..e2e5d94ec --- /dev/null +++ b/Src/CSharpier.Rider/.gitignore @@ -0,0 +1,4 @@ +.gradle +.idea +.qodana +build diff --git a/Src/CSharpier.Rider/.run/Run IDE for UI Tests.run.xml b/Src/CSharpier.Rider/.run/Run IDE for UI Tests.run.xml new file mode 100644 index 000000000..9b028c303 --- /dev/null +++ b/Src/CSharpier.Rider/.run/Run IDE for UI Tests.run.xml @@ -0,0 +1,22 @@ + + + + + + + + true + true + false + + + \ No newline at end of file diff --git a/Src/CSharpier.Rider/.run/Run IDE with Plugin.run.xml b/Src/CSharpier.Rider/.run/Run IDE with Plugin.run.xml new file mode 100644 index 000000000..d15ff681a --- /dev/null +++ b/Src/CSharpier.Rider/.run/Run IDE with Plugin.run.xml @@ -0,0 +1,24 @@ + + + + + + + + true + true + false + + + \ No newline at end of file diff --git a/Src/CSharpier.Rider/.run/Run Plugin Tests.run.xml b/Src/CSharpier.Rider/.run/Run Plugin Tests.run.xml new file mode 100644 index 000000000..ae9ae135c --- /dev/null +++ b/Src/CSharpier.Rider/.run/Run Plugin Tests.run.xml @@ -0,0 +1,24 @@ + + + + + + + + true + true + false + + + diff --git a/Src/CSharpier.Rider/.run/Run Plugin Verification.run.xml b/Src/CSharpier.Rider/.run/Run Plugin Verification.run.xml new file mode 100644 index 000000000..3a8d68859 --- /dev/null +++ b/Src/CSharpier.Rider/.run/Run Plugin Verification.run.xml @@ -0,0 +1,26 @@ + + + + + + + + true + true + false + + + + \ No newline at end of file diff --git a/Src/CSharpier.Rider/.run/Run Qodana.run.xml b/Src/CSharpier.Rider/.run/Run Qodana.run.xml new file mode 100644 index 000000000..9603583a2 --- /dev/null +++ b/Src/CSharpier.Rider/.run/Run Qodana.run.xml @@ -0,0 +1,26 @@ + + + + + + + + true + true + false + + + \ No newline at end of file diff --git a/Src/CSharpier.Rider/CHANGELOG.md b/Src/CSharpier.Rider/CHANGELOG.md new file mode 100644 index 000000000..4f94e03d8 --- /dev/null +++ b/Src/CSharpier.Rider/CHANGELOG.md @@ -0,0 +1,17 @@ + + +# csharpier-rider Changelog + +## [Unreleased] + +## [1.0.3] +- Add logo + +## [1.0.2] +- Fix bug where reformat on save can't find project for file + +## [1.0.1] +- Initial Release +- Action for Reformat +- Setting for Reformat on Save +- Support for leaving csharpier >= 0.12.0 running for faster formatting \ No newline at end of file diff --git a/Src/CSharpier.Rider/CONTRIBUTING.md b/Src/CSharpier.Rider/CONTRIBUTING.md new file mode 100644 index 000000000..101448988 --- /dev/null +++ b/Src/CSharpier.Rider/CONTRIBUTING.md @@ -0,0 +1,11 @@ +Useful links +- https://github.com/JetBrains/intellij-platform-plugin-template +- https://plugins.jetbrains.com/docs/intellij/welcome.html +- https://developerlife.com/2021/03/13/ij-idea-plugin-advanced/ + +Local testing +- use Run Plugin to run plugin in intellij + - there may be a way to run it in rider - https://jetbrains-platform.slack.com/archives/C5NMWKBJ4/p1640080931056300 +- Run .\gradlew.bat :buildPlugin to create plugin so that it can be used in rider, + - may need to change version number in gradle.properties + - go to settings - plugins - install manually - Src\CSharpier.Rider\build\distributions \ No newline at end of file diff --git a/Src/CSharpier.Rider/README.md b/Src/CSharpier.Rider/README.md new file mode 100644 index 000000000..e3de1b3d5 --- /dev/null +++ b/Src/CSharpier.Rider/README.md @@ -0,0 +1,24 @@ +# csharpier-rider + + +This plugin adds support for [CSharpier](https://github.com/belav/csharpier), an opinionated code formatter for c#. +It uses Roslyn to parse your code and re-prints it using its own rules. +The printing process was ported from [prettier](https://prettier.io/) but has evolved over time. + +To use it: +- Install csharpier globally with `dotnet tool install -g csharpier` +- Use the `Reformat with CSharpier` action. +- Optionally configure CSharpier to `Run on Save` under Preferences/Settings | Tools | CSharpier + +Please report any [issues](https://github.com/belav/csharpier/issues) + + +## Installation + +- Using IDE built-in plugin system: + + Settings/Preferences > Plugins > Marketplace > Search for "CSharpier" > + Install Plugin +--- +Plugin based on the [IntelliJ Platform Plugin Template][template]. + diff --git a/Src/CSharpier.Rider/build.gradle.kts b/Src/CSharpier.Rider/build.gradle.kts new file mode 100644 index 000000000..83771cd9d --- /dev/null +++ b/Src/CSharpier.Rider/build.gradle.kts @@ -0,0 +1,116 @@ +import org.jetbrains.changelog.markdownToHTML +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +fun properties(key: String) = project.findProperty(key).toString() + +plugins { + // Java support + id("java") + // Kotlin support + id("org.jetbrains.kotlin.jvm") version "1.6.0" + // Gradle IntelliJ Plugin + id("org.jetbrains.intellij") version "1.3.0" + // Gradle Changelog Plugin + id("org.jetbrains.changelog") version "1.3.1" + // Gradle Qodana Plugin + id("org.jetbrains.qodana") version "0.1.13" +} + +group = properties("pluginGroup") +version = properties("pluginVersion") + +// Configure project's dependencies +repositories { + mavenCentral() +} + +// Configure Gradle IntelliJ Plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin +intellij { + pluginName.set(properties("pluginName")) + version.set(properties("platformVersion")) + type.set(properties("platformType")) + + // Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file. + plugins.set(properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty)) +} + +// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin +changelog { + version.set(properties("pluginVersion")) + groups.set(emptyList()) +} + +// Configure Gradle Qodana Plugin - read more: https://github.com/JetBrains/gradle-qodana-plugin +qodana { + cachePath.set(projectDir.resolve(".qodana").canonicalPath) + reportPath.set(projectDir.resolve("build/reports/inspections").canonicalPath) + saveReport.set(true) + showReport.set(System.getenv("QODANA_SHOW_REPORT")?.toBoolean() ?: false) +} + +tasks { + // Set the JVM compatibility versions + properties("javaVersion").let { + withType { + sourceCompatibility = it + targetCompatibility = it + } + withType { + kotlinOptions.jvmTarget = it + } + } + + wrapper { + gradleVersion = properties("gradleVersion") + } + + patchPluginXml { + version.set(properties("pluginVersion")) + sinceBuild.set(properties("pluginSinceBuild")) + untilBuild.set(properties("pluginUntilBuild")) + + // Extract the section from README.md and provide for the plugin's manifest + pluginDescription.set( + projectDir.resolve("README.md").readText().lines().run { + val start = "" + val end = "" + + if (!containsAll(listOf(start, end))) { + throw GradleException("Plugin description section not found in README.md:\n$start ... $end") + } + subList(indexOf(start) + 1, indexOf(end)) + }.joinToString("\n").run { markdownToHTML(this) } + ) + + // Get the latest available change notes from the changelog file + changeNotes.set(provider { + changelog.run { + getOrNull(properties("pluginVersion")) ?: getLatest() + }.toHTML() + }) + } + + // Configure UI tests plugin + // Read more: https://github.com/JetBrains/intellij-ui-test-robot + runIdeForUiTests { + systemProperty("robot-server.port", "8082") + systemProperty("ide.mac.message.dialogs.as.sheets", "false") + systemProperty("jb.privacy.policy.text", "") + systemProperty("jb.consents.confirmation.enabled", "false") + } + + signPlugin { + certificateChain.set(System.getenv("CERTIFICATE_CHAIN")) + privateKey.set(System.getenv("PRIVATE_KEY")) + password.set(System.getenv("PRIVATE_KEY_PASSWORD")) + } + + publishPlugin { + dependsOn("patchChangelog") + token.set(System.getenv("PUBLISH_TOKEN")) + // pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3 + // Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more: + // https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel + channels.set(listOf(properties("pluginVersion").split('-').getOrElse(1) { "default" }.split('.').first())) + } +} diff --git a/Src/CSharpier.Rider/gradle.properties b/Src/CSharpier.Rider/gradle.properties new file mode 100644 index 000000000..83c4be216 --- /dev/null +++ b/Src/CSharpier.Rider/gradle.properties @@ -0,0 +1,31 @@ +# IntelliJ Platform Artifacts Repositories +# -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html + +pluginGroup = com.intellij.csharpier +pluginName = csharpier +# SemVer format -> https://semver.org +pluginVersion = 1.0.3 + +# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html +# for insight into build numbers and IntelliJ Platform versions. +pluginSinceBuild = 203 +pluginUntilBuild = 213.* + +# IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties +platformType = IC +platformVersion = 2020.3.4 + +# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html +# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22 +platformPlugins = + +# Java language level used to compile sources and to generate the files for - Java 11 is required since 2020.3 +javaVersion = 11 + +# Gradle Releases -> https://github.com/gradle/gradle/releases +gradleVersion = 7.3 + +# Opt-out flag for bundling Kotlin standard library. +# See https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library for details. +# suppress inspection "UnusedProperty" +kotlin.stdlib.default.dependency = false diff --git a/Src/CSharpier.Rider/gradle/wrapper/gradle-wrapper.jar b/Src/CSharpier.Rider/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 000000000..7454180f2 Binary files /dev/null and b/Src/CSharpier.Rider/gradle/wrapper/gradle-wrapper.jar differ diff --git a/Src/CSharpier.Rider/gradle/wrapper/gradle-wrapper.properties b/Src/CSharpier.Rider/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000..e750102e0 --- /dev/null +++ b/Src/CSharpier.Rider/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/Src/CSharpier.Rider/gradlew b/Src/CSharpier.Rider/gradlew new file mode 100644 index 000000000..56689ce91 --- /dev/null +++ b/Src/CSharpier.Rider/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/Src/CSharpier.Rider/gradlew.bat b/Src/CSharpier.Rider/gradlew.bat new file mode 100644 index 000000000..ac1b06f93 --- /dev/null +++ b/Src/CSharpier.Rider/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/Src/CSharpier.Rider/qodana.yml b/Src/CSharpier.Rider/qodana.yml new file mode 100644 index 000000000..dac95d319 --- /dev/null +++ b/Src/CSharpier.Rider/qodana.yml @@ -0,0 +1,6 @@ +# Qodana configuration: +# https://www.jetbrains.com/help/qodana/qodana-yaml.html + +version: 1.0 +profile: + name: qodana.recommended diff --git a/Src/CSharpier.Rider/settings.gradle.kts b/Src/CSharpier.Rider/settings.gradle.kts new file mode 100644 index 000000000..3066345bb --- /dev/null +++ b/Src/CSharpier.Rider/settings.gradle.kts @@ -0,0 +1 @@ +rootProject.name = "csharpier" diff --git a/Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/CSharpierProcessPipeMultipleFiles.java b/Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/CSharpierProcessPipeMultipleFiles.java new file mode 100644 index 000000000..7c3cde1a2 --- /dev/null +++ b/Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/CSharpierProcessPipeMultipleFiles.java @@ -0,0 +1,104 @@ +package com.intellij.csharpier; + +import com.intellij.openapi.Disposable; +import com.intellij.openapi.diagnostic.Logger; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.util.concurrent.atomic.AtomicBoolean; + +public class CSharpierProcessPipeMultipleFiles implements ICSharpierProcess, Disposable { + Logger LOG = Logger.getInstance(CSharpierProcessPipeMultipleFiles.class); + String csharpierPath; + + Process process = null; + OutputStream stdin; + BufferedReader stdOut; + BufferedReader stdError; + + public CSharpierProcessPipeMultipleFiles(String csharpierPath) { + this.csharpierPath = csharpierPath; + try { + process = new ProcessBuilder("dotnet", csharpierPath, "--pipe-multiple-files") + .start(); + + stdin = process.getOutputStream(); + stdOut = new BufferedReader(new InputStreamReader(process.getInputStream())); + stdError = new BufferedReader(new InputStreamReader(process.getErrorStream())); + } catch (Exception e) { + LOG.error("error", e); + } + + this.formatFile("public class ClassName { }", "Test.cs"); + } + + @Override + public String formatFile(String content, String filePath) { + LOG.info("Formatting file at " + filePath); + + try { + LOG.info(filePath); + stdin.write(filePath.getBytes()); + stdin.write('\u0003'); + stdin.write(content.getBytes()); + stdin.write('\u0003'); + stdin.flush(); + + StringBuilder output = new StringBuilder(); + StringBuilder errorOutput = new StringBuilder(); + + AtomicBoolean done = new AtomicBoolean(false); + + Thread outputReaderThread = CreateReadingThread(stdOut, output, done); + outputReaderThread.start(); + + Thread errorReaderThread = CreateReadingThread(stdError, errorOutput, done); + errorReaderThread.start(); + + while (!done.get()) { + Thread.sleep(1); + } + + errorReaderThread.interrupt(); + outputReaderThread.interrupt(); + + String errorResult = errorOutput.toString(); + if (errorResult.length() > 0) { + LOG.info("Got error output: " + errorResult); + return ""; + } + + return output.toString(); + + } catch (Exception e) { + LOG.error(e); + e.printStackTrace(); + return ""; + } + } + + private Thread CreateReadingThread(BufferedReader reader, StringBuilder stringBuilder, AtomicBoolean done) { + return new Thread(() -> { + try { + var nextCharacter = reader.read(); + while (nextCharacter != -1) { + if (nextCharacter == '\u0003') { + done.set(true); + return; + } + stringBuilder.append((char) nextCharacter); + nextCharacter = reader.read(); + } + } catch (Exception e) { + LOG.error(e); + done.set(true); + } + }); + } + + @Override + public void dispose() { + process.destroy(); + } +} diff --git a/Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/CSharpierProcessSingleFile.java b/Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/CSharpierProcessSingleFile.java new file mode 100644 index 000000000..83e4ff2d8 --- /dev/null +++ b/Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/CSharpierProcessSingleFile.java @@ -0,0 +1,54 @@ +package com.intellij.csharpier; + +import com.esotericsoftware.minlog.Log; +import com.intellij.openapi.diagnostic.Logger; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.io.OutputStream; + +public class CSharpierProcessSingleFile implements ICSharpierProcess { + Logger LOG = Logger.getInstance(CSharpierProcessSingleFile.class); + String csharpierPath; + + public CSharpierProcessSingleFile(String csharpierPath) { + this.csharpierPath = csharpierPath; + } + + @Override + public String formatFile(String content, String fileName) { + try { + ProcessBuilder processBuilder = new ProcessBuilder("dotnet", csharpierPath, "--write-stdout"); + processBuilder.redirectErrorStream(true); + Process process = processBuilder.start(); + + OutputStream stdin = process.getOutputStream(); + BufferedReader stdOut = new BufferedReader(new InputStreamReader(process.getInputStream())); + + stdin.write(content.getBytes()); + stdin.close(); + + StringBuilder output = new StringBuilder(); + + var nextCharacter = stdOut.read(); + while (nextCharacter != -1) { + LOG.info("Got Output " + nextCharacter); + output.append((char)nextCharacter); + nextCharacter = stdOut.read(); + } + + String result = output.toString(); + + if (process.exitValue() == 0 && !result.contains("Failed to compile so was not formatted.")) { + return result; + } + else { + Log.error(result); + } + } catch (Exception e) { + LOG.error("error", e); + } + + return ""; + } +} diff --git a/Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/CSharpierService.java b/Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/CSharpierService.java new file mode 100644 index 000000000..8564aa5af --- /dev/null +++ b/Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/CSharpierService.java @@ -0,0 +1,109 @@ +package com.intellij.csharpier; + +import com.esotericsoftware.minlog.Log; +import com.intellij.notification.Notification; +import com.intellij.notification.NotificationGroupManager; +import com.intellij.notification.NotificationType; +import com.intellij.openapi.diagnostic.Logger; +import com.intellij.openapi.project.Project; +import org.apache.maven.artifact.versioning.ComparableVersion; +import org.jetbrains.annotations.NotNull; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.Scanner; + +public class CSharpierService { + Logger LOG = Logger.getInstance(ReformatWithCSharpierAction.class); + String csharpierPath; + ICSharpierProcess csharpierProcess; + Project project; + + public CSharpierService(@NotNull Project project) { + this.project = project; + csharpierPath = getCSharpierPath(); + + LOG.info("Using command dotnet " + csharpierPath); + + csharpierProcess = setupCSharpierProcess(); + } + + public String getCSharpierPath() { + // TODO make this some kind of build property so it only works when testing the plugin + // or maybe make it a setting? +// try { +// String csharpierDebugPath = "C:\\projects\\csharpier\\Src\\CSharpier.Cli\\bin\\Debug\\net6.0\\dotnet-csharpier.dll"; +// String csharpierReleasePath = csharpierDebugPath.replace("Debug", "Release"); +// +// if (new File(csharpierDebugPath).exists()) { +// return csharpierDebugPath; +// } else if (new File(csharpierReleasePath).exists()) { +// return csharpierReleasePath; +// } +// } catch (Exception ex) { +// Log.debug("Could not find local csharpier " + ex.getMessage()); +// } + + return "csharpier"; + } + + @NotNull + static CSharpierService getInstance(@NotNull Project project) { + return project.getService(CSharpierService.class); + } + + public String execCmd(String cmd) { + String result = null; + try (InputStream inputStream = Runtime.getRuntime().exec(cmd).getInputStream(); + Scanner s = new Scanner(inputStream).useDelimiter("\\A") + ) { + result = s.hasNext() ? s.next() : null; + } catch (IOException e) { + Log.error(e.getMessage()); + e.printStackTrace(); + } + return result; + } + + private ICSharpierProcess setupCSharpierProcess() { + try { + String version = execCmd("dotnet " + this.csharpierPath + " --version"); + LOG.info("CSharpier version: " + version); + if (version == null) { + this.displayInstallNeededMessage(); + } + else { + ComparableVersion installedVersion = new ComparableVersion(version); + ComparableVersion pipeFilesVersion = new ComparableVersion("0.12.0"); + if (installedVersion.compareTo(pipeFilesVersion) < 0) { + String content = "Please upgrade to CSharpier >= 0.12.0 for bug fixes and improved formatting speed."; + NotificationGroupManager.getInstance().getNotificationGroup("CSharpier") + .createNotification(content, NotificationType.INFORMATION) + .notify(project); + + return new CSharpierProcessSingleFile(this.csharpierPath); + } + return new CSharpierProcessPipeMultipleFiles(this.csharpierPath); + } + } catch (Exception ex) { + LOG.error(ex); + } + + return new NullCSharpierProcess(); + } + + private void displayInstallNeededMessage() { + Notification notification = NotificationGroupManager.getInstance().getNotificationGroup("CSharpier") + .createNotification("CSharpier must be installed globally to support formatting.", NotificationType.WARNING); + + // TODO why can't an action be displayed in this??? +// notification.addAction(new EditAction()); + + notification.notify(project); + } + + public String format(@NotNull String content, @NotNull String filePath) { + return this.csharpierProcess.formatFile(content, filePath); + } +} diff --git a/Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/CSharpierSettings.java b/Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/CSharpierSettings.java new file mode 100644 index 000000000..1056511eb --- /dev/null +++ b/Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/CSharpierSettings.java @@ -0,0 +1,42 @@ +package com.intellij.csharpier; + +import com.intellij.openapi.components.PersistentStateComponent; +import com.intellij.openapi.components.ServiceManager; +import com.intellij.openapi.components.State; +import com.intellij.openapi.components.Storage; +import com.intellij.openapi.project.Project; +import com.intellij.util.xmlb.XmlSerializerUtil; +import org.jetbrains.annotations.NotNull; + +@State( + name = "com.intellij.csharpier", + storages = @Storage("CSharpierPlugin.xml") +) +public class CSharpierSettings + implements PersistentStateComponent { + + @NotNull + static CSharpierSettings getInstance(@NotNull Project project) { + return project.getService(CSharpierSettings.class); + } + + private boolean runOnSave; + + public boolean getRunOnSave() { + return runOnSave; + } + + public void setRunOnSave(boolean runOnSave) { + this.runOnSave = runOnSave; + } + + @Override + public CSharpierSettings getState() { + return this; + } + + @Override + public void loadState(@NotNull CSharpierSettings state) { + XmlSerializerUtil.copyBean(state, this); + } +} diff --git a/Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/CSharpierSettingsComponent.java b/Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/CSharpierSettingsComponent.java new file mode 100644 index 000000000..893779066 --- /dev/null +++ b/Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/CSharpierSettingsComponent.java @@ -0,0 +1,60 @@ +package com.intellij.csharpier; + +import com.intellij.openapi.components.ServiceManager; +import com.intellij.openapi.options.ConfigurationException; +import com.intellij.openapi.options.SearchableConfigurable; +import com.intellij.openapi.project.Project; +import com.intellij.ui.components.JBLabel; +import com.intellij.util.ui.FormBuilder; +import org.jetbrains.annotations.Nls; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import javax.swing.*; + +public class CSharpierSettingsComponent implements SearchableConfigurable { + private final Project project; + private JCheckBox runOnSaveCheckBox = new JCheckBox("Run on Save"); + + public CSharpierSettingsComponent(@NotNull Project project) { + this.project = project; + } + + @NotNull + @Override + public String getId() { + return "CSharpier"; + } + + @Nls + @Override + public String getDisplayName() { + return "CSharpier"; + } + + @Override + public @Nullable JComponent createComponent() { + return FormBuilder.createFormBuilder() + .addComponent(runOnSaveCheckBox) + .addComponentFillVertically(new JPanel(), 0) + .getPanel(); + } + + @Override + public boolean isModified() { + return CSharpierSettings.getInstance(this.project).getRunOnSave() != runOnSaveCheckBox.isSelected(); + } + + @Override + public void apply() throws ConfigurationException { + CSharpierSettings settings = CSharpierSettings.getInstance(this.project); + + settings.setRunOnSave(runOnSaveCheckBox.isSelected()); + } + + @Override + public void reset() { + CSharpierSettings settings = CSharpierSettings.getInstance(this.project); + runOnSaveCheckBox.setSelected(settings.getRunOnSave()); + } +} diff --git a/Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/CSharpierStartup.java b/Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/CSharpierStartup.java new file mode 100644 index 000000000..15978d54f --- /dev/null +++ b/Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/CSharpierStartup.java @@ -0,0 +1,13 @@ +package com.intellij.csharpier; + +import com.intellij.openapi.project.DumbAware; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.startup.StartupActivity; +import org.jetbrains.annotations.NotNull; + +public class CSharpierStartup implements StartupActivity, DumbAware { + @Override + public void runActivity(@NotNull Project project) { + CSharpierService.getInstance(project); + } +} diff --git a/Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/FormattingService.java b/Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/FormattingService.java new file mode 100644 index 000000000..77352b6d9 --- /dev/null +++ b/Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/FormattingService.java @@ -0,0 +1,59 @@ +package com.intellij.csharpier; + +import com.intellij.openapi.command.WriteCommandAction; +import com.intellij.openapi.diagnostic.Logger; +import com.intellij.openapi.editor.Document; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.vfs.ReadonlyStatusHandler; +import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.psi.PsiDocumentManager; +import com.intellij.psi.PsiFile; +import org.jetbrains.annotations.NotNull; + +import java.util.Collections; + +public class FormattingService { + Logger LOG = Logger.getInstance(FormattingService.class); + + @NotNull + static FormattingService getInstance(@NotNull Project project) { + return project.getService(FormattingService.class); + } + + public void format(@NotNull Document document,@NotNull Project project) { + PsiFile psiFile = PsiDocumentManager.getInstance(project).getPsiFile(document); + if (psiFile == null) { + return; + } + + + + if (!(psiFile.getLanguage().getID().equals("C#") + // while testing in intellij it doesn't know about c# + || (psiFile.getLanguage().getID().equals("TEXT") && psiFile.getName().endsWith(".cs"))) + ) { + LOG.info("Skipping formatting because language was " + psiFile.getLanguage().getDisplayName()); + return; + } + + VirtualFile virtualFile = psiFile.getVirtualFile(); + if (ReadonlyStatusHandler.getInstance(project) + .ensureFilesWritable(Collections.singletonList(virtualFile)) + .hasReadonlyFiles() + ) { + return; + } + + String filePath = virtualFile.getPath(); + String currentDocumentText = document.getText(); + + CSharpierService cSharpierService = CSharpierService.getInstance(project); + String result = cSharpierService.format(currentDocumentText, filePath); + + if (result.length() > 0) { + WriteCommandAction.runWriteCommandAction(project, () -> { + document.replaceString(0, currentDocumentText.length(), result); + }); + } + } +} diff --git a/Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/ICSharpierProcess.java b/Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/ICSharpierProcess.java new file mode 100644 index 000000000..857b3469f --- /dev/null +++ b/Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/ICSharpierProcess.java @@ -0,0 +1,5 @@ +package com.intellij.csharpier; + +public interface ICSharpierProcess { + public String formatFile(String content, String fileName); +} diff --git a/Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/NullCSharpierProcess.java b/Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/NullCSharpierProcess.java new file mode 100644 index 000000000..b5bd38f66 --- /dev/null +++ b/Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/NullCSharpierProcess.java @@ -0,0 +1,8 @@ +package com.intellij.csharpier; + +public class NullCSharpierProcess implements ICSharpierProcess { + @Override + public String formatFile(String content, String fileName) { + return ""; + } +} diff --git a/Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/ReformatWithCSharpierAction.java b/Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/ReformatWithCSharpierAction.java new file mode 100644 index 000000000..7ae8ec89d --- /dev/null +++ b/Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/ReformatWithCSharpierAction.java @@ -0,0 +1,32 @@ +package com.intellij.csharpier; + +import com.intellij.openapi.actionSystem.AnAction; +import com.intellij.openapi.actionSystem.AnActionEvent; +import com.intellij.openapi.actionSystem.CommonDataKeys; +import com.intellij.openapi.diagnostic.Logger; +import com.intellij.openapi.editor.Document; +import com.intellij.openapi.editor.Editor; +import com.intellij.openapi.project.Project; +import org.jetbrains.annotations.NotNull; + +public class ReformatWithCSharpierAction extends AnAction { + Logger LOG = Logger.getInstance(ReformatWithCSharpierAction.class); + + @Override + public void actionPerformed(@NotNull AnActionEvent e) { + LOG.info("Running ReformatWithCSharpierAction"); + Project project = e.getProject(); + if (project == null) { + return; + } + Editor editor = e.getData(CommonDataKeys.EDITOR); + if (editor != null) { + processFileInEditor(project, editor.getDocument()); + } + } + + private static void processFileInEditor(@NotNull Project project, @NotNull Document document) { + FormattingService formattingService = FormattingService.getInstance(project); + formattingService.format(document, project); + } +} \ No newline at end of file diff --git a/Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/ReformatWithCSharpierOnSave.java b/Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/ReformatWithCSharpierOnSave.java new file mode 100644 index 000000000..35dab69ba --- /dev/null +++ b/Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/ReformatWithCSharpierOnSave.java @@ -0,0 +1,37 @@ +package com.intellij.csharpier; + +import com.intellij.openapi.diagnostic.Logger; +import com.intellij.openapi.editor.Document; +import com.intellij.openapi.fileEditor.FileDocumentManager; +import com.intellij.openapi.fileEditor.FileDocumentManagerListener; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.project.ProjectLocator; +import com.intellij.openapi.vfs.VirtualFile; +import org.jetbrains.annotations.NotNull; + +public class ReformatWithCSharpierOnSave implements FileDocumentManagerListener { + Logger LOG = Logger.getInstance(ReformatWithCSharpierAction.class); + + @Override + public void beforeDocumentSaving(@NotNull Document document) { + VirtualFile file = FileDocumentManager.getInstance().getFile(document); + if (file == null) { + return; + } + Project project = ProjectLocator.getInstance().guessProjectForFile(file); + if (project == null) { + LOG.info("Could not find project for file so not trying to format in save."); + return; + } + + CSharpierSettings cSharpierSettings = CSharpierSettings.getInstance(project); + if (!cSharpierSettings.getRunOnSave()) { + return; + } + + LOG.info("Running ReformatWithCSharpierOnSave"); + + FormattingService formattingService = FormattingService.getInstance(project); + formattingService.format(document, project); + } +} diff --git a/Src/CSharpier.Rider/src/main/resources/META-INF/plugin.xml b/Src/CSharpier.Rider/src/main/resources/META-INF/plugin.xml new file mode 100644 index 000000000..f691282e4 --- /dev/null +++ b/Src/CSharpier.Rider/src/main/resources/META-INF/plugin.xml @@ -0,0 +1,28 @@ + + + com.intellij.csharpier + CSharpier + belav + + com.intellij.modules.platform + + + + + + + + + + + + + + + + + diff --git a/Src/CSharpier.Rider/src/main/resources/META-INF/pluginIcon.svg b/Src/CSharpier.Rider/src/main/resources/META-INF/pluginIcon.svg new file mode 100644 index 000000000..e175b7bf4 --- /dev/null +++ b/Src/CSharpier.Rider/src/main/resources/META-INF/pluginIcon.svg @@ -0,0 +1,57 @@ + + + + C + + + # + + + + ier + + + diff --git a/Src/CSharpier.VSCode/CONTRIBUTING.md b/Src/CSharpier.VSCode/CONTRIBUTING.md new file mode 100644 index 000000000..00dab21bc --- /dev/null +++ b/Src/CSharpier.VSCode/CONTRIBUTING.md @@ -0,0 +1 @@ +https://code.visualstudio.com/api/working-with-extensions/publishing-extension diff --git a/Src/CSharpier.VSCode/icon.png b/Src/CSharpier.VSCode/icon.png index 0a49696ad..2866f8235 100644 Binary files a/Src/CSharpier.VSCode/icon.png and b/Src/CSharpier.VSCode/icon.png differ diff --git a/Src/CSharpier.VSCode/package-lock.json b/Src/CSharpier.VSCode/package-lock.json index 8b83e7304..742c7d45c 100644 --- a/Src/CSharpier.VSCode/package-lock.json +++ b/Src/CSharpier.VSCode/package-lock.json @@ -1,6 +1,6 @@ { "name": "csharpier-vscode", - "version": "0.1.0", + "version": "1.0.3", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -598,12 +598,6 @@ "integrity": "sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g==", "dev": true }, - "command-exists": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz", - "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==", - "dev": true - }, "commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", diff --git a/Src/CSharpier.VSCode/package.json b/Src/CSharpier.VSCode/package.json index c8f2667f7..1f7cdf523 100644 --- a/Src/CSharpier.VSCode/package.json +++ b/Src/CSharpier.VSCode/package.json @@ -2,7 +2,7 @@ "name": "csharpier-vscode", "displayName": "CSharpier - Code formatter", "description": "Code formatter using csharpier", - "version": "1.0.2", + "version": "1.0.3", "publisher": "csharpier", "author": "CSharpier", "homepage": "https://marketplace.visualstudio.com/items?itemName=csharpier.csharpier-vscode", diff --git a/logo.png b/logo.png new file mode 100644 index 000000000..2866f8235 Binary files /dev/null and b/logo.png differ diff --git a/logo.svg b/logo.svg new file mode 100644 index 000000000..f4537173e --- /dev/null +++ b/logo.svg @@ -0,0 +1,57 @@ + + + + C + + + # + + + + ier + + +