Initial minimal commit

master
Deukhoofd 1 year ago
commit 39e17c304c
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
  1. 2
      .gitignore
  2. 76
      .vscode/launch.json
  3. 43
      .vscode/tasks.json
  4. 13768
      package-lock.json
  5. 99
      package.json
  6. 55
      src/extension.ts
  7. 20
      tsconfig.json

2
.gitignore vendored

@ -0,0 +1,2 @@
node_modules
dist

@ -0,0 +1,76 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"${workspaceFolder}/sampleWorkspace"
],
"outFiles": [
"${workspaceFolder}/dist/ext/**/*.js"
],
"preLaunchTask": "npm: watch"
},
{
"name": "Web Extension",
"type": "pwa-extensionHost",
"debugWebWorkerHost": true,
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionDevelopmentKind=web",
"${workspaceFolder}/sampleWorkspace"
],
"outFiles": [
"${workspaceFolder}/dist/web/**/*.js"
],
"preLaunchTask": "npm: watch-web"
},
{
"name": "Server",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/src/debugAdapter.ts",
"args": [
"--server=4711"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "npm: compile"
},
{
"name": "Tests",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"-u",
"tdd",
"--timeout",
"999999",
"--colors",
"./out/tests/"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"internalConsoleOptions": "openOnSessionStart",
"preLaunchTask": "npm: compile"
}
],
"compounds": [
{
"name": "Extension + Server",
"configurations": [
"Extension",
"Server"
]
}
]
}

43
.vscode/tasks.json vendored

@ -0,0 +1,43 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "compile",
"isBackground": false,
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": "$tsc-watch"
},
{
"type": "npm",
"script": "watch",
"group": "build",
"isBackground": true,
"problemMatcher": [
"$ts-webpack-watch",
"$tslint-webpack-watch"
]
},
{
"type": "npm",
"script": "compile-web",
"problemMatcher": [
"$ts-webpack",
"$tslint-webpack"
]
},
{
"type": "npm",
"script": "watch-web",
"group": "build",
"isBackground": true,
"problemMatcher": [
"$ts-webpack-watch",
"$tslint-webpack-watch"
]
}
]
}

13768
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -0,0 +1,99 @@
{
"name": "angelscriptdebuggervscode",
"version": "1.0.0",
"description": "",
"engines": {
"vscode": "^1.59.0"
},
"scripts": {
"vscode:prepublish": "yarn run package-ext && yarn run package-web",
"compile": "tsc -p ./",
"lint": "eslint src --ext ts",
"watch": "webpack --watch --devtool nosources-source-map --info-verbosity verbose --config ./build/extension.webpack.config.js",
"watch2": "tsc -watch -p ./",
"pretest": "yarn run compile && yarn run lint",
"test": "node ./out/test/runTest.js",
"package": "vsce package",
"publish": "vsce publish",
"package-ext": "webpack --mode production --config ./build/extension.webpack.config.js",
"compile-web": "webpack --devtool nosources-source-map --config ./build/web-extension.webpack.config.js",
"watch-web": "webpack --watch --devtool nosources-source-map --info-verbosity verbose --config ./build/web-extension.webpack.config.js",
"package-web": "webpack --mode production --config ./build/web-extension.webpack.config.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"await-notify": "1.0.1",
"vscode-debugadapter": "^1.49.0"
},
"devDependencies": {
"@types/glob": "^7.1.4",
"@types/mocha": "^9.0.0",
"@types/node": "^14.14.37",
"@types/vscode": "^1.59.0",
"@typescript-eslint/eslint-plugin": "^4.29.3",
"@typescript-eslint/parser": "^4.29.3",
"eslint": "^7.32.0",
"glob": "^7.1.7",
"mocha": "^9.1.0",
"ts-loader": "^8.1.0",
"typescript": "^4.3.5",
"vsce": "^1.96.1",
"vscode-debugadapter-testsupport": "^1.49.0",
"webpack": "^4.46.0",
"webpack-cli": "^3.3.12"
},
"main": "./dist/ext/extension.js",
"browser": "./dist/web/extension.js",
"activationEvents": [
"*"
],
"workspaceTrust": {
"request": "never"
},
"contributes": {
"breakpoints": [
{
"language": "angelscript"
}
],
"debuggers": [
{
"type": "angelscript",
"languages": [
"angelscript"
],
"label": "Angelscript Debug",
"program": "./out/debugAdapter.js",
"runtime": "node",
"configurationAttributes": {
"attach": {
"required": [
"port", "scriptPath"
],
"properties": {
"port": {
"type": "number",
"description": "Absolute path to a text file.",
"default": "8684"
},
"scriptPath": {
"type": "string",
"description": "Path to resolve the full path from a script section"
}
}
}
},
"initialConfigurations": [
{
"type": "mock",
"request": "attach",
"name": "Ask for file name",
"program": "${workspaceFolder}/${command:AskForProgramName}",
"stopOnEntry": true
}
]
}
]
}
}

@ -0,0 +1,55 @@
/*---------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------*/
'use strict';
import * as vscode from 'vscode';
/*
* The compile time flag 'runMode' controls how the debug adapter is run.
* Please note: the test suite only supports 'external' mode.
*/
export function activate(context: vscode.ExtensionContext) {
context.subscriptions.push(
vscode.debug.registerDebugConfigurationProvider(
'angelscript',
new AngelscriptDebugConfigurationProvider()
)
)
let factory = new AngelscriptAdapterClientDescriptorFactory();
context.subscriptions.push(
vscode.debug.registerDebugAdapterDescriptorFactory('angelscript', factory)
)
if ('dispose' in factory) {
context.subscriptions.push(factory)
}
}
export function deactivate() {
// nothing to do
}
class AngelscriptAdapterClientDescriptorFactory implements vscode.DebugAdapterDescriptorFactory {
createDebugAdapterDescriptor(session: vscode.DebugSession, executable: vscode.DebugAdapterExecutable | undefined): vscode.ProviderResult<vscode.DebugAdapterDescriptor> {
return new vscode.DebugAdapterServer(8684);
}
dispose() {
}
}
class AngelscriptDebugConfigurationProvider
implements vscode.DebugConfigurationProvider {
/**
* Try to add all missing attributes to the debug configuration being launched.
*/
resolveDebugConfiguration(
folder: vscode.WorkspaceFolder | undefined,
config: vscode.DebugConfiguration
): vscode.ProviderResult<vscode.DebugConfiguration> {
return config
}
}

@ -0,0 +1,20 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "out",
"lib": ["es6"],
"sourceMap": true,
"rootDir": "src",
"strict": true,
"noImplicitAny": false,
"removeComments": false,
"noUnusedLocals": true,
"noImplicitThis": true,
"inlineSourceMap": false,
"preserveConstEnums": true,
"strictNullChecks": true,
"noUnusedParameters": false
},
"exclude": ["node_modules"]
}
Loading…
Cancel
Save