Skip to content

Commit 2b7f6fa

Browse files
davidanthoffgithub-actions[bot]
authored andcommitted
Format files using DocumentFormat
1 parent 0ab63b2 commit 2b7f6fa

34 files changed

+377
-378
lines changed

src/extensions/messagedefs.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const julia_getModuleAt_request_type = JSONRPC.RequestType("julia/getModuleAt", VersionedTextDocumentPositionParams, String)
2-
const julia_getCurrentBlockRange_request_type = JSONRPC.RequestType("julia/getCurrentBlockRange", VersionedTextDocumentPositionParams, Tuple{Position, Position, Position})
2+
const julia_getCurrentBlockRange_request_type = JSONRPC.RequestType("julia/getCurrentBlockRange", VersionedTextDocumentPositionParams, Tuple{Position,Position,Position})
33
const julia_getDocAt_request_type = JSONRPC.RequestType("julia/getDocAt", VersionedTextDocumentPositionParams, String)
44
const julia_getDocFromWord_request_type = JSONRPC.RequestType("julia/getDocFromWord", NamedTuple{(:word,),Tuple{String}}, String)
55
const textDocument_publishTests_notification_type = JSONRPC.NotificationType("julia/publishTests", PublishTestsParams)

src/languageserverinstance.jl

+9-9
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ mutable struct LanguageServerInstance
7979

8080
_send_request_metrics::Bool
8181

82-
function LanguageServerInstance(@nospecialize(pipe_in), @nospecialize(pipe_out), env_path="", depot_path="", err_handler=nothing, symserver_store_path=nothing, download=true, symbolcache_upstream = nothing, julia_exe::Union{NamedTuple{(:path,:version),Tuple{String,VersionNumber}},Nothing}=nothing)
82+
function LanguageServerInstance(@nospecialize(pipe_in), @nospecialize(pipe_out), env_path="", depot_path="", err_handler=nothing, symserver_store_path=nothing, download=true, symbolcache_upstream=nothing, julia_exe::Union{NamedTuple{(:path, :version),Tuple{String,VersionNumber}},Nothing}=nothing)
8383
endpoint = JSONRPC.JSONRPCEndpoint(pipe_in, pipe_out, err_handler)
8484
jw = JuliaWorkspace()
8585
# if hasfield(typeof(jw.runtime), :performance_tracing_callback)
@@ -314,7 +314,7 @@ end
314314
315315
Run the language `server`.
316316
"""
317-
function Base.run(server::LanguageServerInstance; timings = [])
317+
function Base.run(server::LanguageServerInstance; timings=[])
318318
did_show_timer = Ref(false)
319319
add_timer_message!(did_show_timer, timings, "LS startup started")
320320

@@ -340,7 +340,7 @@ function Base.run(server::LanguageServerInstance; timings = [])
340340
if server.err_handler !== nothing
341341
server.err_handler(err, bt)
342342
else
343-
@warn "LS: An error occurred in the client listener task. This may be normal." exception=(err, bt)
343+
@warn "LS: An error occurred in the client listener task. This may be normal." exception = (err, bt)
344344
end
345345
finally
346346
if isopen(server.combined_msg_queue)
@@ -363,7 +363,7 @@ function Base.run(server::LanguageServerInstance; timings = [])
363363
if server.err_handler !== nothing
364364
server.err_handler(err, bt)
365365
else
366-
@error "LS: Queue op failed" ex=(err, bt)
366+
@error "LS: Queue op failed" ex = (err, bt)
367367
end
368368
finally
369369
if isopen(server.combined_msg_queue)
@@ -450,11 +450,11 @@ function Base.run(server::LanguageServerInstance; timings = [])
450450
server.jr_endpoint,
451451
telemetry_event_notification_type,
452452
Dict(
453-
"command" => "request_metric",
454-
"operationId" => g_operationId[],
455-
"name" => msg["method"],
456-
"time" => start_time,
457-
"duration" => duration)
453+
"command" => "request_metric",
454+
"operationId" => g_operationId[],
455+
"name" => msg["method"],
456+
"time" => start_time,
457+
"duration" => duration)
458458
)
459459
end
460460
elseif message.type == :symservmsg

src/multienv.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const project_names = ("JuliaProject.toml", "Project.toml")
1010
const manifest_names = ("JuliaManifest.toml", "Manifest.toml")
1111

1212
# return nothing or the project file at env
13-
function env_file(env::String, names = project_names)::Union{Nothing,String}
13+
function env_file(env::String, names=project_names)::Union{Nothing,String}
1414
if isdir(env)
1515
for proj in names
1616
project_file = joinpath(env, proj)
@@ -49,7 +49,7 @@ function get_env_for_root(doc::Document, server::LanguageServerInstance)
4949
(safe_isfile(env_proj_file) && safe_isfile(env_manifest_file)) || return
5050

5151
# Find which workspace folder the doc is in.
52-
parent_workspaceFolders = sort(filter(f->startswith(doc._path, f), collect(server.workspaceFolders)), by = length, rev = true)
52+
parent_workspaceFolders = sort(filter(f -> startswith(doc._path, f), collect(server.workspaceFolders)), by=length, rev=true)
5353

5454
isempty(parent_workspaceFolders) && return
5555
# arbitrarily pick one
@@ -94,11 +94,11 @@ function get_env_for_root(doc::Document, server::LanguageServerInstance)
9494
msg
9595
))
9696
end
97-
@error msg exception=(err, catch_backtrace())
97+
@error msg exception = (err, catch_backtrace())
9898
end
9999
end
100100

101-
function complete_dep_tree(uuid, env_manifest, alldeps = Dict{Base.UUID,Pkg.Types.PackageEntry}())
101+
function complete_dep_tree(uuid, env_manifest, alldeps=Dict{Base.UUID,Pkg.Types.PackageEntry}())
102102
haskey(alldeps, uuid) && return alldeps
103103
alldeps[uuid] = env_manifest[uuid]
104104
for dep_uuid in values(alldeps[uuid].deps)

src/protocol/basic.jl

+12-12
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ end
6363
##############################################################################
6464
# Diagnostics
6565
const DiagnosticSeverity = Int
66-
const DiagnosticSeverities = (Error = 1,
67-
Warning = 2,
68-
Information = 3,
69-
Hint = 4)
66+
const DiagnosticSeverities = (Error=1,
67+
Warning=2,
68+
Information=3,
69+
Hint=4)
7070

7171
const DiagnosticTag = Int
72-
const DiagnosticTags = (Unnecessary = 1,
73-
Deprecated = 2)
72+
const DiagnosticTags = (Unnecessary=1,
73+
Deprecated=2)
7474

7575
@dict_readable struct DiagnosticRelatedInformation <: Outbound
7676
location::Location
@@ -108,8 +108,8 @@ end
108108
##############################################################################
109109
# Markup
110110
const MarkupKind = String
111-
const MarkupKinds = (PlainText = "plaintext",
112-
Markdown = "markdown")
111+
const MarkupKinds = (PlainText="plaintext",
112+
Markdown="markdown")
113113

114114
mutable struct MarkupContent
115115
kind::MarkupKind
@@ -130,10 +130,10 @@ Base.hash(x::MarkedString) = hash(x.value) # for unique
130130
##############################################################################
131131
# Window
132132
const MessageType = Int
133-
const MessageTypes = (Error = 1,
134-
Warning = 2,
135-
Info = 3,
136-
Log = 4)
133+
const MessageTypes = (Error=1,
134+
Warning=2,
135+
Info=3,
136+
Log=4)
137137

138138
struct ShowMessageParams <: Outbound
139139
type::MessageType

src/protocol/completion.jl

+30-30
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
const CompletionItemKind = Int
2-
const CompletionItemKinds = (Text = 1,
3-
Method = 2,
4-
Function = 3,
5-
Constructor = 4,
6-
Field = 5,
7-
Variable = 6,
8-
Class = 7,
9-
Interface = 8,
10-
Module = 9,
11-
Property = 10,
12-
Unit = 11,
13-
Value = 12,
14-
Enum = 13,
15-
Keyword = 14,
16-
Snippet = 15,
17-
Color = 16,
18-
File = 17,
19-
Reference = 18,
20-
Folder = 19,
21-
EnumMember = 20,
22-
Constant = 21,
23-
Struct = 22,
24-
Event = 23,
25-
Operator = 24,
26-
TypeParameter = 25)
2+
const CompletionItemKinds = (Text=1,
3+
Method=2,
4+
Function=3,
5+
Constructor=4,
6+
Field=5,
7+
Variable=6,
8+
Class=7,
9+
Interface=8,
10+
Module=9,
11+
Property=10,
12+
Unit=11,
13+
Value=12,
14+
Enum=13,
15+
Keyword=14,
16+
Snippet=15,
17+
Color=16,
18+
File=17,
19+
Reference=18,
20+
Folder=19,
21+
EnumMember=20,
22+
Constant=21,
23+
Struct=22,
24+
Event=23,
25+
Operator=24,
26+
TypeParameter=25)
2727

2828
const CompletionItemTag = Int
2929
const CompletionItemTags = (Deprecated = 1)
3030

3131
const CompletionTriggerKind = Int
32-
const CompletionTriggerKinds = (Invoked = 1,
33-
TriggerCharacter = 2,
34-
TriggerForIncompleteCompletion = 3)
32+
const CompletionTriggerKinds = (Invoked=1,
33+
TriggerCharacter=2,
34+
TriggerForIncompleteCompletion=3)
3535

3636
const InsertTextFormat = Int
37-
const InsertTextFormats = (PlainText = 1,
38-
Snippet = 2)
37+
const InsertTextFormats = (PlainText=1,
38+
Snippet=2)
3939

4040
@dict_readable struct CompletionTagClientCapabilities
4141
valueSet::Vector{CompletionItemTag}

src/protocol/configuration.jl

+8-8
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ end
3030
##############################################################################
3131
# File watching
3232
const FileChangeType = Int
33-
const FileChangeTypes = (Created = 1,
34-
Changed = 2,
35-
Deleted = 3)
33+
const FileChangeTypes = (Created=1,
34+
Changed=2,
35+
Deleted=3)
3636

3737
const WatchKind = Int
38-
const WatchKinds = (Create = 1,
39-
Change = 2,
40-
Delete = 4)
38+
const WatchKinds = (Create=1,
39+
Change=2,
40+
Delete=4)
4141

4242

4343
@dict_readable struct FileEvent
@@ -52,8 +52,8 @@ end
5252
const Pattern = String
5353

5454
struct RelativePattern <: Outbound
55-
baseUri::Union{WorkspaceFolder,URI}
56-
pattern::Pattern
55+
baseUri::Union{WorkspaceFolder,URI}
56+
pattern::Pattern
5757
end
5858

5959
const GlobPattern = Union{Pattern,RelativePattern}

src/protocol/document.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ end
7676
textDocument::TextDocumentItem
7777
end
7878

79-
@dict_readable struct TextDocumentContentChangeEvent <: Outbound
79+
@dict_readable struct TextDocumentContentChangeEvent <: Outbound
8080
range::Union{Range,Missing}
8181
rangeLength::Union{Int,Missing}
8282
text::String
@@ -97,9 +97,9 @@ end
9797
end
9898

9999
const TextDocumentSaveReason = Int
100-
const TextDocumentSaveReasons = (Manual = 1,
101-
AfterDelay = 2,
102-
FocusOut = 3)
100+
const TextDocumentSaveReasons = (Manual=1,
101+
AfterDelay=2,
102+
FocusOut=3)
103103

104104
@dict_readable struct WillSaveTextDocumentParams
105105
textDocument::TextDocumentIdentifier

src/protocol/features.jl

+25-25
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ import Base.==
1111
##############################################################################
1212
# Code Action
1313
const CodeActionKind = String
14-
const CodeActionKinds = (Empty = "",
15-
QuickFix = "quickfix",
16-
Refactor = "refactor",
17-
RefactorExtract = "refactor.extract",
18-
RefactorInline = "refactor.inline",
19-
RefactorRewrite = "refactor.rewrite",
20-
Source = "source",
21-
SourceOrganizeImports = "source.organizeImports")
14+
const CodeActionKinds = (Empty="",
15+
QuickFix="quickfix",
16+
Refactor="refactor",
17+
RefactorExtract="refactor.extract",
18+
RefactorInline="refactor.inline",
19+
RefactorRewrite="refactor.rewrite",
20+
Source="source",
21+
SourceOrganizeImports="source.organizeImports")
2222

2323
@dict_readable struct CodeActionKindCapabilities
2424
valueSet::Vector{CodeActionKind}
@@ -211,9 +211,9 @@ end
211211
##############################################################################
212212
# Folding
213213
const FoldingRangeKind = String
214-
const FoldingRangeKinds = (Comment = "comment",
215-
Imports = "imports",
216-
Region = "region")
214+
const FoldingRangeKinds = (Comment="comment",
215+
Imports="imports",
216+
Region="region")
217217

218218
@dict_readable struct FoldingRangeClientCapabilities <: Outbound
219219
dynamicRegistration::Union{Bool,Missing}
@@ -306,8 +306,8 @@ end
306306
@dict_readable struct InlayHintRegistrationOptions <: Outbound
307307
workDoneToken::Union{Int,String,Missing} # ProgressToken
308308
resolveProvider::Bool # InlayHintOptions
309-
id::Union{Missing, String} # StaticRegistrationOptions
310-
documentSelector::Union{Nothing, DocumentSelector} # TextDocumentRegistrationOptions
309+
id::Union{Missing,String} # StaticRegistrationOptions
310+
documentSelector::Union{Nothing,DocumentSelector} # TextDocumentRegistrationOptions
311311
end
312312

313313
@dict_readable struct InlayHintParams <: Outbound
@@ -318,26 +318,26 @@ end
318318

319319
@dict_readable struct InlayHintLabelPart <: Outbound
320320
value::String
321-
tooltip::Union{Missing, String, MarkupContent}
322-
location::Union{Missing, Location}
323-
command::Union{Missing, Command}
321+
tooltip::Union{Missing,String,MarkupContent}
322+
location::Union{Missing,Location}
323+
command::Union{Missing,Command}
324324
end
325325

326326
const InlayHintKind = Int
327327
const InlayHintKinds = (
328-
Type = 1,
329-
Parameter = 2
328+
Type=1,
329+
Parameter=2
330330
)
331331

332332
@dict_readable struct InlayHint <: Outbound
333333
position::Position
334-
label::Union{String, Vector{InlayHintLabelPart}}
335-
kind::Union{Missing, InlayHintKind}
336-
textEdits::Union{Missing, Vector{TextEdit}}
337-
tooltip::Union{Missing, String, MarkupContent}
338-
paddingLeft::Union{Missing, Bool}
339-
paddingRight::Union{Missing, Bool}
340-
data::Union{Missing, Any}
334+
label::Union{String,Vector{InlayHintLabelPart}}
335+
kind::Union{Missing,InlayHintKind}
336+
textEdits::Union{Missing,Vector{TextEdit}}
337+
tooltip::Union{Missing,String,MarkupContent}
338+
paddingLeft::Union{Missing,Bool}
339+
paddingRight::Union{Missing,Bool}
340+
data::Union{Missing,Any}
341341
end
342342

343343
##############################################################################

src/protocol/goto.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,4 @@ end
117117
workDoneToken::Union{Int,String,Missing} # ProgressToken
118118
partialResultToken::Union{Int,String,Missing} # ProgressToken
119119
context::ReferenceContext
120-
end
120+
end

src/protocol/highlight.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const DocumentHighlightKind = Int
2-
const DocumentHighlightKinds = (Text = 1,
3-
Read = 2,
4-
Write = 3)
2+
const DocumentHighlightKinds = (Text=1,
3+
Read=2,
4+
Write=3)
55

66
@dict_readable struct DocumentHighlightClientCapabilities <: Outbound
77
dynamicRegistration::Union{Bool,Missing}
@@ -26,4 +26,4 @@ end
2626
struct DocumentHighlight <: Outbound
2727
range::Range
2828
kind::Union{DocumentHighlightKind,Missing}
29-
end
29+
end

0 commit comments

Comments
 (0)