Skip to content
This repository was archived by the owner on Sep 28, 2025. It is now read-only.

Commit 72ab657

Browse files
committed
chore: updating blockception dependencies
1 parent 3462482 commit 72ab657

File tree

17 files changed

+527
-180
lines changed

17 files changed

+527
-180
lines changed

client/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
},
2525
"dependencies": {
2626
"@blockception/shared": "^0.0.1",
27-
"bc-minecraft-bedrock-project": "^1.21.101-3",
28-
"bc-minecraft-bedrock-vanilla-data": "^1.21.80-7",
27+
"bc-minecraft-bedrock-project": "^1.21.101-5",
28+
"bc-minecraft-bedrock-vanilla-data": "^1.21.80-10",
2929
"node": "^24.1.0",
3030
"vscode-languageclient": "^9.0.1"
3131
},

client/tsconfig.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44
"esModuleInterop": true,
55
"forceConsistentCasingInFileNames": true,
66
"baseUrl": ".",
7-
"lib": ["ES2019"],
8-
"module": "commonjs",
9-
"moduleResolution": "node",
7+
"moduleResolution": "node16",
8+
"module": "Node16",
9+
"target": "ES2022",
10+
"lib": [
11+
"ES2022"
12+
],
1013
"noImplicitAny": true,
1114
"noImplicitReturns": true,
1215
"noUnusedLocals": false,
@@ -20,7 +23,6 @@
2023
"strictFunctionTypes": true,
2124
"strictNullChecks": true,
2225
"strictPropertyInitialization": true,
23-
"target": "es2019",
2426
"types": ["node", "jest"]
2527
},
2628
"exclude": ["node_modules", ".vscode-test", "*.test.ts", "__tests__"],

minecraft-bedrock-schemas

package-lock.json

Lines changed: 372 additions & 45 deletions
Large diffs are not rendered by default.

server/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@
2727
"@blockception/shared": "^0.0.1",
2828
"@daanv2/queue-processor": "^2.2.1",
2929
"@types/vscode": "^1.103.0",
30-
"bc-minecraft-bedrock-command": "^1.21.100-0",
31-
"bc-minecraft-bedrock-diagnoser": "^1.21.100-0",
32-
"bc-minecraft-bedrock-project": "^1.21.101-4",
33-
"bc-minecraft-bedrock-types": "^1.22.1-10",
34-
"bc-minecraft-bedrock-vanilla-data": "^1.21.80-6",
35-
"bc-minecraft-molang": "^1.21.100-6",
36-
"bc-minecraft-project": "^1.21.73-5",
30+
"bc-minecraft-bedrock-command": "^1.21.100-3",
31+
"bc-minecraft-bedrock-diagnoser": "^1.21.100-3",
32+
"bc-minecraft-bedrock-project": "^1.21.101-5",
33+
"bc-minecraft-bedrock-types": "^1.22.1-16",
34+
"bc-minecraft-bedrock-vanilla-data": "^1.21.80-10",
35+
"bc-minecraft-molang": "^1.21.100-8",
36+
"bc-minecraft-project": "^1.21.73-8",
3737
"bc-vscode-words": "^1.3.16",
3838
"comment-json": "^4.2.5",
3939
"fast-glob": "^3.3.3",

server/src/lib/lsp/completion/minecraft/selectors/scores.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export function provideCompletion(context: Context<CompletionContext>, selector:
1313
return Objectives.provideCompletion(context);
1414
}
1515

16-
if (Offset.IsWithin(selector, pos) || charBefore === "=") {
16+
if (Offset.isWithin(selector, pos) || charBefore === "=") {
1717
return provideRange(context);
1818
}
1919

server/src/lib/lsp/documents/manager.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
import {
2-
CancellationToken,
3-
Connection,
4-
TextDocuments,
5-
TextDocumentSyncKind
6-
} from "vscode-languageserver";
7-
import { FileOperationFilter } from "vscode-languageserver-protocol/lib/common/protocol.fileOperations";
1+
import { CancellationToken, Connection, TextDocuments, TextDocumentSyncKind } from "vscode-languageserver";
82
import { URI } from "vscode-uri";
93
import { Processor } from "../../util";
104
import { ExtensionContext } from "../extension";
@@ -61,7 +55,7 @@ export class DocumentManager
6155
}
6256

6357
onInitialize(capabilities: CapabilityBuilder): void {
64-
const filters: FileOperationFilter[] = [
58+
const filters = [
6559
{ pattern: { glob: "**/*.{mcfunction}", options: { ignoreCase: true } } },
6660
{ pattern: { glob: "**/*.{json,jsonc}", options: { ignoreCase: true } } },
6761
{ pattern: { glob: "**/*.{.mcignore,.mcattributes,.mcdefinitions}", options: { ignoreCase: true } } },
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import { MolangFunction } from "bc-minecraft-molang";
2+
import { OffsetWord } from "bc-vscode-words";
3+
import { SignatureInformation } from "vscode-languageserver";
4+
import { Offset } from "../../../../util";
5+
6+
export function generateSignatures(
7+
scope: string,
8+
cursor: number,
9+
items: MolangFunction[],
10+
parameters: OffsetWord[],
11+
query: string
12+
) {
13+
return items.filter((item) => item.id === query).map((item) => generateSignature(scope, cursor, item, parameters));
14+
}
15+
16+
export function generateSignature(
17+
scope: string,
18+
cursor: number,
19+
item: MolangFunction,
20+
parameters: OffsetWord[]
21+
): SignatureInformation {
22+
const out: SignatureInformation = {
23+
label: `${scope}.${item.id}`,
24+
activeParameter: parameters.length,
25+
documentation: item.documentation ?? `${scope}.${item.id}`,
26+
parameters: [],
27+
};
28+
29+
if (parameters.length > 0) {
30+
const last = parameters[parameters.length - 1];
31+
if (Offset.isAfter(last, cursor)) {
32+
out.activeParameter = out.activeParameter!! + 1;
33+
}
34+
}
35+
36+
if (item.parameters) {
37+
out.label += `(${item.parameters.map((p) => `<${p.id}>`).join(", ")})`;
38+
out.parameters = item.parameters.map((p) => {
39+
return { label: p.id, documentation: p.documentation };
40+
});
41+
}
42+
43+
return out;
44+
}

server/src/lib/lsp/signatures/minecraft/molang/geometries.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,19 @@ import { SignatureHelp } from "vscode-languageserver";
66
* @param doc
77
*/
88
export function provideSignature(): SignatureHelp | undefined {
9-
return undefined;
9+
return GeometrySignature;
1010
}
11+
12+
const GeometrySignature: SignatureHelp = {
13+
activeParameter: 1,
14+
activeSignature: 0,
15+
signatures: [
16+
{
17+
label: "Geometry",
18+
parameters: [
19+
{ label: "geometry.", documentation: "The geometry to use." },
20+
{ label: "<geometry>", documentation: "The model to access" },
21+
],
22+
},
23+
],
24+
};

server/src/lib/lsp/signatures/minecraft/molang/main.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import { Offset } from "../../../../util";
21
import { OffsetWord } from "bc-vscode-words";
32
import { Position, SignatureHelp } from "vscode-languageserver";
4-
import { TextDocument } from "../../../documents/text-document";
53
import { CreateMolangSetWords } from "../../../../minecraft/molang/words";
4+
import { TextDocument } from "../../../documents/text-document";
65

76
import * as Contexts from "./contexts";
87
import * as Geometry from "./geometries";
@@ -37,11 +36,10 @@ export function provideDocSignature(doc: TextDocument, cursor: Position): Signat
3736
export function provideSignature(text: OffsetWord, cursor: number): SignatureHelp | undefined {
3837
const words = CreateMolangSetWords(text.text, text.offset);
3938

40-
for (let I = 0; I < words.length; I++) {
41-
const word = words[I];
42-
if (Offset.IsWithin(word, cursor)) {
43-
return provideWordSignature(text);
44-
}
39+
let lastIndex = words.length - 1;
40+
for (; lastIndex >= 0; lastIndex--) {
41+
const r = provideWordSignature(words[lastIndex], cursor, words.slice(lastIndex + 1) ?? []);
42+
if (r) return r;
4543
}
4644

4745
return undefined;
@@ -52,7 +50,7 @@ export function provideSignature(text: OffsetWord, cursor: number): SignatureHel
5250
* @param text
5351
* @returns
5452
*/
55-
export function provideWordSignature(text: OffsetWord): SignatureHelp | undefined {
53+
export function provideWordSignature(text: OffsetWord, cursor: number, parameters: OffsetWord[]): SignatureHelp | undefined {
5654
const index = text.text.indexOf(".");
5755
let main: string | undefined = undefined;
5856
let sub: string | undefined = undefined;
@@ -71,11 +69,11 @@ export function provideWordSignature(text: OffsetWord): SignatureHelp | undefine
7169

7270
case "q":
7371
case "query":
74-
return Query.provideSignature(sub);
72+
return Query.provideSignature(sub, cursor, parameters);
7573

7674
case "m":
7775
case "math":
78-
return Math.provideSignature(sub);
76+
return Math.provideSignature(sub, cursor, parameters);
7977

8078
case "geometry":
8179
return Geometry.provideSignature();

0 commit comments

Comments
 (0)