@ripple-ts/language-server 0.3.13 → 0.3.14
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 +7 -0
- package/package.json +3 -3
- package/src/compileErrorDiagnosticPlugin.js +7 -7
- package/src/definitionPlugin.js +1 -1
- package/src/utils.js +13 -13
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ripple-ts/language-server",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.14",
|
|
4
4
|
"description": "Language Server Protocol implementation for Ripple",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -19,10 +19,10 @@
|
|
|
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.
|
|
22
|
+
"@ripple-ts/typescript-plugin": "0.3.14"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"ripple": "0.
|
|
25
|
+
"@tsrx/ripple": "0.0.2"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"typescript": "^5.9.3"
|
|
@@ -1,10 +1,10 @@
|
|
|
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 {
|
|
4
|
+
* @import {TSRXVirtualCode} from '@ripple-ts/typescript-plugin/src/language.js';
|
|
5
5
|
*/
|
|
6
6
|
// @ts-expect-error: ESM type import is fine
|
|
7
|
-
/** @import {
|
|
7
|
+
/** @import {TSRXCompileError} from '@tsrx/ripple'; */
|
|
8
8
|
|
|
9
9
|
const { getVirtualCode, createLogging } = require('./utils.js');
|
|
10
10
|
|
|
@@ -62,8 +62,8 @@ function createCompileErrorDiagnosticPlugin() {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
|
-
* @param {
|
|
66
|
-
* @param {
|
|
65
|
+
* @param {TSRXCompileError} error
|
|
66
|
+
* @param {TSRXVirtualCode} virtualCode
|
|
67
67
|
* @param {Mapper | undefined} sourceMap
|
|
68
68
|
* @param {TextDocument} document
|
|
69
69
|
* @returns {Diagnostic}
|
|
@@ -121,7 +121,7 @@ function parseCompilationErrorWithDocument(error, virtualCode, sourceMap, docume
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
/**
|
|
124
|
-
* @param {
|
|
124
|
+
* @param {TSRXCompileError} error
|
|
125
125
|
* @param {TextDocument} document
|
|
126
126
|
* @returns {Range}
|
|
127
127
|
*/
|
|
@@ -134,7 +134,7 @@ function get_error_range_from_source(error, document) {
|
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
/**
|
|
137
|
-
* @param {
|
|
137
|
+
* @param {TSRXCompileError} error
|
|
138
138
|
* @param {number} [start_offset]
|
|
139
139
|
* @returns {number}
|
|
140
140
|
*/
|
|
@@ -148,7 +148,7 @@ function get_end_offset_from_error(error, start_offset) {
|
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
/**
|
|
151
|
-
* @param {
|
|
151
|
+
* @param {TSRXCompileError} error
|
|
152
152
|
* @returns {number}
|
|
153
153
|
*/
|
|
154
154
|
function get_start_offset_from_error(error) {
|
package/src/definitionPlugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @import { LanguageServicePlugin, LocationLink } from '@volar/language-server'; */
|
|
2
2
|
// @ts-expect-error type-only import from ESM module into CJS is fine
|
|
3
|
-
/** @import { DefinitionLocation } from 'ripple
|
|
3
|
+
/** @import { DefinitionLocation } from '@tsrx/ripple'; */
|
|
4
4
|
|
|
5
5
|
const { TextDocument } = require('vscode-languageserver-textdocument');
|
|
6
6
|
const { getVirtualCode, createLogging, getWordFromPosition } = require('./utils.js');
|
package/src/utils.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** @import { TextDocument } from 'vscode-languageserver-textdocument' */
|
|
2
2
|
/** @import { LanguageServiceContext, Mapper, SourceScript } from '@volar/language-server' */
|
|
3
|
-
/** @
|
|
3
|
+
/** @typedef {import('@ripple-ts/typescript-plugin/src/language.js').TSRXVirtualCode} TSRXVirtualCode */
|
|
4
4
|
// @ts-expect-error: ESM type import is fine
|
|
5
|
-
/** @import {
|
|
5
|
+
/** @import { isIdentifierObfuscated, deobfuscateIdentifier, IDENTIFIER_OBFUSCATION_PREFIX } from '@tsrx/core' */
|
|
6
6
|
|
|
7
7
|
const { URI } = require('vscode-uri');
|
|
8
8
|
const {
|
|
@@ -26,21 +26,21 @@ const IMPORT_EXPORT_REGEX = {
|
|
|
26
26
|
|
|
27
27
|
const RIPPLE_EXTENSIONS = ['.ripple', '.rsrx', '.tsrx'];
|
|
28
28
|
|
|
29
|
-
/** @type {
|
|
29
|
+
/** @type {typeof isIdentifierObfuscated} */
|
|
30
30
|
let is_identifier_obfuscated;
|
|
31
|
-
/** @type {
|
|
31
|
+
/** @type {typeof deobfuscateIdentifier} */
|
|
32
32
|
let deobfuscate_identifier;
|
|
33
|
-
/** @type {IDENTIFIER_OBFUSCATION_PREFIX} */
|
|
34
|
-
let
|
|
33
|
+
/** @type {typeof IDENTIFIER_OBFUSCATION_PREFIX} */
|
|
34
|
+
let identifier_obfuscation_prefix;
|
|
35
35
|
/** @type {RegExp} */
|
|
36
36
|
let obfuscated_identifier_regex;
|
|
37
37
|
|
|
38
|
-
import('
|
|
39
|
-
is_identifier_obfuscated = imports.
|
|
40
|
-
deobfuscate_identifier = imports.
|
|
41
|
-
|
|
38
|
+
import('@tsrx/core').then((imports) => {
|
|
39
|
+
is_identifier_obfuscated = imports.isIdentifierObfuscated;
|
|
40
|
+
deobfuscate_identifier = imports.deobfuscateIdentifier;
|
|
41
|
+
identifier_obfuscation_prefix = imports.IDENTIFIER_OBFUSCATION_PREFIX;
|
|
42
42
|
obfuscated_identifier_regex = new RegExp(
|
|
43
|
-
escapeRegExp(
|
|
43
|
+
escapeRegExp(identifier_obfuscation_prefix) + charAllowedWordRegex.source + '+',
|
|
44
44
|
'gm',
|
|
45
45
|
);
|
|
46
46
|
});
|
|
@@ -76,7 +76,7 @@ function concatMarkdownContents(...contents) {
|
|
|
76
76
|
* @param {TextDocument} document
|
|
77
77
|
* @returns
|
|
78
78
|
{{
|
|
79
|
-
virtualCode:
|
|
79
|
+
virtualCode: TSRXVirtualCode;
|
|
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 {
|
|
92
|
+
const virtualCode = /** @type {TSRXVirtualCode} */ (
|
|
93
93
|
sourceScript?.generated?.embeddedCodes.get(virtualCodeId)
|
|
94
94
|
);
|
|
95
95
|
|