miniscript-languageserver 1.4.4 → 1.4.5
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/README.md +23 -12
- package/index.js +63 -61
- package/package.json +2 -2
package/README.md
CHANGED
@@ -30,14 +30,6 @@ miniscript-languageserver
|
|
30
30
|
|
31
31
|
## Example implementations
|
32
32
|
|
33
|
-
Currently, there are two server client versions. The reason for this is that VSCode supports development in your web browser but also on your local machine.
|
34
|
-
|
35
|
-
In case it is required to have the language server running within the context of a browser you have to use the `dist/browser.js` file.
|
36
|
-
|
37
|
-
If you want to use the language server for local development go ahead and use `dist/node.js`.
|
38
|
-
|
39
|
-
You can find some examples below.
|
40
|
-
|
41
33
|
#### VSCode implementation
|
42
34
|
```ts
|
43
35
|
import * as path from 'path';
|
@@ -49,7 +41,7 @@ import {
|
|
49
41
|
} from 'vscode-languageclient/node';
|
50
42
|
|
51
43
|
const serverModule = context.asAbsolutePath(
|
52
|
-
path.join('node_modules', 'miniscript-languageserver', '
|
44
|
+
path.join('node_modules', 'miniscript-languageserver', 'index.js')
|
53
45
|
);
|
54
46
|
|
55
47
|
const serverOptions: ServerOptions = {
|
@@ -114,14 +106,33 @@ You can add your own meta descriptions in [this repository](https://github.com/a
|
|
114
106
|
Additionally, there is the option to define methods via comments in the code.
|
115
107
|
|
116
108
|
```js
|
109
|
+
// @type Bar
|
110
|
+
// @property {string} virtualMoo
|
111
|
+
Bar = {}
|
112
|
+
Bar.moo = ""
|
113
|
+
|
117
114
|
// Hello world
|
118
115
|
// I am **bold**
|
119
116
|
// @description Alternative description
|
120
117
|
// @example test("title", 123)
|
121
118
|
// @param {string} title - The title of the book.
|
122
119
|
// @param {string|number} author - The author of the book.
|
123
|
-
// @return {
|
124
|
-
test = function(test, abc)
|
125
|
-
print
|
120
|
+
// @return {Bar} - Some info about return
|
121
|
+
Bar.test = function(test, abc)
|
122
|
+
print "test"
|
123
|
+
return self
|
126
124
|
end function
|
125
|
+
|
126
|
+
// @type Foo
|
127
|
+
Foo = new Bar
|
128
|
+
// @return {Foo}
|
129
|
+
Foo.New = function(message)
|
130
|
+
result = new Foo
|
131
|
+
return result
|
132
|
+
end function
|
133
|
+
|
134
|
+
myVar = Foo.New
|
135
|
+
|
136
|
+
myVar.test // shows defined signature of Bar.test on hover
|
137
|
+
myVar.virtualMoo // shows virtual property of type string on hover
|
127
138
|
```
|