This repository has been archived by the owner on Jul 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #89 from mika-f/feature/vscode-extension
- Loading branch information
Showing
28 changed files
with
2,174 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
22 changes: 22 additions & 0 deletions
22
Source/UdonRabbit.Analyzer.VisualStudioCode/.eslintrc.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"root": true, | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": 6, | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"@typescript-eslint" | ||
], | ||
"rules": { | ||
"@typescript-eslint/naming-convention": "warn", | ||
"@typescript-eslint/semi": "warn", | ||
"curly": "warn", | ||
"eqeqeq": "warn", | ||
"no-throw-literal": "warn", | ||
"semi": "off" | ||
}, | ||
"ignorePatterns": [ | ||
"**/*.d.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.dll | ||
*.vsix | ||
out/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"printWidth": 180 | ||
} |
7 changes: 7 additions & 0 deletions
7
Source/UdonRabbit.Analyzer.VisualStudioCode/.vscode/extensions.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
// See http://go.microsoft.com/fwlink/?LinkId=827846 | ||
// for the documentation about the extensions.json format | ||
"recommendations": [ | ||
"dbaeumer.vscode-eslint" | ||
] | ||
} |
34 changes: 34 additions & 0 deletions
34
Source/UdonRabbit.Analyzer.VisualStudioCode/.vscode/launch.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// A launch configuration that compiles the extension and then opens it inside a new window | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Run Extension", | ||
"type": "extensionHost", | ||
"request": "launch", | ||
"args": [ | ||
"--extensionDevelopmentPath=${workspaceFolder}" | ||
], | ||
"outFiles": [ | ||
"${workspaceFolder}/out/**/*.js" | ||
], | ||
"preLaunchTask": "${defaultBuildTask}" | ||
}, | ||
{ | ||
"name": "Extension Tests", | ||
"type": "extensionHost", | ||
"request": "launch", | ||
"args": [ | ||
"--extensionDevelopmentPath=${workspaceFolder}", | ||
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index" | ||
], | ||
"outFiles": [ | ||
"${workspaceFolder}/out/test/**/*.js" | ||
], | ||
"preLaunchTask": "${defaultBuildTask}" | ||
} | ||
] | ||
} |
11 changes: 11 additions & 0 deletions
11
Source/UdonRabbit.Analyzer.VisualStudioCode/.vscode/settings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Place your settings in this file to overwrite default and user settings. | ||
{ | ||
"files.exclude": { | ||
"out": false // set this to true to hide the "out" folder with the compiled JS files | ||
}, | ||
"search.exclude": { | ||
"out": true // set this to false to include "out" folder in search results | ||
}, | ||
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts | ||
"typescript.tsc.autoDetect": "off" | ||
} |
20 changes: 20 additions & 0 deletions
20
Source/UdonRabbit.Analyzer.VisualStudioCode/.vscode/tasks.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// See https://go.microsoft.com/fwlink/?LinkId=733558 | ||
// for the documentation about the tasks.json format | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"type": "npm", | ||
"script": "watch", | ||
"problemMatcher": "$tsc-watch", | ||
"isBackground": true, | ||
"presentation": { | ||
"reveal": "never" | ||
}, | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.vscode/** | ||
.vscode-test/** | ||
out/test/** | ||
src/** | ||
.gitignore | ||
.yarnrc | ||
vsc-extension-quickstart.md | ||
**/tsconfig.json | ||
**/.eslintrc.json | ||
**/*.map | ||
**/*.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--ignore-engines true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Change Log | ||
|
||
All notable changes to the "udonrabbit-analyzer" extension will be documented in this file. | ||
|
||
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. | ||
|
||
## [Unreleased] | ||
|
||
- Initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# UdonRabbit.Analyzer for Visual Studio Code | ||
|
||
Experimental .NET Roslyn Analyzer for VRChat Udon and UdonSharp. | ||
This analyzer accelerates your Udon development with UdonSharp. | ||
Check out the [list of analyzers](https://github.com/mika-f/UdonRabbit.Analyzer/tree/master/docs/analyzers) defined in this project. | ||
Not enough types of analyzers in UdonRabbit.Analyzer? | ||
You can check out the [list of missing analyzers](https://github.com/mika-f/UdonRabbit.Analyzer/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Aenhancement) or create a new issues. | ||
|
||
## Features | ||
|
||
- It reports the part of the behaviour that doesn't work well on VRChat as an error in editor | ||
- It reports an error in the editor that about the syntax that cannot be compiled by the UdonSharp | ||
- etc | ||
|
||
## Requirements | ||
|
||
- Microsoft Visual Studio 2019 or IDE that supports Roslyn Analyzer | ||
- VRCSDK3 that supports Udon | ||
- UdonSharp | ||
|
||
## Analyzer Documents | ||
|
||
See https://docs.mochizuki.moe/udon-rabbit/analayzer/analyzers/ | ||
|
||
## ScreenShots | ||
|
||
<img src="https://user-images.githubusercontent.com/10832834/112584755-c8528d00-8e3b-11eb-9204-1c05c0669ffc.PNG" width="500px" /> | ||
|
||
## Troubleshooting | ||
|
||
### I found a bug on VS/VS Code/Rider/Analyzer | ||
|
||
If you find a bug, feel free to create a new issue! | ||
|
||
### Analyzer is not worked on UdonSharpBehaviour | ||
|
||
You cannot run multiple UdonRabbit.Analyzer instances in the same Unity workspace. | ||
Therefore, if you are running Analyzer in multiple editors, disable one. | ||
If that doesn't work, we recommend restarting your PC. | ||
|
||
## License | ||
|
||
MIT by [@6jz](https://twitter.com/6jz) | ||
|
||
## Third Party Notices | ||
|
||
This project contains some code from the following project. | ||
See method comments for details. | ||
|
||
- [MerlinVR/UdonSharp](https://github.com/MerlinVR/UdonSharp) | ||
- [Microsoft/Microsoft.Unity.Analyzers](https://github.com/microsoft/Microsoft.Unity.Analyzers) | ||
|
||
## Links | ||
|
||
Discord Server : https://discord.gg/h42BzsFtD2 | ||
Patreon : XXX |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{ | ||
"name": "udonrabbit-analyzer", | ||
"publisher": "natsuneko", | ||
"displayName": "UdonRabbit Analyzer", | ||
"description": "The Roslyn Analyzer for VRChat Udon and UdonSharp.", | ||
"version": "0.11.4", | ||
"engines": { | ||
"vscode": "^1.55.0" | ||
}, | ||
"categories": [ | ||
"Other" | ||
], | ||
"activationEvents": [ | ||
"*" | ||
], | ||
"main": "./out/extension.js", | ||
"files": [ | ||
"out", | ||
"externals" | ||
], | ||
"license": "MIT", | ||
"homepage": "https://github.com/mika-f/UdonRabbit.Analyzer", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/mika-f/UdonRabbit.Analyzer.git" | ||
}, | ||
"contributes": { | ||
"configuration": { | ||
"title": "UdonRabbit Analyzer", | ||
"properties": { | ||
"udonrabbit-analyzer.rewriteOmniSharpJson": { | ||
"type": "boolean", | ||
"default": true, | ||
"description": "Automatically rewrite omnisharp.json file in workspace or global." | ||
} | ||
} | ||
} | ||
}, | ||
"scripts": { | ||
"vscode:prepublish": "yarn run compile", | ||
"compile": "tsc -p ./", | ||
"watch": "tsc -watch -p ./", | ||
"pretest": "yarn run compile && yarn run lint", | ||
"lint": "eslint src --ext ts", | ||
"test": "node ./out/test/runTest.js" | ||
}, | ||
"devDependencies": { | ||
"@types/glob": "^7.1.3", | ||
"@types/mocha": "^8.0.4", | ||
"@types/node": "^12.11.7", | ||
"@types/vscode": "^1.55.0", | ||
"@typescript-eslint/eslint-plugin": "^4.14.1", | ||
"@typescript-eslint/parser": "^4.14.1", | ||
"eslint": "^7.19.0", | ||
"eslint-config-prettier": "^8.1.0", | ||
"glob": "^7.1.6", | ||
"mocha": "^8.2.1", | ||
"prettier": "^2.2.1", | ||
"typescript": "^4.1.3", | ||
"vscode-test": "^1.5.0" | ||
}, | ||
"dependencies": { | ||
"json5": "^2.2.0" | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
Source/UdonRabbit.Analyzer.VisualStudioCode/src/extension.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// The module 'vscode' contains the VS Code extensibility API | ||
// Import the module and reference it with the alias vscode in your code below | ||
import * as vscode from "vscode"; | ||
|
||
import { configureExtensionPath, writeConfiguration } from "./omnisharp"; | ||
import { onChangeWorkspace } from "./workspace"; | ||
|
||
// this method is called when your extension is activated | ||
// your extension is activated the very first time the command is executed | ||
export function activate(context: vscode.ExtensionContext) { | ||
const shouldRewriteOmniSharp = vscode.workspace.getConfiguration("udonrabbit-analyzer").get<boolean>("rewriteOmniSharpJson"); | ||
|
||
if (shouldRewriteOmniSharp) { | ||
configureExtensionPath(context.extensionPath); | ||
writeConfiguration(); | ||
|
||
context.subscriptions.push(vscode.workspace.onDidChangeWorkspaceFolders((e) => onChangeWorkspace(e))); | ||
} | ||
} | ||
|
||
// this method is called when your extension is deactivated | ||
export function deactivate() {} |
Oops, something went wrong.