Skip to content

package updates #740

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

Merged
merged 7 commits into from
Oct 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8,310 changes: 4,888 additions & 3,422 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1109,12 +1109,12 @@
"@types/request": "^2.48.5",
"@types/ws": "^7.2.5",
"@types/xmldom": "^0.1.29",
"@typescript-eslint/eslint-plugin": "^3.4.0",
"@typescript-eslint/parser": "^3.4.0",
"eslint": "^7.3.1",
"eslint-config-airbnb": "^18.2.0",
"@typescript-eslint/eslint-plugin": "^4.32.0",
"@typescript-eslint/parser": "^4.32.0",
"eslint": "^7.32.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.21.2",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.1.4",
Expand All @@ -1127,7 +1127,7 @@
"prettier": "^2.0.5",
"tape": "^5.0.1",
"ts-loader": "^7.0.5",
"typescript": "^3.9.5",
"typescript": "^4.4.3",
"vsce": "^1.93.0",
"vscode-debugadapter-testsupport": "^1.41.0",
"vscode-dts": "^0.3.1",
Expand All @@ -1136,19 +1136,19 @@
"webpack-cli": "^4.5.0"
},
"dependencies": {
"@xmldom/xmldom": "^0.7.5",
"await-notify": "^1.0.1",
"core-js": "^3.6.5",
"domexception": "^2.0.1",
"glob": "^7.1.6",
"iconv-lite": "^0.6.0",
"mkdirp": "^1.0.4",
"node-fetch": "^3.0.0-beta.9",
"node-fetch": "^3.0.0",
"request": "^2.88.2",
"vscode-cache": "^0.3.0",
"vscode-debugadapter": "^1.41.0",
"vscode-debugprotocol": "^1.41.0",
"vscode-extension-telemetry": "^0.1.6",
"ws": "^7.4.6",
"xmldom": "^0.5.0"
"ws": "^7.4.6"
}
}
6 changes: 5 additions & 1 deletion src/api/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import fetch from "node-fetch";
// import fetch from "node-fetch";
// mod.cjs
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const fetch = (...args) => import("node-fetch").then(({ default: fetch }) => fetch(...args));
import * as httpModule from "http";
import * as httpsModule from "https";
import * as url from "url";
Expand Down
2 changes: 1 addition & 1 deletion src/debug/dbgp.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { EventEmitter } from "events";
import * as WebSocket from "ws";
import * as iconv from "iconv-lite";
import { DOMParser } from "xmldom";
import { DOMParser } from "@xmldom/xmldom";

/** The encoding all XDebug messages are encoded with */
export const ENCODING = "iso-8859-1";
Expand Down
3 changes: 2 additions & 1 deletion src/debug/debugAdapterFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import vscode = require("vscode");
import { ObjectScriptDebugSession } from "./debugSession";

export class ObjectScriptDebugAdapterDescriptorFactory
implements vscode.DebugAdapterDescriptorFactory, vscode.Disposable {
implements vscode.DebugAdapterDescriptorFactory, vscode.Disposable
{
private server?: net.Server;

public createDebugAdapterDescriptor(
Expand Down
66 changes: 32 additions & 34 deletions src/debug/debugSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,44 +406,42 @@ export class ObjectScriptDebugSession extends LoggingDebugSession {
const stack = await this._connection.sendStackGetCommand();

const stackFrames = await Promise.all(
stack.stack.map(
async (stackFrame: xdebug.StackFrame, index): Promise<StackFrame> => {
const [, namespace, name] = decodeURI(stackFrame.fileUri).match(/^dbgp:\/\/\|([^|]+)\|(.*)$/);
const routine = name;
// const routine = name.includes(".") ? name : name + ".int";
const fileUri = DocumentContentProvider.getUri(routine, this._workspace, namespace).toString();
const source = new Source(routine, fileUri);
let line = stackFrame.line + 1;
const place = `${stackFrame.method}+${stackFrame.methodOffset}`;
const stackFrameId = this._stackFrameIdCounter++;
let noSource = false;
try {
const document = await vscode.workspace.openTextDocument(vscode.Uri.parse(source.path));
if (source.name.endsWith(".cls") && stackFrame.method !== "") {
const methodMatchPattern = new RegExp(`^(Class)?Method ${stackFrame.method}(?=[( ])`, "i");
for (let i = 0; i < document.lineCount; i++) {
const codeLine = document.lineAt(i);

const methodMatch = codeLine.text.match(methodMatchPattern);
if (methodMatch) {
line = i + 2 + stackFrame.methodOffset;
break;
}
stack.stack.map(async (stackFrame: xdebug.StackFrame, index): Promise<StackFrame> => {
const [, namespace, name] = decodeURI(stackFrame.fileUri).match(/^dbgp:\/\/\|([^|]+)\|(.*)$/);
const routine = name;
// const routine = name.includes(".") ? name : name + ".int";
const fileUri = DocumentContentProvider.getUri(routine, this._workspace, namespace).toString();
const source = new Source(routine, fileUri);
let line = stackFrame.line + 1;
const place = `${stackFrame.method}+${stackFrame.methodOffset}`;
const stackFrameId = this._stackFrameIdCounter++;
let noSource = false;
try {
const document = await vscode.workspace.openTextDocument(vscode.Uri.parse(source.path));
if (source.name.endsWith(".cls") && stackFrame.method !== "") {
const methodMatchPattern = new RegExp(`^(Class)?Method ${stackFrame.method}(?=[( ])`, "i");
for (let i = 0; i < document.lineCount; i++) {
const codeLine = document.lineAt(i);

const methodMatch = codeLine.text.match(methodMatchPattern);
if (methodMatch) {
line = i + 2 + stackFrame.methodOffset;
break;
}
}
this._stackFrames.set(stackFrameId, stackFrame);
} catch (ex) {
noSource = true;
}
return {
id: stackFrameId,
name: place,
source: noSource ? null : source,
line,
column: 1,
};
this._stackFrames.set(stackFrameId, stackFrame);
} catch (ex) {
noSource = true;
}
)
return {
id: stackFrameId,
name: place,
source: noSource ? null : source,
line,
column: 1,
};
})
);

response.body = {
Expand Down
3 changes: 2 additions & 1 deletion src/languageConfiguration.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { IndentAction, LanguageConfiguration } from "vscode";

export const WORD_PATTERN = /((?<=(class|extends|as|of) )(%?\b[a-z0-9]+(\.[a-z0-9]+)*\b))|(\^[a-z0-9]+(\.[a-z0-9]+)*)|((\${1,3}|[irm]?%|\^|#)?[a-z0-9]+)/i;
export const WORD_PATTERN =
/((?<=(class|extends|as|of) )(%?\b[a-z0-9]+(\.[a-z0-9]+)*\b))|(\^[a-z0-9]+(\.[a-z0-9]+)*)|((\${1,3}|[irm]?%|\^|#)?[a-z0-9]+)/i;

export function getLanguageConfiguration(lang: string): LanguageConfiguration {
return {
Expand Down
3 changes: 2 additions & 1 deletion src/providers/ObjectScriptCompletionItemProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,8 @@ export class ObjectScriptCompletionItemProvider implements vscode.CompletionItem
className = text.split(" ").pop();
}
// tslint:disable-next-line: max-line-length
pattern = /(?:(Extends |CompileAfter *=|DependsOn *=|PropertyClass *=) *\(? *)((%?[a-zA-Z0-9]*(?:\.[a-zA-Z0-9]*)*)(, *%?[a-zA-Z0-9]*(?:\.[a-zA-Z0-9]*)*|, *)*.?)?/i;
pattern =
/(?:(Extends |CompileAfter *=|DependsOn *=|PropertyClass *=) *\(? *)((%?[a-zA-Z0-9]*(?:\.[a-zA-Z0-9]*)*)(, *%?[a-zA-Z0-9]*(?:\.[a-zA-Z0-9]*)*|, *)*.?)?/i;
if (
!range &&
// && (!document.getWordRangeAtPosition(position, /\bExtends\b\s*/i))
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "./tsconfig.base.json",
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"target": "es2019",
"outDir": "out",
"moduleResolution": "node",
"lib": ["esnext", "dom"],
Expand Down