@@ -31,6 +31,11 @@ project and its dependencies on their classpath.
31
31
32
32
![ ] ( ../../images/worksheets/worksheet-run.png " Run worksheet ")
33
33
34
+ By default, the worksheets are also run when the file is saved. This can be
35
+ configured in VSCode preferences:
36
+
37
+ ![ ] ( ../../images/worksheets/config-autorun.png " Configure run on save ")
38
+
34
39
Note that the worksheet are fully integrated with the rest of Dotty IDE: While
35
40
typing, errors are shown, completions are suggested, and you can use all the
36
41
other features of Dotty IDE such as go to definition, find all references, etc.
@@ -40,77 +45,6 @@ other features of Dotty IDE such as go to definition, find all references, etc.
40
45
Implementation details
41
46
======================
42
47
43
- In overview, the worksheets extend the Language Server Protocol and rely on the
44
- Dotty REPL to evaluate code.
45
-
46
- ## Evaluation
47
- Each of the individual expressions and statements of the worksheet is extracted
48
- and passed to the Dotty REPL. After the REPL has finished evaluating one unit of
49
- input, it emits a special delimiter that indicates the end of the output for
50
- this input. (See ` dotty.tools.languageserver.worksheet.InputStreamConsumer ` )
51
-
52
- This process continues until all input has been evaluated.
53
-
54
- The Dotty REPL is run in a separate JVM. The ` Evaluator ` (see
55
- ` dotty.tools.languageserver.worksheet.Evaluator ` ) will re-use a JVM if the
56
- configuration of the project hasn't changed.
57
-
58
- ## Communication with the client
59
- The worksheets extend the Language Server Protocol and add one request and one
60
- notification.
61
-
62
- ### Run worksheet request
63
- The worksheet run request is sent from the client to the server to request that
64
- the server runs a given worksheet and streams the result.
65
-
66
- * Request:*
67
-
68
- - method: ` worksheet/run `
69
- - params: ` WorksheetRunParams ` defined as follows:
70
- ``` typescript
71
- interface WorksheetRunParams {
72
- /**
73
- * The worksheet to evaluate.
74
- */
75
- textDocument: VersionedTextDocumentIdentifier ;
76
- }
77
- ```
78
-
79
- * Response:*
80
-
81
- - result: ` WorksheetRunResult ` defined as follows:
82
- ``` typescript
83
- interface WorksheetRunResult {
84
- /**
85
- * Indicates whether evaluation was successful.
86
- */
87
- success: boolean ;
88
- }
89
- ```
90
-
91
- ### Worksheet output notification
92
- The worksheet output notification is sent from the server to the client to
93
- indicate that worksheet execution has produced some output.
94
-
95
- * Notification:*
96
-
97
- - method: ` worksheet/publishOutput `
98
- - params: ` WorksheetRunOutput ` defined as follows:
99
- ``` typescript
100
- interface WorksheetRunOutput {
101
- /**
102
- * The worksheet that produced this output.
103
- */
104
- textDocument: VersionedTextDocumentIdentifier ;
105
-
106
- /**
107
- * The line number of the expression that produced this output.
108
- */
109
- line: int ;
110
-
111
- /**
112
- * The output that has been produced.
113
- */
114
- content: string ;
115
- }
116
- ```
48
+ The implementation details of the worksheet mode and the information necessary to add support for
49
+ other clients are available in [ Worksheet mode - Implementation
50
+ details] ( worksheet-mode-implementation-details.html ) .
0 commit comments