@spyglassmc/language-server 0.4.50 → 0.4.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/server.js +9 -9
  2. package/package.json +6 -6
package/lib/server.js CHANGED
@@ -153,7 +153,7 @@ connection.onDidCloseTextDocument(({ textDocument: { uri } }) => {
153
153
  connection.workspace.onDidRenameFiles(({}) => { });
154
154
  connection.onCodeAction(async ({ textDocument: { uri }, range }) => {
155
155
  const docAndNode = await service.project.ensureClientManagedChecked(uri);
156
- if (!docAndNode) {
156
+ if (!docAndNode || !service.project.config.env.feature.codeActions) {
157
157
  return undefined;
158
158
  }
159
159
  const { doc, node } = docAndNode;
@@ -171,7 +171,7 @@ connection.onColorPresentation(async ({ textDocument: { uri }, color, range }) =
171
171
  });
172
172
  connection.onDocumentColor(async ({ textDocument: { uri } }) => {
173
173
  const docAndNode = await service.project.ensureClientManagedChecked(uri);
174
- if (!docAndNode) {
174
+ if (!docAndNode || !service.project.config.env.feature.colors) {
175
175
  return undefined;
176
176
  }
177
177
  const { doc, node } = docAndNode;
@@ -180,7 +180,7 @@ connection.onDocumentColor(async ({ textDocument: { uri } }) => {
180
180
  });
181
181
  connection.onCompletion(async ({ textDocument: { uri }, position, context }) => {
182
182
  const docAndNode = await service.project.ensureClientManagedChecked(uri);
183
- if (!docAndNode) {
183
+ if (!docAndNode || !service.project.config.env.feature.completions) {
184
184
  return undefined;
185
185
  }
186
186
  const { doc, node } = docAndNode;
@@ -251,7 +251,7 @@ connection.onTypeDefinition(async ({ textDocument: { uri }, position }) => {
251
251
  });
252
252
  connection.onDocumentHighlight(async ({ textDocument: { uri }, position }) => {
253
253
  const docAndNode = await service.project.ensureClientManagedChecked(uri);
254
- if (!docAndNode) {
254
+ if (!docAndNode || !service.project.config.env.feature.documentHighlighting) {
255
255
  return undefined;
256
256
  }
257
257
  const { doc, node } = docAndNode;
@@ -268,7 +268,7 @@ connection.onDocumentSymbol(async ({ textDocument: { uri } }) => {
268
268
  });
269
269
  connection.onHover(async ({ textDocument: { uri }, position }) => {
270
270
  const docAndNode = await service.project.ensureClientManagedChecked(uri);
271
- if (!docAndNode) {
271
+ if (!docAndNode || !service.project.config.env.feature.hover) {
272
272
  return undefined;
273
273
  }
274
274
  const { doc, node } = docAndNode;
@@ -292,7 +292,7 @@ connection.onRequest('spyglassmc/showCacheRoot', async () => {
292
292
  });
293
293
  connection.languages.semanticTokens.on(async ({ textDocument: { uri } }) => {
294
294
  const docAndNode = await service.project.ensureClientManagedChecked(uri);
295
- if (!docAndNode) {
295
+ if (!docAndNode || !service.project.config.env.feature.semanticColoring) {
296
296
  return { data: [] };
297
297
  }
298
298
  const { doc, node } = docAndNode;
@@ -301,7 +301,7 @@ connection.languages.semanticTokens.on(async ({ textDocument: { uri } }) => {
301
301
  });
302
302
  connection.languages.semanticTokens.onRange(async ({ textDocument: { uri }, range }) => {
303
303
  const docAndNode = await service.project.ensureClientManagedChecked(uri);
304
- if (!docAndNode) {
304
+ if (!docAndNode || !service.project.config.env.feature.semanticColoring) {
305
305
  return { data: [] };
306
306
  }
307
307
  const { doc, node } = docAndNode;
@@ -310,7 +310,7 @@ connection.languages.semanticTokens.onRange(async ({ textDocument: { uri }, rang
310
310
  });
311
311
  connection.onSignatureHelp(async ({ textDocument: { uri }, position }) => {
312
312
  const docAndNode = await service.project.ensureClientManagedChecked(uri);
313
- if (!docAndNode) {
313
+ if (!docAndNode || !service.project.config.env.feature.signatures) {
314
314
  return undefined;
315
315
  }
316
316
  const { doc, node } = docAndNode;
@@ -322,7 +322,7 @@ connection.onWorkspaceSymbol(({ query }) => {
322
322
  });
323
323
  connection.onDocumentFormatting(async ({ textDocument: { uri }, options }) => {
324
324
  const docAndNode = await service.project.ensureClientManagedChecked(uri);
325
- if (!docAndNode) {
325
+ if (!docAndNode || !service.project.config.env.feature.formatting) {
326
326
  return undefined;
327
327
  }
328
328
  const { doc, node } = docAndNode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spyglassmc/language-server",
3
- "version": "0.4.50",
3
+ "version": "0.4.52",
4
4
  "type": "module",
5
5
  "main": "lib/server.js",
6
6
  "types": "lib/server.d.ts",
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "scripts": {
17
17
  "release": "npm publish",
18
- "release:dry": "npm publish --dry-run",
18
+ "release:dry": "npm publish --tag latest --dry-run",
19
19
  "build": "wireit",
20
20
  "build:dev": "wireit"
21
21
  },
@@ -35,10 +35,10 @@
35
35
  "env-paths": "^2.2.1",
36
36
  "vscode-languageserver": "^9.0.1",
37
37
  "vscode-languageserver-textdocument": "^1.0.11",
38
- "@spyglassmc/core": "0.4.38",
39
- "@spyglassmc/java-edition": "0.3.50",
40
- "@spyglassmc/locales": "0.3.19",
41
- "@spyglassmc/mcdoc": "0.3.42"
38
+ "@spyglassmc/core": "0.4.40",
39
+ "@spyglassmc/java-edition": "0.3.52",
40
+ "@spyglassmc/locales": "0.3.20",
41
+ "@spyglassmc/mcdoc": "0.3.44"
42
42
  },
43
43
  "publishConfig": {
44
44
  "access": "public"