Skip to content

Commit 43ecb49

Browse files
committed
🔖 Alpha release 0.1.2
2 parents 1a17e72 + d1ee30d commit 43ecb49

24 files changed

+758
-5870
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.1.2] - 2019-05-15
8+
9+
### Added
10+
11+
- Named pipe support for Windows
12+
13+
### Fixed
14+
15+
- Avoid early evaluation that slow down the initialization
16+
17+
- Markdown conversion for special characters
18+
19+
### Removed
20+
21+
- SVG image for document information
22+
723
## [0.1.1] - 2019-02-05 🧧
824

925
### Added

README.md

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33
[![Develop with: Wolfram Language](https://img.shields.io/badge/Develop%20with-Wolfram%20Language-%23d81013.svg)](http://www.wolfram.com/language/)
44
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
55

6-
![WolframLanguageServerLogo](https://raw.githubusercontent.com/kenkangxgwe/lsp-wl/master/images/wolfram-language-server-logo-clipped.png)
7-
> by [kenkangxgwe](mailto:kenkangxgwe@gmail.com) and [hxianglong](https://github.com/huxianglong)
6+
![WolframLanguageServerLogo](images/wolfram-language-server-logo-clipped.png)
7+
> by [kenkangxgwe](https://github.com/kenkangxgwe) and [hxianglong](https://github.com/huxianglong)
88
99
<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-refresh-toc -->
1010
**Table of Contents**
1111

1212
- [Wolfram Language Server](#wolfram-language-server)
13-
- [Installation](#installation)
14-
- [Run the Server](#run-the-server)
15-
- [Features](#features)
16-
- [Contribute](#contribute)
17-
- [Design Principles](#design-principles)
18-
- [Todo list](#todo-list)
19-
- [Donations :dollar:](#donations-dollar)
20-
- [Footnotes](#footnotes)
13+
- [Installation](#installation)
14+
- [Run the Server](#run-the-server)
15+
- [Features](#features)
16+
- [Contribute](#contribute)
17+
- [Design Principles](#design-principles)
18+
- [Todo list](#todo-list)
19+
- [Donations :dollar:](#donations-dollar)
20+
- [Footnotes](#footnotes)
2121

2222
<!-- markdown-toc end -->
2323

@@ -30,19 +30,19 @@ implemented in Wolfram Language itself.
3030
Our current goal is to provide the experience as good as the Mathematica FrontEnd
3131
with addition power from the editor.
3232

33-
We have provided the client-side code for VS Code in this repo, which is based on some slight
33+
We have provided the client-side code for VS Code [here](https://github.com/kenkangxgwe/vscode-lsp-wl), which is based on some slight
3434
modifications of [Microsoft's LSP
3535
example](https://github.com/Microsoft/vscode-extension-samples/tree/master/lsp-sample).
3636
If you are using other tools supporting LSP, some slight modifications to the
3737
client would certainly work too.
3838

3939
## Installation
4040

41-
0. [Wolfram Mathematica](http://www.wolfram.com/mathematica/) (11.2 or
42-
higher<a name="ref1"></a>[<sup>1</sup>](#footnote1)).
41+
0. [Wolfram Mathematica](http://www.wolfram.com/mathematica/) (11.2 or higher<a
42+
name="ref1"></a>[<sup>1</sup>](#footnote1)) or [Wolfram
43+
Engine](https://www.wolfram.com/engine/) (12.0 or higher).
4344

44-
1. Download the [server](https://github.com/kenkangxgwe/lsp-wl) from its
45-
repository.
45+
1. Use git to clone this repository.
4646

4747
``` sh
4848
git clone https://github.com/kenkangxgwe/lsp-wl.git
@@ -65,9 +65,11 @@ wolframscript -f /path/to/lsp-wl/init.wls [args]
6565
The posible arguments for the server are
6666

6767
- `--help, -h` to print help information.
68-
- `--socket=port` to assign the port that the server connect to. (Default:
69-
`6536`)
70-
Socket is the only channel that we currently support.
68+
- `--socket=port` to assign the port to which the server will connect. (Default:
69+
`6536`)
70+
- `--tcp-server=port` to assign the port at which the server will start. (Default:
71+
`6536`)
72+
- `--pipe=pipename` to specify the pipe name for the server to connect to.
7173
- `--log=level, -l level` to specify the logging level of the server.
7274
(Levels: `error`, `warn`, `info`, `debug`. Default: `info`)
7375
- `--test, -t` to run the unit test for the server.
@@ -89,20 +91,20 @@ This is a good way to see the results from the unit tests.
8991
- *Hover:* Provide definitions for Wolfram functions and system variables, such
9092
as `String` and `$Path`.
9193

92-
![hover](https://raw.githubusercontent.com/kenkangxgwe/lsp-wl/develop/images/hover.png)
94+
![hover](images/hover.png)
9395

9496
- *Completion:* The completion is triggered by the client automatically.
9597
Currently, Wolfram functions and system variables would be displayed.
9698

9799
- *Completion Resolve:* Further information would be provided for the items in
98100
the list.
99101

100-
![completion](https://raw.githubusercontent.com/kenkangxgwe/lsp-wl/develop/images/completion.png)
102+
![completion](images/completion.png)
101103

102104
- *Diagnostics:* Syntax error would be underlined. However, the specific syntax
103105
error is not supported at the moment.
104106

105-
![diagnostics](https://raw.githubusercontent.com/kenkangxgwe/lsp-wl/develop/images/diagnostics.png)
107+
![diagnostics](images/diagnostics.png)
106108

107109
This is an early release, so more features are on the way. Syntax highlight is
108110
NOT supported according to the design of LSP, but there are already some good
@@ -160,8 +162,7 @@ thanks in advance :smile:.
160162

161163
162164
- Alipay (With QRCode): 13916018006
163-
![Alipay
164-
QRCode](https://raw.githubusercontent.com/kenkangxgwe/lsp-wl/master/images/alipay.jpg)
165+
![Alipay QRCode](images/alipay.jpg)
165166

166167
## Footnotes
167168

WolframLanguageServer/DataType.wl

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ ClearAll[Evaluate[Context[] <> "*"]];
1313
DeclareType::usage = "DeclareType[typename, <|key_String -> pattern...|>] declares a type given by its name and an association indicating every field and its pattern in the type. \
1414
typename[key] gets access to the corresponding value. \
1515
typename[key, default] gets access to the corresponding value. If it is missing, returns the default.";
16+
ConstructType::usage = "ConstructType[params_Association, type] constructs an object of the given type with specified params."
17+
TypeUsage::usage = "TypeUsage[type, usage_String] append usage to current type."
1618
Keys::usage = Keys::usage <> "\nKeys[typename] gives a list of the keys field_i in type typename.";
1719
KeyPatterns::usage = "KeyPatterns[typename] returns the key-pattern pair of the type.";
1820
ReplaceKey::usage = "ReplaceKey[object, key -> value] assigns the value to key in given object.
@@ -70,6 +72,10 @@ DeclareType[typename_Symbol, typekey:<|(_String -> _)...|>] := Module[
7072
];
7173

7274

75+
Begin["`Private`"]
76+
ClearAll[Evaluate[Context[] <> "*"]]
77+
78+
7379
(* ::Section:: *)
7480
(*Default Constructor*)
7581

@@ -90,32 +96,32 @@ ConstructTypeAlternatives[parameters_, {{}, res_}] := res;
9096
ConstructTypeAlternatives[parameters_, {{p_, ps___}, res_}] := ConstructTypeAlternatives[parameters,
9197
ConstructType[parameters, p]
9298
// Replace[{
93-
_Missing -> {{ps}, res},
99+
_Missing :> {{ps}, res},
94100
newres_ :> {{}, newres}
95101
}]
96102
];
97103

98104
ConstructType[parameters_List, pattern:List[(Verbatim[Repeated]|Verbatim[RepeatedNull])[p_]]] := (
99-
ConstructTypeList[p, {parameters, {}}] // Replace[_Missing -> Missing["ConstructorNotFound", {parameters, pattern}]]
105+
ConstructTypeList[p, {parameters, {}}] // Replace[_Missing :> Missing["ConstructorNotFound", {parameters, pattern}]]
100106
);
101107

102108
ConstructType[parameters_List, pattern:List[(Verbatim[BlankSequence]|Verbatim[BlankNullSequence])[p_]]] := (
103-
ConstructTypeList[_p, {parameters, {}}] // Replace[_Missing -> Missing["ConstructorNotFound", {parameters, pattern}]]
109+
ConstructTypeList[_p, {parameters, {}}] // Replace[_Missing :> Missing["ConstructorNotFound", {parameters, pattern}]]
104110
);
105111

106112
ConstructTypeList[p_, {{}, res_}] := res;
107113
ConstructTypeList[p_, {{param_, params___}, res_}] := ConstructTypeList[p,
108114
ConstructType[param, p]
109115
// Replace[{
110-
_Missing -> {{}, MissingQ["ConstructorNotFound"]},
116+
_Missing :> {{}, MissingQ["ConstructorNotFound"]},
111117
curRes_ :> {{params}, Append[res, curRes]}
112118
}]
113119
];
114120

115121
ConstructType[parameters_Association, pattern:Association[(Verbatim[Repeated]|Verbatim[RepeatedNull])[Rule[key_, val_]]]] := (
116122
ConstructType[Keys[parameters], {key...}]
117123
// Replace[{
118-
_Missing -> Missing["ConstructorNotFound", {parameters, pattern}],
124+
_Missing :> Missing["ConstructorNotFound", {parameters, pattern}],
119125
res1_ :> (
120126
ConstructType[Values[parameters], {val...}]
121127
// Replace[{
@@ -196,4 +202,7 @@ TypeUsage[typename_Symbol, usage_String] := (
196202
);
197203

198204

205+
End[]
206+
207+
199208
EndPackage[];

0 commit comments

Comments
 (0)