Skip to content

Commit b977c52

Browse files
authored
Merge pull request #1 from Evref-BL/master
use duck word
2 parents 04201cd + 805fb7b commit b977c52

1 file changed

Lines changed: 64 additions & 64 deletions

File tree

src/DuckLanguageServer/DuckLanguageServer.class.st

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -9,38 +9,6 @@ Class {
99
#package : 'DuckLanguageServer'
1010
}
1111

12-
{ #category : 'blps - graph view' }
13-
DuckLanguageServer >> blsGraphViewForTextDocument: textDocument atPosition: position [
14-
15-
<jrpc: #'bls:graph-view'>
16-
| internalTextDocument data |
17-
internalTextDocument := self context textItem:
18-
(textDocument at: #uri at: #external).
19-
20-
data := DuckGraphDataBuilder new
21-
entity: internalTextDocument;
22-
buildData.
23-
^ data asJRPCJSON
24-
]
25-
26-
{ #category : 'bls - rules' }
27-
DuckLanguageServer >> blsUpdateRules: rulesFilePath [
28-
29-
<jrpc: #'bls:updateRules'>
30-
self criticsPath: rulesFilePath.
31-
self loadCriticsRule.
32-
^ true
33-
]
34-
35-
{ #category : 'bls - rules' }
36-
DuckLanguageServer >> blsUpdateSettingsMistral: mistralApiKey andJiraUser: jiraUser andJiraApiKey: jiraApiKey [
37-
38-
<jrpc: #'bls:updateSettings'>
39-
(mistralApiKey isNotNil and: [ mistralApiKey isNotEmpty ]) ifTrue: [
40-
LLMAPI apiKey: mistralApiKey ].
41-
^ true
42-
]
43-
4412
{ #category : 'lsp - code action' }
4513
DuckLanguageServer >> buildCodeActionShowDescriptionFor: diagnostic [
4614

@@ -82,11 +50,11 @@ DuckLanguageServer >> codeActionForDocument: textDocument atRange: range withCon
8250
^ actions asArray
8351
]
8452

85-
{ #category : 'bls - version' }
53+
{ #category : 'duck - version' }
8654
DuckLanguageServer >> commandPharoLanguageServerVersion [
8755

88-
<jrpc: #'bls:version'>
89-
^ 'v1.1.2'
56+
<jrpc: #'duck:version'>
57+
^ '0.0.0'
9058
]
9159

9260
{ #category : 'accessing' }
@@ -113,28 +81,6 @@ DuckLanguageServer >> criticsPath: anObject [
11381
criticsPath := anObject
11482
]
11583

116-
{ #category : 'dash - tools' }
117-
DuckLanguageServer >> dashOpenTool: id [
118-
119-
<jrpc: #'dash:openTool'>
120-
(self class environment at: id asSymbol) open.
121-
^ 'tool opened'
122-
]
123-
124-
{ #category : 'dash - tools' }
125-
DuckLanguageServer >> dashTools [
126-
127-
<jrpc: #'dash:dashTools'>
128-
^ (MiAbstractBrowser allSubclasses
129-
reject: #isAbstract
130-
thenCollect: [ :class |
131-
DuckTool new
132-
name: class menuLabel;
133-
id: class name;
134-
isDirectory: false;
135-
yourself ]) asArray
136-
]
137-
13884
{ #category : 'lsp - text synchronisation' }
13985
DuckLanguageServer >> didChange: textDocument contentChanges: contentChanges [
14086

@@ -189,6 +135,60 @@ DuckLanguageServer >> didSave: textDocument text: text [
189135
<jrpc: #'textDocument/didSave'>
190136
]
191137

138+
{ #category : 'duck - graph view' }
139+
DuckLanguageServer >> duckGraphViewForTextDocument: textDocument atPosition: position [
140+
141+
<jrpc: #'duck:graph-view'>
142+
| internalTextDocument data |
143+
internalTextDocument := self context textItem:
144+
(textDocument at: #uri at: #external).
145+
146+
data := DuckGraphDataBuilder new
147+
entity: internalTextDocument;
148+
buildData.
149+
^ data asJRPCJSON
150+
]
151+
152+
{ #category : 'duck - tools' }
153+
DuckLanguageServer >> duckOpenTool: id [
154+
155+
<jrpc: #'duck:openTool'>
156+
(self class environment at: id asSymbol) open.
157+
^ 'tool opened'
158+
]
159+
160+
{ #category : 'duck - tools' }
161+
DuckLanguageServer >> duckTools [
162+
163+
<jrpc: #'duck:dashTools'>
164+
^ (MiAbstractBrowser allSubclasses
165+
reject: #isAbstract
166+
thenCollect: [ :class |
167+
DuckTool new
168+
name: class menuLabel;
169+
id: class name;
170+
isDirectory: false;
171+
yourself ]) asArray
172+
]
173+
174+
{ #category : 'duck - rules' }
175+
DuckLanguageServer >> duckUpdateRules: rulesFilePath [
176+
177+
<jrpc: #'duck:updateRules'>
178+
self criticsPath: rulesFilePath.
179+
self loadCriticsRule.
180+
^ true
181+
]
182+
183+
{ #category : 'duck - rules' }
184+
DuckLanguageServer >> duckUpdateSettingsMistral: mistralApiKey [
185+
186+
<jrpc: #'duck:updateSettings'>
187+
(mistralApiKey isNotNil and: [ mistralApiKey isNotEmpty ]) ifTrue: [
188+
LLMAPI apiKey: mistralApiKey ].
189+
^ true
190+
]
191+
192192
{ #category : 'private' }
193193
DuckLanguageServer >> fixEncodingOf: aString [
194194

@@ -198,10 +198,10 @@ DuckLanguageServer >> fixEncodingOf: aString [
198198
^ aString ]
199199
]
200200

201-
{ #category : 'bls - rules' }
201+
{ #category : 'duck - rules' }
202202
DuckLanguageServer >> fixWithAI: rulePath ofDocument: textDocumentURI [
203203

204-
<jrpc: #'bls:fixWithAI'>
204+
<jrpc: #'duck:fixWithAI'>
205205
| textDocument api result id rule answer concernedStartPos concernedEndPos concernedText |
206206
textDocument := self context textItem: textDocumentURI.
207207

@@ -264,10 +264,10 @@ Be creative! Only give me the code without any explanation. Do not add comment i
264264
^ 'success'
265265
]
266266

267-
{ #category : 'blps - codelens - generate comments' }
267+
{ #category : 'duck - codelens - generate comments' }
268268
DuckLanguageServer >> generateCommentFor: uri from: startPos to: endPos [
269269

270-
<jrpc: #'blps.generateComment'>
270+
<jrpc: #'duck.generateComment'>
271271
| textString methodString api result resultContent |
272272
textString := (self context textItem: uri) text.
273273
methodString := textString
@@ -327,7 +327,7 @@ DuckLanguageServer >> initialize [
327327
self loadCriticsRule
328328
]
329329

330-
{ #category : 'bls - initialization' }
330+
{ #category : 'duck - initialization' }
331331
DuckLanguageServer >> loadCriticsRule [
332332
"Remove all. Code found in the tests"
333333

@@ -409,10 +409,10 @@ DuckLanguageServer >> serverName [
409409
^ #'Duck Language Server'
410410
]
411411

412-
{ #category : 'bls - rules' }
412+
{ #category : 'duck - rules' }
413413
DuckLanguageServer >> showRuleDescription: rulePath [
414414

415-
<jrpc: #'bls:showRuleDescription'>
415+
<jrpc: #'duck:showRuleDescription'>
416416
| id |
417417
id := (((rulePath at: #authority) withoutPrefix: '/') withoutSuffix:
418418
'.md') asInteger.

0 commit comments

Comments
 (0)