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

preliminary Starfield support #185

Draft
wants to merge 39 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
3d705d5
Add working launch configs
nikitalita Oct 1, 2023
fe7bf6f
add WIP MO2 configurator
nikitalita Oct 1, 2023
bb51560
Refactor non-vscode funcs to ease testing
nikitalita Oct 1, 2023
4e36917
Add Pex parsing
nikitalita Oct 1, 2023
4d7c8ad
Add WIP AddressLibInstallService
nikitalita Oct 1, 2023
5f34542
Search for GOG and Epic versions of Skyrim
nikitalita Oct 1, 2023
d84c190
working automatic launch configuration
nikitalita Oct 1, 2023
73a7c9e
debugserver: reminder comment
nikitalita Oct 1, 2023
4485672
debugserver: fix f4 execution event install
nikitalita Oct 1, 2023
f783502
Fix getGameINIFromMO2Profile
nikitalita Oct 1, 2023
e863582
fix address library install
nikitalita Oct 1, 2023
01923cd
add missing packages
nikitalita Oct 1, 2023
22fb237
add "unused-imports" plugin to auto-fix unused imports
nikitalita Oct 1, 2023
6333d1a
rerun eslint
nikitalita Oct 1, 2023
612edab
manual eslint fixes
nikitalita Oct 2, 2023
1e3556c
WIP Starfield debug support
nikitalita Oct 2, 2023
2e5737f
cleanup StarfieldDebugAdapterProxy
nikitalita Sep 24, 2023
b8b2665
refactor debug adapter into seperate files
nikitalita Sep 25, 2023
9cc163a
WORKING STARFIELD DEBUGGER
nikitalita Sep 25, 2023
823a2a1
More fixes for starfield debug adapter proxy
nikitalita Sep 29, 2023
90ef429
more fixes
nikitalita Sep 29, 2023
362a9c7
starfield DAP: add robust logging, add REPL xface
nikitalita Sep 30, 2023
17957fb
make debugadapterproxy options an object
nikitalita Sep 30, 2023
4065424
debugger nodes refactor
nikitalita Oct 1, 2023
7e29bf8
re-run eslint
nikitalita Oct 2, 2023
ac09a6e
further eslint fixes
nikitalita Oct 1, 2023
a762750
Move formatting and cap settings to base class
nikitalita Oct 1, 2023
c6c757a
make eslint only warn on formatting issues
nikitalita Oct 1, 2023
6497308
wip refactor nodes
nikitalita Oct 1, 2023
2df93fa
set prettier and unused-vars rules to 'warn'
nikitalita Oct 2, 2023
ce152a0
finished StarfieldDAP state refactor, untested
nikitalita Oct 2, 2023
9abb1a6
move sourceToObjectName to the bottom
nikitalita Oct 2, 2023
295ce2a
fix bugs, now its working again
nikitalita Oct 2, 2023
bb41baf
Starfield DAP: emit warning on limited form reflection
nikitalita Oct 2, 2023
a1aeac4
Lots of fixes to debug config launch and attach
nikitalita Oct 4, 2023
56d6c0c
add "Guard" to tmLanguage
nikitalita Oct 4, 2023
5fd6655
update build action to upload artifact
nikitalita Oct 4, 2023
137543c
bump version, add myself to credits
nikitalita Oct 4, 2023
5bb2811
add Fallout 4 GOG support
nikitalita Oct 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Build"
on:
push:
branches:
- '**'
- "**"

jobs:
build:
Expand All @@ -15,7 +15,7 @@ jobs:
- name: git credentials
uses: oleksiyrudenko/gha-git-credentials@v2-latest
with:
token: '${{ secrets.GH_TOKEN }}'
token: "${{ secrets.GH_TOKEN }}"
global: true

- name: Checkout
Expand Down Expand Up @@ -97,4 +97,12 @@ jobs:
# TODO: Rename this stuff for clarity once release build artifacts are being created
# TODO: Cleanup workflows for various event types in general
RELEASE: ${{( github.ref == 'refs/heads/main' || github.ref == 'refs/heads/prerelease') && github.event_name != 'pull_request' && github.event_name != 'pull_request_target' }}
PRERELEASE: ${{ github.ref == 'refs/heads/prerelease' && github.event_name != 'pull_request' && github.event_name != 'pull_request_target' }}
PRERELEASE: ${{ github.ref == 'refs/heads/prerelease' && github.event_name != 'pull_request' && github.event_name != 'pull_request_target' }}

- name: Upload Artifact
if: success()
uses: actions/upload-artifact@v2
continue-on-error: true
with:
name: artifact
path: c:/repo/src/papyrus-lang-vscode/papyrus-lang-*.vsix
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
2 changes: 1 addition & 1 deletion src/DarkId.Papyrus.DebugServer/PexCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ namespace DarkId::Papyrus::DebugServer
}
data.name = normname;
data.path = headerSrcName;
data.sourceReference = sourceReference;
data.sourceReference = sourceReference; // TODO: Remember to remove this when we get script references from the extension working
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/DarkId.Papyrus.DebugServer/RuntimeEvents.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ namespace DarkId::Papyrus::DebugServer
if (tasklet->topFrame)
{
// We don't need to set the instruction pointer because Fallout 4 assigns the IP every time an opcode is executed
g_InstructionExecutionEvent(tasklet, tasklet->topFrame->STACK_FRAME_IP);
g_InstructionExecutionEvent(tasklet);
}
}
// TODO: There's a second CreateStack() @ 1427422C0, do we need to hook that?
Expand Down
10 changes: 8 additions & 2 deletions src/papyrus-lang-vscode/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@ module.exports = {
overrides: [
{
files: ['*.ts'],
plugins: ['@typescript-eslint'],
plugins: ['@typescript-eslint', 'unused-imports'],
extends: ['plugin:@typescript-eslint/recommended'],
rules: {
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
'warn',
{ vars: 'all', varsIgnorePattern: '^_', args: 'after-used', argsIgnorePattern: '^_' },
],
'prettier/prettier': 'warn',
},
},
],
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
Loading