@ripple-ts/language-server 0.2.189 → 0.2.190
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/package.json +3 -3
- package/src/utils.js +13 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ripple-ts/language-server",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.190",
|
|
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.65",
|
|
20
20
|
"vscode-languageserver-textdocument": "^1.0.12",
|
|
21
21
|
"vscode-uri": "^3.1.0",
|
|
22
|
-
"@ripple-ts/typescript-plugin": "0.2.
|
|
22
|
+
"@ripple-ts/typescript-plugin": "0.2.190"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"ripple": "0.2.
|
|
25
|
+
"ripple": "0.2.190"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"typescript": "^5.9.2"
|
package/src/utils.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/** @import { LanguageServiceContext } from '@volar/language-server' */
|
|
3
3
|
/** @import {RippleVirtualCode} from '@ripple-ts/typescript-plugin/src/language.js' */
|
|
4
4
|
// @ts-expect-error: ESM type import is fine
|
|
5
|
-
/** @import {
|
|
5
|
+
/** @import {is_identifier_obfuscated, deobfuscate_identifier, IDENTIFIER_OBFUSCATION_PREFIX} from 'ripple/compiler/internal/identifier/utils' */
|
|
6
6
|
|
|
7
7
|
const { URI } = require('vscode-uri');
|
|
8
8
|
const { createLogging, DEBUG } = require('@ripple-ts/typescript-plugin/src/utils.js');
|
|
@@ -20,21 +20,21 @@ const IMPORT_EXPORT_REGEX = {
|
|
|
20
20
|
from: /from\s*['"][^'"]*['"]\s*;?/,
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
/** @type {
|
|
24
|
-
let
|
|
25
|
-
/** @type {
|
|
26
|
-
let
|
|
27
|
-
/** @type {
|
|
28
|
-
let
|
|
23
|
+
/** @type {is_identifier_obfuscated} */
|
|
24
|
+
let is_identifier_obfuscated;
|
|
25
|
+
/** @type {deobfuscate_identifier} */
|
|
26
|
+
let deobfuscate_identifier;
|
|
27
|
+
/** @type {IDENTIFIER_OBFUSCATION_PREFIX} */
|
|
28
|
+
let IDENTIFIER_OBFUSCATION_PREFIX;
|
|
29
29
|
/** @type {RegExp} */
|
|
30
30
|
let obfuscatedImportRegex;
|
|
31
31
|
|
|
32
|
-
import('ripple/compiler/internal/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
import('ripple/compiler/internal/identifier/utils').then((imports) => {
|
|
33
|
+
is_identifier_obfuscated = imports.is_identifier_obfuscated;
|
|
34
|
+
deobfuscate_identifier = imports.deobfuscate_identifier;
|
|
35
|
+
IDENTIFIER_OBFUSCATION_PREFIX = imports.IDENTIFIER_OBFUSCATION_PREFIX;
|
|
36
36
|
obfuscatedImportRegex = new RegExp(
|
|
37
|
-
escapeRegExp(
|
|
37
|
+
escapeRegExp(IDENTIFIER_OBFUSCATION_PREFIX) + charAllowedWordRegex.source + '+',
|
|
38
38
|
'gm',
|
|
39
39
|
);
|
|
40
40
|
});
|
|
@@ -53,7 +53,7 @@ function escapeRegExp(source) {
|
|
|
53
53
|
* @returns {string}
|
|
54
54
|
*/
|
|
55
55
|
function deobfuscateImportDefinitions(text) {
|
|
56
|
-
return text.replace(obfuscatedImportRegex, (match) =>
|
|
56
|
+
return text.replace(obfuscatedImportRegex, (match) => deobfuscate_identifier(match));
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
/**
|