Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS2022 for mac Extension #652

Open
belav opened this issue Apr 28, 2022 · 2 comments
Open

VS2022 for mac Extension #652

belav opened this issue Apr 28, 2022 · 2 comments
Labels
help wanted type:enhancement New feature or request

Comments

@belav
Copy link
Owner

belav commented Apr 28, 2022

Extensions for regular VS2022 are built on the .net framework, so I assume that they are not compatible with VS2022 for Mac.

Assuming there is demand it would be nice to have one built for VS2022 for Mac. It can probably be based on the existing VS2022 extension. I don't have a Mac to do the work however.

@belav belav added type:enhancement New feature or request help wanted labels Apr 28, 2022
@MichaelCharles
Copy link

Just commenting to express my interest. I've been looking for an extension to use CSharpier on Mac.

I could perhaps look into trying to port it, but I've never gone about making extensions for Visual Studio before, so I wouldn't know where to start.

That having been said... I mostly use VSCode for Mac, and the rest of my team uses Windows, so it actually isn't that high of a priority for me.

@cl3m
Copy link

cl3m commented Oct 26, 2022

I've made an AppleScript to save with csharpier. It works but you might have to save twice for it to apply. You have to make a workflow and map it to the save cmd. It is better than nothing but a proper extension would be nice.

It is made for VS Preview and some path might not work for you. You can follow this explanation for Xcode that use the same technique : https://luisramos.dev/xcode-format-and-save

on run {input, parameters}
	tell application "System Events"
		tell process "Visual Studio (Preview)"
			set frontmost to true
			set solution to value of attribute "AXDocument" of front window
			set solution to ((characters 8 thru -1 of solution) as string)
			set reversesolution to reverse of solution's items as text
			set solution to text 1 thru -(offset of "/" in reversesolution) of solution
			set filepath to name of front window
			set filepath to text ((offset of " – " in filepath) + 3) thru -1 of filepath
			set filepath to text 1 thru ((offset of " – " in filepath) - 1) of filepath
			set filepath to text 1 thru ((offset of "*" in filepath) - 1) of filepath
			set cmd to "/bin/zsh -c 'source ~/.zshrc && /usr/local/share/dotnet/dotnet csharpier \"" & solution & filepath & "\"'"
			set reversefilepath to reverse of filepath's items as text
			set filename to text (-(offset of "/" in reversefilepath) + 1) thru -1 of filepath			
			try
				click menu item ("Save " & filename) of menu "File" of menu bar 1
				delay 1
			on error errorMessage number errorNumber
		    	log ("errorMessage: " & errorMessage & ", errorNumber: " & errorNumber)
			end try
			do shell script cmd
		end tell
	end tell
	return input
end run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted type:enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants