Skip to content

Commit e07d46e

Browse files
committed
begin support setTrace
1 parent 505c32e commit e07d46e

File tree

4 files changed

+51
-8
lines changed

4 files changed

+51
-8
lines changed

src/PharoLanguageServer/PLSAbstractServer.class.st

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,12 +297,9 @@ PLSAbstractServer >> serverShutdown [
297297

298298
{ #category : 'lsp - trace' }
299299
PLSAbstractServer >> setTrace: setTraceParam [
300-
<jrpc: #'$/setTrace'>
301-
]
302300

303-
{ #category : 'lsp - trace' }
304-
PLSAbstractServer >> setTraceNotification: value [
305-
<jrpc: #'$/setTraceNotification'>
301+
<jrpc: #'$/setTrace' >
302+
self context traceValue: (setTraceParam at: #value)
306303
]
307304

308305
{ #category : 'lsp - show document' }

src/PharoLanguageServer/PLSContext.class.st

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"
2-
The server use me to store informations such as the text item
2+
The server use me to store informations such as the text item.
3+
4+
- `traceValue` represent the level of trace sent to the client
35
"
46
Class {
57
#name : 'PLSContext',
@@ -8,7 +10,8 @@ Class {
810
'textItems',
911
'messageProcesses',
1012
'clientContext',
11-
'server'
13+
'server',
14+
'traceValue'
1215
],
1316
#category : 'PharoLanguageServer-Context',
1417
#package : 'PharoLanguageServer',
@@ -37,8 +40,10 @@ PLSContext >> clientContext: anObject [
3740

3841
{ #category : 'initialization' }
3942
PLSContext >> initialize [
43+
4044
textItems := Dictionary new.
41-
messageProcesses := Dictionary new
45+
messageProcesses := Dictionary new.
46+
traceValue := PLSTraceValue messages
4247
]
4348

4449
{ #category : 'message processing' }
@@ -106,3 +111,15 @@ PLSContext >> textItems [
106111
PLSContext >> textItems: anObject [
107112
textItems := anObject
108113
]
114+
115+
{ #category : 'accessing' }
116+
PLSContext >> traceValue [
117+
118+
^ traceValue
119+
]
120+
121+
{ #category : 'accessing' }
122+
PLSContext >> traceValue: anObject [
123+
124+
traceValue := anObject
125+
]

src/PharoLanguageServer/PLSServer.class.st

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ PLSServer >> onInitializeTrace: trace processId: processId locale: locale client
264264
capabilities: (PLPClientCapabilities from: capabilities);
265265
rootUri: rootUri;
266266
yourself).
267+
trace ifNotNil: [ self context traceValue: trace ].
267268
^ PLSInitializeResult new
268269
]
269270

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"
2+
[https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#traceValue](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#traceValue)
3+
"
4+
Class {
5+
#name : 'PLSTraceValue',
6+
#superclass : 'Object',
7+
#category : 'PharoLanguageServer-Structure-Trace',
8+
#package : 'PharoLanguageServer',
9+
#tag : 'Structure-Trace'
10+
}
11+
12+
{ #category : 'as yet unclassified' }
13+
PLSTraceValue class >> messages [
14+
15+
^ 'messages'
16+
]
17+
18+
{ #category : 'as yet unclassified' }
19+
PLSTraceValue class >> off [
20+
21+
^ 'off'
22+
]
23+
24+
{ #category : 'as yet unclassified' }
25+
PLSTraceValue class >> verbose [
26+
27+
^ 'verbose'
28+
]

0 commit comments

Comments
 (0)