Skip to content

Commit

Permalink
working automatic launch configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitalita committed Oct 1, 2023
1 parent 5f34542 commit d84c190
Show file tree
Hide file tree
Showing 27 changed files with 2,912 additions and 1,396 deletions.
44 changes: 39 additions & 5 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,26 @@
"args": [
"--extensionDevelopmentPath=${workspaceFolder}/src/papyrus-lang-vscode"
],
"outFiles": ["${workspaceFolder}/src/papyrus-lang-vscode/out/**/*.js"]
"outFiles": [
"${workspaceFolder}/src/papyrus-lang-vscode/dist/*.js"
],
},
{
"name": "Launch (Build extension and build and copy binaries only)",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"preLaunchTask": "buildExtensionAndUpdateBin",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}/src/papyrus-lang-vscode"
],
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/src/papyrus-lang-vscode/dist/*.js"
],
"cwd": "${workspaceFolder}/src/papyrus-lang-vscode",
"internalConsoleOptions": "openOnSessionStart",
"outputCapture": "console"
},
{
"name": "Launch (Build and copy binaries only)",
Expand All @@ -24,18 +43,29 @@
"args": [
"--extensionDevelopmentPath=${workspaceFolder}/src/papyrus-lang-vscode"
],
"outFiles": ["${workspaceFolder}/src/papyrus-lang-vscode/out/**/*.js"]
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/src/papyrus-lang-vscode/dist/*.js"
],
"cwd": "${workspaceFolder}/src/papyrus-lang-vscode",
"internalConsoleOptions": "openOnSessionStart",
"outputCapture": "console"
},
{
"name": "Launch (Build extension only)",
"type": "extensionHost",
"request": "launch",
"pauseForSourceMap": true,
"runtimeExecutable": "${execPath}",
"preLaunchTask": "buildExtension",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}/src/papyrus-lang-vscode"
],
"outFiles": ["${workspaceFolder}/src/papyrus-lang-vscode/out/**/*.js"]
"outFiles": [
"${workspaceFolder}/src/papyrus-lang-vscode/dist/*.js"
],
"sourceMaps": true,
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": "Launch (No build)",
Expand All @@ -45,7 +75,11 @@
"args": [
"--extensionDevelopmentPath=${workspaceFolder}/src/papyrus-lang-vscode"
],
"outFiles": ["${workspaceFolder}/src/papyrus-lang-vscode/out/**/*.js"]
"outFiles": [
"${workspaceFolder}/src/papyrus-lang-vscode/dist/*.js"
],
"sourceMaps": true,
"internalConsoleOptions": "openOnSessionStart"
}
]
}
}
66 changes: 60 additions & 6 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@
"cake"
]
},
"problemMatcher": ["$tsc", "$msCompile"]
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$tsc",
"$msCompile"
]
},
{
"label": "updateBin",
Expand All @@ -26,9 +32,38 @@
"--target=\"update-bin\""
]
},
"options": {
"cwd": "${workspaceFolder}"
},
"command": "./build.sh",
"args": [
"--target=\"update-bin\""
],
"problemMatcher": [
"$tsc",
"$msCompile"
]
},
{
"label": "buildExtensionAndUpdateBin",
"windows": {
"command": "dotnet",
"args": [
"cake",
"--target=\"build-extension-and-update-bin\""
]
},
"options": {
"cwd": "${workspaceFolder}"
},
"command": "./build.sh",
"args": ["--target=\"update-bin\""],
"problemMatcher": ["$tsc", "$msCompile"]
"args": [
"--target=\"build-extension-and-update-bin\""
],
"problemMatcher": [
"$tsc",
"$msCompile"
]
},
{
"label": "buildExtension",
Expand All @@ -39,9 +74,28 @@
"--target=\"build-extension\""
]
},
"options": {
"cwd": "${workspaceFolder}"
},
"command": "./build.sh",
"args": ["--target=\"build-extension\""],
"problemMatcher": ["$tsc", "$msCompile"]
"args": [
"--target=\"build-extension\""
],
"problemMatcher": [
"$tsc",
"$msCompile"
]
},
{
"label": "tsc",
"type": "shell",
"command": "tsc",
"options": {
"cwd": "${workspaceFolder}/src/papyrus-lang-vscode"
},
"problemMatcher": [
"$tsc"
]
}
]
}
}
16 changes: 12 additions & 4 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,17 @@ Task("copy-debug-plugin")
CreateDirectory("./src/papyrus-lang-vscode/debug-plugin");

var configuration = isRelease ? "Release" : "Debug";
var skyrimPath = $"src/DarkId.Papyrus.DebugServer/bin/DarkId.Papyrus.DebugServer.Skyrim/x64/{configuration}/DarkId.Papyrus.DebugServer.Skyrim.dll";
var fallout4Path = $"src/DarkId.Papyrus.DebugServer/bin/DarkId.Papyrus.DebugServer.Fallout4/x64/{configuration}/DarkId.Papyrus.DebugServer.Fallout4.dll";
var copyDir = "./src/papyrus-lang-vscode/debug-plugin";

CopyFileToDirectory(
$"src/DarkId.Papyrus.DebugServer/bin/DarkId.Papyrus.DebugServer.Skyrim/x64/{configuration}/DarkId.Papyrus.DebugServer.Skyrim.dll",
"./src/papyrus-lang-vscode/debug-plugin");
skyrimPath,
copyDir);

CopyFileToDirectory(
$"src/DarkId.Papyrus.DebugServer/bin/DarkId.Papyrus.DebugServer.Fallout4/x64/{configuration}/DarkId.Papyrus.DebugServer.Fallout4.dll",
"./src/papyrus-lang-vscode/debug-plugin");
fallout4Path,
copyDir);
}
catch (Exception)
{
Expand Down Expand Up @@ -353,6 +356,11 @@ Task("update-bin")
Task("build-extension")
.IsDependentOn("npm-build");

Task("build-extension-and-update-bin")
.IsDependentOn("build-debugger")
.IsDependentOn("update-bin")
.IsDependentOn("build-extension");

Task("build-test")
.IsDependentOn("build")
.IsDependentOn("test");
Expand Down
1 change: 1 addition & 0 deletions src/papyrus-lang-vscode/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
debug-bin
debug-plugin
debug-address-library
pyro
out
node_modules
Expand Down
12 changes: 12 additions & 0 deletions src/papyrus-lang-vscode/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 25 additions & 22 deletions src/papyrus-lang-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,38 +67,41 @@
"type": "string",
"enum": [
"XSE",
"mo2"
"MO2"
]
},
"XSELoaderPath": {
"launcherPath": {
"type": "string"
},
"mo2Config": {
"type": "object",
"properties": {
"mo2Path": {
"shortcutURI": {
"type": "string"
},
"shortcut": {
"profile": {
"type": "string"
},
"modsFolder": {
"type": "string"
},
"args": {
"instanceINIPath": {
"type": "array"
}
},
"required": [
"mo2Path",
"shortcut",
"modsFolder"
]
"shortcutURI"
],
"additionalProperties": false
},
"args": {
"type": "array"
},
"ignoreConfigChecks": {
"type": "boolean"
}
},
"required": [
"game",
"launchType"
"launchType",
"launcherPath"
]
}
},
Expand All @@ -110,7 +113,7 @@
"type": "papyrus",
"game": "${3:fallout4}",
"request": "attach",
"projectPath": "^\"\\${workspaceFolder}/${1:Project.ppj}\""
"projectPath": "^\"\\${workspaceFolder}/${1:fallout4.ppj}\""
}
},
{
Expand All @@ -120,9 +123,9 @@
"type": "papyrus",
"game": "${3:fallout4}",
"request": "launch",
"projectPath": "^\"\\${workspaceFolder}/${1:Project.ppj}\"",
"launchType": "skse",
"XSELoaderPath": "^\"${5:C:/Program Files (x86)/Steam/steamapps/common/Fallout 4/F4SE/F4SE_loader.exe}\""
"projectPath": "^\"\\${workspaceFolder}/${1:fallout4.ppj}\"",
"launchType": "XSE",
"launcherPath": "^\"${5:C:/Program Files (x86)/Steam/steamapps/common/Fallout 4/F4SE/F4SE_loader.exe}\""
}
},
{
Expand All @@ -132,12 +135,11 @@
"type": "papyrus",
"game": "${3:fallout4}",
"request": "launch",
"launchType": "mo2",
"projectPath": "^\"\\${workspaceFolder}/${1:Project.ppj}\"",
"launchType": "MO2",
"projectPath": "^\"\\${workspaceFolder}/${1:fallout4.ppj}\"",
"launcherPath": "^\"${6:C:/Modding/MO2/ModOrganizer.exe}\"",
"mo2Config": {
"mo2Path": "^\"${6:C:/Modding/MO2/ModOrganizer.exe}\"",
"shortcut": "^\"${7:moshortcut://Skyrim Special Edition:SKSE}\"",
"modsFolder": "^\"${8:\\${env:LOCALAPPDATA\\}/ModOrganizer/Fallout 4/mods}\""
"shortcutURI": "^\"${7:moshortcut://Skyrim Special Edition:SKSE}\""
}
}
}
Expand Down Expand Up @@ -547,6 +549,7 @@
],
"dependencies": {
"@semantic-release/exec": "^6.0.3",
"@tybys/windows-file-version-info": "^1.0.5",
"@types/semantic-release": "^17.2.4",
"deepmerge": "^4.2.2",
"fast-deep-equal": "^3.1.3",
Expand Down
4 changes: 4 additions & 0 deletions src/papyrus-lang-vscode/src/PapyrusExtension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import { ShowWelcomeCommand } from './features/commands/ShowWelcomeCommand';
import { Container } from 'inversify';
import { IDebugLauncherService, DebugLauncherService } from "./debugger/DebugLauncherService";
import { IAddressLibraryInstallService, AddressLibraryInstallService } from "./debugger/AddressLibInstallService";
import { IMO2LaunchDescriptorFactory, MO2LaunchDescriptorFactory } from "./debugger/MO2LaunchDescriptorFactory";
import { IMO2ConfiguratorService, MO2ConfiguratorService } from "./debugger/MO2ConfiguratorService";

class PapyrusExtension implements Disposable {
private readonly _serviceContainer: Container;
Expand Down Expand Up @@ -70,6 +72,8 @@ class PapyrusExtension implements Disposable {
this._serviceContainer.bind(IDebugSupportInstallService).to(DebugSupportInstallService);
this._serviceContainer.bind(IDebugLauncherService).to(DebugLauncherService);
this._serviceContainer.bind(IAddressLibraryInstallService).to(AddressLibraryInstallService);
this._serviceContainer.bind(IMO2LaunchDescriptorFactory).to(MO2LaunchDescriptorFactory);
this._serviceContainer.bind(IMO2ConfiguratorService).to(MO2ConfiguratorService);

this._configProvider = this._serviceContainer.get(IExtensionConfigProvider);
this._clientManager = this._serviceContainer.get(ILanguageClientManager);
Expand Down
1 change: 1 addition & 0 deletions src/papyrus-lang-vscode/src/PapyrusGame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export function getGameIniName(game: PapyrusGame): string {
return game == PapyrusGame.fallout4 ? 'fallout4.ini' :'skyrim.ini';
}

// TODO: Support VR
export enum GameVariant {
Steam = "Steam",
GOG = "GOG",
Expand Down
Loading

0 comments on commit d84c190

Please sign in to comment.