@ripple-ts/language-server 0.3.16 → 0.3.18

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @ripple-ts/language-server
2
2
 
3
+ ## 0.3.18
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies []:
8
+ - @ripple-ts/typescript-plugin@0.3.18
9
+
10
+ ## 0.3.17
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies []:
15
+ - @ripple-ts/typescript-plugin@0.3.17
16
+
3
17
  ## 0.3.16
4
18
 
5
19
  ### Patch Changes
package/README.md CHANGED
@@ -29,8 +29,8 @@ are also specialized plugins for popular editors.
29
29
 
30
30
  #### VS Code
31
31
 
32
- Use the [official
33
- extension](https://marketplace.visualstudio.com/items?itemName=Ripple-TS.ripple-ts-vscode-plugin
32
+ Use the
33
+ [official extension](https://marketplace.visualstudio.com/items?itemName=Ripple-TS.ripple-ts-vscode-plugin)
34
34
  It uses this language server internally.
35
35
 
36
36
  #### WebStorm/IntelliJ
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ripple-ts/language-server",
3
- "version": "0.3.16",
3
+ "version": "0.3.18",
4
4
  "description": "Language Server Protocol implementation for Ripple",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -19,10 +19,11 @@
19
19
  "volar-service-typescript": "0.0.70",
20
20
  "vscode-languageserver-textdocument": "^1.0.12",
21
21
  "vscode-uri": "^3.1.0",
22
- "@ripple-ts/typescript-plugin": "0.3.16"
22
+ "@ripple-ts/typescript-plugin": "0.3.18",
23
+ "@tsrx/core": "0.0.4"
23
24
  },
24
25
  "devDependencies": {
25
- "@tsrx/ripple": "0.0.4"
26
+ "@tsrx/ripple": "0.0.5"
26
27
  },
27
28
  "peerDependencies": {
28
29
  "typescript": "^5.9.3"
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * @import {Diagnostic, Range, LanguageServicePlugin, LanguageServiceContext, Position, Mapper} from '@volar/language-server';
3
3
  * @import {TextDocument} from 'vscode-languageserver-textdocument';
4
- * @import {TSRXVirtualCode} from '@ripple-ts/typescript-plugin/src/language.js';
4
+ * @import {TSRXVirtualCodeInstance} from '@ripple-ts/typescript-plugin/src/language.js';
5
5
  */
6
- // @ts-expect-error: ESM type import is fine
6
+ // @ts-ignore: ESM type import is fine
7
7
  /** @import {TSRXCompileError} from '@tsrx/ripple'; */
8
8
 
9
9
  const { getVirtualCode, createLogging } = require('./utils.js');
@@ -63,7 +63,7 @@ function createCompileErrorDiagnosticPlugin() {
63
63
 
64
64
  /**
65
65
  * @param {TSRXCompileError} error
66
- * @param {TSRXVirtualCode} virtualCode
66
+ * @param {TSRXVirtualCodeInstance} virtualCode
67
67
  * @param {Mapper | undefined} sourceMap
68
68
  * @param {TextDocument} document
69
69
  * @returns {Diagnostic}
@@ -1,5 +1,5 @@
1
1
  /** @import { LanguageServicePlugin, LocationLink } from '@volar/language-server'; */
2
- // @ts-expect-error type-only import from ESM module into CJS is fine
2
+ // @ts-ignore type-only import from ESM module into CJS is fine
3
3
  /** @import { DefinitionLocation } from '@tsrx/ripple'; */
4
4
 
5
5
  const { TextDocument } = require('vscode-languageserver-textdocument');
@@ -140,7 +140,9 @@ function createDefinitionPlugin() {
140
140
  const loc = /** @type {DefinitionLocation} */ (def.location);
141
141
 
142
142
  const embeddedCode = loc.embeddedId
143
- ? virtualCode.embeddedCodes?.find(({ id }) => id === loc.embeddedId)
143
+ ? virtualCode.embeddedCodes?.find(
144
+ (/** @type {{ id: string }} */ { id }) => id === loc.embeddedId,
145
+ )
144
146
  : undefined;
145
147
 
146
148
  if (embeddedCode) {
package/src/server.js CHANGED
@@ -124,7 +124,7 @@ function createRippleLanguageServer() {
124
124
 
125
125
  // Register file watchers for TypeScript/JavaScript files so the language
126
126
  // server is notified when they change on disk. Without this, changes to
127
- // .ts files that are imported by .ripple files are not detected, causing
127
+ // .ts files that are imported by .tsrx files are not detected, causing
128
128
  // stale diagnostics until the server is restarted.
129
129
  try {
130
130
  await server.fileWatcher.watchFiles([
@@ -24,8 +24,8 @@ getUserPreferencesModule.getUserPreferences = async function (context, document)
24
24
  return {
25
25
  preferTypeOnlyAutoImports: true,
26
26
  ...origPreferences,
27
- ...tsConfig?.preferences,
28
- ...rippleConfig?.preferences,
27
+ .../** @type {any} */ (tsConfig)?.preferences,
28
+ .../** @type {any} */ (rippleConfig)?.preferences,
29
29
  };
30
30
  };
31
31
 
package/src/utils.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /** @import { TextDocument } from 'vscode-languageserver-textdocument' */
2
2
  /** @import { LanguageServiceContext, Mapper, SourceScript } from '@volar/language-server' */
3
- /** @typedef {import('@ripple-ts/typescript-plugin/src/language.js').TSRXVirtualCode} TSRXVirtualCode */
4
- // @ts-expect-error: ESM type import is fine
3
+ /** @import {TSRXVirtualCodeInstance} from '@ripple-ts/typescript-plugin/src/language.js'; */
4
+ // @ts-ignore: ESM type import is fine
5
5
  /** @import { isIdentifierObfuscated, deobfuscateIdentifier, IDENTIFIER_OBFUSCATION_PREFIX } from '@tsrx/core' */
6
6
 
7
7
  const { URI } = require('vscode-uri');
@@ -24,7 +24,7 @@ const IMPORT_EXPORT_REGEX = {
24
24
  from: /from\s*['"][^'"]*['"]\s*;?/,
25
25
  };
26
26
 
27
- const RIPPLE_EXTENSIONS = ['.ripple', '.rsrx', '.tsrx'];
27
+ const RIPPLE_EXTENSIONS = ['.tsrx'];
28
28
 
29
29
  /** @type {typeof isIdentifierObfuscated} */
30
30
  let is_identifier_obfuscated;
@@ -76,7 +76,7 @@ function concatMarkdownContents(...contents) {
76
76
  * @param {TextDocument} document
77
77
  * @returns
78
78
  {{
79
- virtualCode: TSRXVirtualCode;
79
+ virtualCode: TSRXVirtualCodeInstance;
80
80
  sourceUri: URI;
81
81
  sourceScript: SourceScript<URI> | undefined;
82
82
  sourceMap: Mapper | undefined;
@@ -89,7 +89,7 @@ function getVirtualCode(document, context) {
89
89
  );
90
90
  const [sourceUri, virtualCodeId] = decoded;
91
91
  const sourceScript = context.language.scripts.get(sourceUri);
92
- const virtualCode = /** @type {TSRXVirtualCode} */ (
92
+ const virtualCode = /** @type {TSRXVirtualCodeInstance} */ (
93
93
  sourceScript?.generated?.embeddedCodes.get(virtualCodeId)
94
94
  );
95
95
 
package/tsconfig.json CHANGED
@@ -3,12 +3,14 @@
3
3
  "module": "node16",
4
4
  "moduleResolution": "node16",
5
5
  "target": "es2020",
6
+ "lib": ["es2020"],
6
7
  "allowJs": true,
7
8
  "checkJs": true,
8
9
  "noEmit": true,
9
10
  "strict": true,
10
11
  "esModuleInterop": true,
11
12
  "resolveJsonModule": true,
13
+ "skipLibCheck": true,
12
14
  "types": []
13
15
  },
14
16
  "include": ["src/**/*.js", "index.js", "bin/**/*.js"],
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "module": "esnext",
5
+ "moduleResolution": "bundler",
6
+ "lib": ["esnext", "dom", "dom.iterable"],
7
+ "target": "esnext"
8
+ }
9
+ }