@ripple-ts/language-server 0.3.10 → 0.3.12

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,27 @@
1
1
  # @ripple-ts/language-server
2
2
 
3
+ ## 0.3.12
4
+
5
+ ### Patch Changes
6
+
7
+ - [#859](https://github.com/Ripple-TS/ripple/pull/859)
8
+ [`cdd31ba`](https://github.com/Ripple-TS/ripple/commit/cdd31ba4c07ce504b01d56533e19a6ba37879f5a)
9
+ Thanks [@trueadm](https://github.com/trueadm)! - Add first-phase `.tsrx` support
10
+ across the core Ripple tooling so Vite, Rollup, TypeScript, the language server,
11
+ Prettier, ESLint, and editor integrations accept both `.ripple` and `.tsrx`
12
+ files.
13
+
14
+ - Updated dependencies
15
+ [[`cdd31ba`](https://github.com/Ripple-TS/ripple/commit/cdd31ba4c07ce504b01d56533e19a6ba37879f5a)]:
16
+ - @ripple-ts/typescript-plugin@0.3.12
17
+
18
+ ## 0.3.11
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies []:
23
+ - @ripple-ts/typescript-plugin@0.3.11
24
+
3
25
  ## 0.3.10
4
26
 
5
27
  ### Patch Changes
package/README.md CHANGED
@@ -43,7 +43,7 @@ It uses this language server internally.
43
43
  3. Add a new language server in it
44
44
  4. Specify `ripple-language-server --stdio` as the command in it.
45
45
  5. Go to `Mappings` —> `File name patterns` and add a new value with
46
- `File name patterns` set to `*.ripple` and `Language Id` set to `ripple.
46
+ `File name patterns` set to `*.tsrx` and `Language Id` set to `ripple`.
47
47
 
48
48
  #### Neovim (v0.11+)
49
49
 
@@ -90,7 +90,7 @@ release:
90
90
  5. Copy the `Ripple.sublime-package` file into `Installed Packages/` and restart
91
91
  Sublime Text.
92
92
 
93
- Diagnostics, completions, and other features should work in `.ripple` files now.
93
+ Diagnostics, completions, and other features should work in `.tsrx` files now.
94
94
 
95
95
  ## Standalone Usage
96
96
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ripple-ts/language-server",
3
- "version": "0.3.10",
3
+ "version": "0.3.12",
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.10"
22
+ "@ripple-ts/typescript-plugin": "0.3.12"
23
23
  },
24
24
  "devDependencies": {
25
- "ripple": "0.3.10"
25
+ "ripple": "0.3.12"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "typescript": "^5.9.3"
@@ -1,6 +1,6 @@
1
1
  /** @import { LanguageServicePlugin } from '@volar/language-server' */
2
2
 
3
- const { getVirtualCode, createLogging } = require('./utils.js');
3
+ const { getVirtualCode, createLogging, is_ripple_document } = require('./utils.js');
4
4
 
5
5
  const { log } = createLogging('[Ripple Auto-Insert Plugin]');
6
6
 
@@ -55,7 +55,7 @@ function createAutoInsertPlugin() {
55
55
  * @returns {Promise<string | null>}
56
56
  */
57
57
  async provideAutoInsertSnippet(document, position, lastChange, _token) {
58
- if (!document.uri.endsWith('.ripple')) {
58
+ if (!is_ripple_document(document.uri)) {
59
59
  return null;
60
60
  }
61
61
 
@@ -1,7 +1,13 @@
1
1
  /** @import { LanguageServicePlugin, TextEdit, CompletionItem } from '@volar/language-server'; */
2
2
 
3
3
  const { CompletionItemKind, InsertTextFormat } = require('@volar/language-server');
4
- const { getVirtualCode, createLogging, isInsideImport, isInsideExport } = require('./utils.js');
4
+ const {
5
+ getVirtualCode,
6
+ createLogging,
7
+ isInsideImport,
8
+ isInsideExport,
9
+ is_ripple_document,
10
+ } = require('./utils.js');
5
11
 
6
12
  const { log } = createLogging('[Ripple Completion Plugin]');
7
13
 
@@ -374,7 +380,7 @@ function createCompletionPlugin() {
374
380
  // This ensures TypeScript/JavaScript completions are still shown alongside Ripple snippets
375
381
  isAdditionalCompletion: true,
376
382
  async provideCompletionItems(document, position, completionContext, _token) {
377
- if (!document.uri.endsWith('.ripple')) {
383
+ if (!is_ripple_document(document.uri)) {
378
384
  return { items: [], isIncomplete: false };
379
385
  }
380
386
 
package/src/utils.js CHANGED
@@ -24,6 +24,8 @@ const IMPORT_EXPORT_REGEX = {
24
24
  from: /from\s*['"][^'"]*['"]\s*;?/,
25
25
  };
26
26
 
27
+ const RIPPLE_EXTENSIONS = ['.ripple', '.tsrx'];
28
+
27
29
  /** @type {is_identifier_obfuscated} */
28
30
  let is_identifier_obfuscated;
29
31
  /** @type {deobfuscate_identifier} */
@@ -150,9 +152,19 @@ function isInsideExport(text, start) {
150
152
  return isInsideImportOrExport('export', text, start);
151
153
  }
152
154
 
155
+ /**
156
+ * @param {string} document_uri
157
+ * @returns {boolean}
158
+ */
159
+ function is_ripple_document(document_uri) {
160
+ return RIPPLE_EXTENSIONS.some((extension) => document_uri.endsWith(extension));
161
+ }
162
+
153
163
  module.exports = {
164
+ RIPPLE_EXTENSIONS,
154
165
  getVirtualCode,
155
166
  getWordFromPosition,
167
+ is_ripple_document,
156
168
  isInsideImport,
157
169
  isInsideExport,
158
170
  createLogging,