Skip to content

Commit 3ba62c0

Browse files
committed
Initial plugin development with some features already implemented.
0 parents  commit 3ba62c0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+4620
-0
lines changed

.babelrc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"presets": [
3+
// "@babel/preset-env",
4+
"@babel/preset-react",
5+
["@babel/preset-typescript", { "allowNamespaces": true }]
6+
],
7+
"plugins": [
8+
// "@babel/plugin-proposal-class-properties"
9+
]
10+
}

.eslintrc.json

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"parserOptions": {
5+
"ecmaVersion": 6,
6+
"sourceType": "module"
7+
},
8+
"plugins": [
9+
"@typescript-eslint"
10+
],
11+
"rules": {
12+
"@typescript-eslint/naming-convention": "warn",
13+
"@typescript-eslint/semi": "warn",
14+
"curly": "warn",
15+
"eqeqeq": "warn",
16+
"no-throw-literal": "warn",
17+
"semi": "off"
18+
},
19+
"ignorePatterns": [
20+
"out",
21+
"dist",
22+
"**/*.d.ts"
23+
]
24+
}

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
out
2+
dist
3+
node_modules
4+
.vscode-test/
5+
*.vsix

.vscode/extensions.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
// See http://go.microsoft.com/fwlink/?LinkId=827846
3+
// for the documentation about the extensions.json format
4+
"recommendations": ["dbaeumer.vscode-eslint", "amodio.tsl-problem-matcher"]
5+
}

.vscode/launch.json

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// A launch configuration that compiles the extension and then opens it inside a new window
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
{
6+
"version": "0.2.0",
7+
"configurations": [
8+
{
9+
"name": "Run Extension",
10+
"type": "extensionHost",
11+
"request": "launch",
12+
"args": [
13+
"--extensionDevelopmentPath=${workspaceFolder}"
14+
],
15+
"outFiles": [
16+
"${workspaceFolder}/dist/**/*.js"
17+
],
18+
"preLaunchTask": "${defaultBuildTask}"
19+
},
20+
{
21+
"name": "Extension Tests",
22+
"type": "extensionHost",
23+
"request": "launch",
24+
"args": [
25+
"--extensionDevelopmentPath=${workspaceFolder}",
26+
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
27+
],
28+
"outFiles": [
29+
"${workspaceFolder}/out/**/*.js",
30+
"${workspaceFolder}/dist/**/*.js"
31+
],
32+
"preLaunchTask": "tasks: watch-tests"
33+
}
34+
]
35+
}

.vscode/settings.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Place your settings in this file to overwrite default and user settings.
2+
{
3+
"files.exclude": {
4+
"out": false, // set this to true to hide the "out" folder with the compiled JS files
5+
"dist": false // set this to true to hide the "dist" folder with the compiled JS files
6+
},
7+
"search.exclude": {
8+
"out": true, // set this to false to include "out" folder in search results
9+
"dist": true // set this to false to include "dist" folder in search results
10+
},
11+
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
12+
"typescript.tsc.autoDetect": "off",
13+
"svn.ignoreMissingSvnWarning": true
14+
}

.vscode/tasks.json

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// See https://go.microsoft.com/fwlink/?LinkId=733558
2+
// for the documentation about the tasks.json format
3+
{
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"type": "npm",
8+
"script": "watch",
9+
"problemMatcher": [
10+
"$ts-webpack-watch",
11+
"$tslint-webpack-watch"
12+
],
13+
"isBackground": true,
14+
"presentation": {
15+
"reveal": "never",
16+
"group": "watchers"
17+
},
18+
"group": {
19+
"kind": "build",
20+
"isDefault": true
21+
}
22+
},
23+
{
24+
"type": "npm",
25+
"script": "watch-tests",
26+
"problemMatcher": "$tsc-watch",
27+
"isBackground": true,
28+
"presentation": {
29+
"reveal": "never",
30+
"group": "watchers"
31+
},
32+
"group": "build"
33+
},
34+
{
35+
"label": "tasks: watch-tests",
36+
"dependsOn": [
37+
"npm: watch",
38+
"npm: watch-tests"
39+
],
40+
"problemMatcher": []
41+
}
42+
]
43+
}

.vscodeignore

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.vscode/**
2+
.vscode-test/**
3+
out/**
4+
node_modules/**
5+
src/**
6+
.gitignore
7+
.yarnrc
8+
webpack.config.js
9+
vsc-extension-quickstart.md
10+
**/tsconfig.json
11+
**/.eslintrc.json
12+
**/*.map
13+
**/*.ts

.yarnrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--ignore-engines true

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Change Log
2+
3+
All notable changes to the "uetools" extension will be documented in this file.
4+
5+
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
6+
7+
## [Unreleased]
8+
9+
- Initial release

README.md

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Unreal Engine Tools
2+
3+
Unreal Engine Tools is an extension to Visual Studio Code with some shortcuts and code editor enhancements to improve the experience of developing C++ modules for Unreal Engine projects.
4+
5+
## Features
6+
7+
### Unreal Engine Tools in-editor section:
8+
Section that provides some shortcuts and a overview of the current project in the Workspace.
9+
10+
![Unreal Engine Tools editor section](./res/images/uetools_project00.gif)
11+
12+
### Build project from editor with Hot Reload:
13+
Build shortcut that offers the engine installation selection and forces hot reload on editor.
14+
15+
![Build entire project](./res/images/uetools_project01.gif)
16+
17+
It is possible to build individual modules too, also with hot reload.
18+
19+
![Build module individually](./res/images/uetools_project02.gif)
20+
21+
### Improved code completion with Clangd extension:
22+
Automatically invokes UnrealBuildTool in GenerateClangDatabase mode to generate the `compile_commands.json` file that is required by [Clangd extention](https://clangd.llvm.org), allowing the editor to have a better code completion experience. It is not perfect, but helps to get the job done. 🙌🏻
23+
24+
![Code completion feature](./res/images/uetools_code00.gif)
25+
26+
## Requirements
27+
28+
* `clangd` - For code improved completion experience.
29+
* `MacOS` - Currently I am developed the extension in a Mac OS only, but as soon I get a Windows and Linux machine I will port it to Windows and Linux developing environment.
30+
31+
## Extension Settings
32+
This extension contributes the following settings:
33+
34+
* `uetools.unrealEngineInstallationSearchPath`: Path to search for Unreal Engine installation for. Usually `C:\Program Files\Epic Games\` on Windows, or `/Users/Shared/Epic Games/` on Mac.
35+
36+
## Known Issues
37+
38+
* Currently support only Mac systems;
39+
* Some code completion seems not work due to forward declaration of Unreal Engine classes and structs provided by `CoreMinimal.h`. I guess...;
40+
* Still in development, so give it a try guys...
41+
42+
If you liked this project, feel free to suggest code, features and improvements. **Enjoy!**

package.json

+110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
{
2+
"name": "uetools",
3+
"displayName": "Unreal Engine Tools",
4+
"description": "Unreal Engine toolset to help developing projects using Visual Studio Code.",
5+
"version": "0.0.1",
6+
"engines": {
7+
"vscode": "^1.64.0"
8+
},
9+
"categories": [
10+
"Other"
11+
],
12+
"activationEvents": [
13+
"onStartupFinished"
14+
],
15+
"main": "./dist/extension.js",
16+
"contributes": {
17+
"commands": [
18+
{
19+
"command": "uetools.checkUnrealProject",
20+
"title": "UETools: Check for Unreal Project in this workspace"
21+
},
22+
{
23+
"command": "uetools.askProjectFilesGeneration",
24+
"title": "UETools: Ask Unreal Project files generation"
25+
}
26+
],
27+
"configuration": [
28+
{
29+
"title": "Uneral Engine Tools",
30+
"properties": {
31+
"uetools.unrealEngineInstallationSearchPath": {
32+
"type": "string",
33+
"description": "Path to search for Unreal Engine installations",
34+
"default": ""
35+
}
36+
}
37+
}
38+
],
39+
"taskDefinitions": [
40+
{
41+
"type": "uetools"
42+
}
43+
],
44+
"views": {
45+
"uetools": [
46+
{
47+
"type": "webview",
48+
"id": "uetools.project",
49+
"name": "Project"
50+
},
51+
{
52+
"type": "webview",
53+
"id": "uetools.modules",
54+
"name": "Modules"
55+
}
56+
]
57+
},
58+
"viewsContainers": {
59+
"activitybar": [
60+
{
61+
"id": "uetools",
62+
"title": "Unreal Engine Tools",
63+
"icon": "res/icons/ueicon-light.png"
64+
}
65+
]
66+
}
67+
},
68+
"scripts": {
69+
"vscode:prepublish": "yarn run package",
70+
"compile": "webpack",
71+
"watch": "webpack --watch",
72+
"package": "webpack --mode production --devtool hidden-source-map",
73+
"compile-tests": "tsc -p . --outDir out",
74+
"watch-tests": "tsc -p . -w --outDir out",
75+
"pretest": "yarn run compile-tests && yarn run compile && yarn run lint",
76+
"lint": "eslint src --ext ts",
77+
"test": "node ./out/test/runTest.js"
78+
},
79+
"devDependencies": {
80+
"@babel/core": "^7.17.5",
81+
"@babel/preset-react": "^7.16.7",
82+
"@babel/preset-typescript": "^7.16.7",
83+
"@types/glob": "^7.2.0",
84+
"@types/mocha": "^9.1.0",
85+
"@types/node": "14.x",
86+
"@types/react": "^17.0.39",
87+
"@types/react-dom": "^17.0.12",
88+
"@types/styled-components": "^5.1.24",
89+
"@types/vscode": "^1.64.0",
90+
"@typescript-eslint/eslint-plugin": "^5.12.1",
91+
"@typescript-eslint/parser": "^5.12.1",
92+
"@vscode/test-electron": "^2.1.2",
93+
"babel-loader": "^8.2.3",
94+
"eslint": "^8.9.0",
95+
"glob": "^7.2.0",
96+
"mocha": "^9.2.1",
97+
"ts-loader": "^9.2.6",
98+
"typescript": "^4.5.5",
99+
"webpack": "^5.69.1",
100+
"webpack-cli": "^4.9.2"
101+
},
102+
"dependencies": {
103+
"react": "^17.0.2",
104+
"react-dom": "^17.0.2",
105+
"styled-components": "^5.3.3"
106+
},
107+
"extensionDependencies": [
108+
"llvm-vs-code-extensions.vscode-clangd"
109+
]
110+
}

res/icons/plugin.png

12.4 KB
Loading

res/icons/ueicon-light.png

50.1 KB
Loading

res/images/uesplash.jpg

159 KB
Loading

res/images/uetools_code00.gif

3.18 MB
Loading

res/images/uetools_project00.gif

128 KB
Loading

res/images/uetools_project01.gif

341 KB
Loading

res/images/uetools_project02.gif

366 KB
Loading

res/images/uetoolslogo.png

1.29 MB
Loading

res/images/uetoolslogo128.png

33.4 KB
Loading

src/StatusBarItems/ActiveProject.ts

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import * as vscode from 'vscode';
2+
import { Context } from '../helpers/context';
3+
import { UnrealEngineProject } from '../types';
4+
5+
/**
6+
* Active Project Status Bar Item
7+
*/
8+
export class ActiveProjectStatusBarItem {
9+
private _statusBarItem: vscode.StatusBarItem;
10+
private _project: vscode.WorkspaceFolder | undefined;
11+
12+
constructor() {
13+
this._statusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, 100);
14+
Context.events.onProjectChanged.on(this.update.bind(this));
15+
}
16+
17+
//
18+
public update(project: UnrealEngineProject) {
19+
this._statusBarItem.text = `${project.Modules[0].Name} (UE v${project.EngineAssociation})`;
20+
this._statusBarItem.show();
21+
}
22+
23+
public hide(): void {
24+
this._project = undefined;
25+
this._statusBarItem.hide();
26+
}
27+
}

0 commit comments

Comments
 (0)