@ripple-ts/language-server 0.3.12 → 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 +36 -0
- package/package.json +3 -3
- package/src/autoInsertPlugin.js +1 -1
- package/src/compileErrorDiagnosticPlugin.js +7 -7
- package/src/definitionPlugin.js +1 -1
- package/src/utils.js +14 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# @ripple-ts/language-server
|
|
2
2
|
|
|
3
|
+
## 0.3.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies []:
|
|
8
|
+
- @ripple-ts/typescript-plugin@0.3.14
|
|
9
|
+
|
|
10
|
+
## 0.3.13
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#862](https://github.com/Ripple-TS/ripple/pull/862)
|
|
15
|
+
[`48af856`](https://github.com/Ripple-TS/ripple/commit/48af85678d5e1b32bb1c5e3fbb2fb07498bc88a3)
|
|
16
|
+
Thanks [@leonidaz](https://github.com/leonidaz)! - Add a release changeset for
|
|
17
|
+
the async tracking work introduced in commit
|
|
18
|
+
`4eb4d6851573d771d65f1e85b1b442ad3cdc53d2`.
|
|
19
|
+
|
|
20
|
+
This ships async tracking as a first-class feature in Ripple:
|
|
21
|
+
- remove and prohibit direct component-level `await`; async component flows now
|
|
22
|
+
require using `trackAsync()` (with `trackPending()` for pending state checks)
|
|
23
|
+
- add `trackAsync()` and `trackPending()` support so async values can be read
|
|
24
|
+
through Ripple's reactive runtime using tracked async values
|
|
25
|
+
- update compiler/runtime behavior for `try`/`catch`/`pending` boundaries so
|
|
26
|
+
async pending and error states can render and recover correctly in client and
|
|
27
|
+
SSR paths
|
|
28
|
+
- align `@ripple-ts/compat-react` async boundary behavior with the new Ripple
|
|
29
|
+
async tracking semantics
|
|
30
|
+
- update editor/tooling integration to match the new async syntax/runtime shape
|
|
31
|
+
|
|
32
|
+
- [`6e11177`](https://github.com/Ripple-TS/ripple/commit/6e111778cae4e7d9876e51e293520f0859eb5890)
|
|
33
|
+
Thanks [@trueadm](https://github.com/trueadm)! - Add `.rsrx` support across
|
|
34
|
+
Ripple tooling and rename the repository's tracked `.ripple` modules to `.rsrx`.
|
|
35
|
+
- Updated dependencies
|
|
36
|
+
[[`6e11177`](https://github.com/Ripple-TS/ripple/commit/6e111778cae4e7d9876e51e293520f0859eb5890)]:
|
|
37
|
+
- @ripple-ts/typescript-plugin@0.3.13
|
|
38
|
+
|
|
3
39
|
## 0.3.12
|
|
4
40
|
|
|
5
41
|
### Patch Changes
|
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"
|
package/src/autoInsertPlugin.js
CHANGED
|
@@ -38,7 +38,7 @@ function createAutoInsertPlugin() {
|
|
|
38
38
|
capabilities: {
|
|
39
39
|
autoInsertionProvider: {
|
|
40
40
|
triggerCharacters: ['>'],
|
|
41
|
-
configurationSections: ['ripple.autoClosingTags'],
|
|
41
|
+
configurationSections: ['ripple.autoClosingTags.enabled'],
|
|
42
42
|
},
|
|
43
43
|
documentOnTypeFormattingProvider: {
|
|
44
44
|
triggerCharacters: ['>'],
|
|
@@ -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 {
|
|
@@ -24,23 +24,23 @@ const IMPORT_EXPORT_REGEX = {
|
|
|
24
24
|
from: /from\s*['"][^'"]*['"]\s*;?/,
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
const RIPPLE_EXTENSIONS = ['.ripple', '.tsrx'];
|
|
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
|
|