Skip to content

Commit ba30b05

Browse files
authored
Merge branch 'master' into disable-comp
2 parents 165ae09 + 9a4b28a commit ba30b05

18 files changed

+337
-145
lines changed

.github/workflows/jlpkgbutler-ci-master-workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ${{ matrix.os }}
1111
strategy:
1212
matrix:
13-
julia-version: ['1.0', '1.1', '1.2', '1.3', '1.4', '1.5']
13+
julia-version: ['1.0', '1.1', '1.2', '1.3', '1.4', '1.5', '1.6']
1414
julia-arch: [x64, x86]
1515
os: [ubuntu-latest, windows-latest, macOS-latest]
1616
exclude:

.github/workflows/jlpkgbutler-ci-pr-workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ${{ matrix.os }}
1010
strategy:
1111
matrix:
12-
julia-version: ['1.0', '1.1', '1.2', '1.3', '1.4', '1.5']
12+
julia-version: ['1.0', '1.1', '1.2', '1.3', '1.4', '1.5', '1.6']
1313
julia-arch: [x64, x86]
1414
os: [ubuntu-latest, windows-latest, macOS-latest]
1515
exclude:

.github/workflows/jlpkgbutler-codeformat-pr-workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- uses: actions/checkout@v2
1313
- uses: julia-actions/julia-codeformat@releases/v1
1414
- name: Create Pull Request
15-
uses: peter-evans/create-pull-request@v2
15+
uses: peter-evans/create-pull-request@v3
1616
with:
1717
token: ${{ secrets.GITHUB_TOKEN }}
1818
commit-message: Format files using DocumentFormat

src/LanguageServer.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ include("requests/workspace.jl")
2828
include("requests/actions.jl")
2929
include("requests/init.jl")
3030
include("requests/signatures.jl")
31+
include("requests/highlight.jl")
3132
include("utilities.jl")
3233

3334
end

src/document.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ function obscure_text(s)
155155
end
156156
i += di
157157
end
158-
s1 = String(take!(io))
158+
String(take!(io))
159159
end
160160

161161
"""
@@ -229,7 +229,7 @@ byte offset.
229229
function get_position_at(doc::Document, offset::Integer)
230230
offset > sizeof(get_text(doc)) && throw(LSPositionToOffsetException("offset[$offset] > sizeof(content)[$(sizeof(get_text(doc)))]")) # OK, offset comes from EXPR spans
231231
line_offsets = get_line_offsets(doc)
232-
line, ind = get_line_of(line_offsets, offset)
232+
line, _ = get_line_of(line_offsets, offset)
233233
io = IOBuffer(get_text(doc))
234234
seek(io, line_offsets[line])
235235
character = 0

src/languageserverinstance.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
T = 0.0
2-
31
"""
42
LanguageServerInstance(pipe_in, pipe_out, env="", depot="", err_handler=nothing, symserver_store_path=nothing)
53
@@ -45,6 +43,7 @@ mutable struct LanguageServerInstance
4543
lint_options::StaticLint.LintOptions
4644
lint_missingrefs::Symbol
4745
lint_disableddirs::Vector{String}
46+
completion_mode::Symbol
4847

4948
combined_msg_queue::Channel{Any}
5049

@@ -81,6 +80,7 @@ mutable struct LanguageServerInstance
8180
StaticLint.LintOptions(),
8281
:all,
8382
LINT_DIABLED_DIRS,
83+
:import, # options: :import or :qualify, anything else turns this off
8484
Channel{Any}(Inf),
8585
err_handler,
8686
:created,
@@ -142,7 +142,7 @@ function create_symserver_progress_ui(server)
142142
if server.clientcapability_window_workdoneprogress
143143
token = string(uuid4())
144144
server.current_symserver_progress_token = token
145-
response = JSONRPC.send(server.jr_endpoint, window_workDoneProgress_create_request_type, WorkDoneProgressCreateParams(token))
145+
JSONRPC.send(server.jr_endpoint, window_workDoneProgress_create_request_type, WorkDoneProgressCreateParams(token))
146146

147147
JSONRPC.send(
148148
server.jr_endpoint,
@@ -303,6 +303,7 @@ function Base.run(server::LanguageServerInstance)
303303
msg_dispatcher[textDocument_references_request_type] = request_wrapper(textDocument_references_request, server)
304304
msg_dispatcher[textDocument_rename_request_type] = request_wrapper(textDocument_rename_request, server)
305305
msg_dispatcher[textDocument_documentSymbol_request_type] = request_wrapper(textDocument_documentSymbol_request, server)
306+
msg_dispatcher[textDocument_documentHighlight_request_type] = request_wrapper(textDocument_documentHighlight_request, server)
306307
msg_dispatcher[julia_getModuleAt_request_type] = request_wrapper(julia_getModuleAt_request, server)
307308
msg_dispatcher[julia_getDocAt_request_type] = request_wrapper(julia_getDocAt_request, server)
308309
msg_dispatcher[textDocument_hover_request_type] = request_wrapper(textDocument_hover_request, server)

src/protocol/messagedefs.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const textDocument_formatting_request_type = JSONRPC.RequestType("textDocument/f
66
const textDocument_references_request_type = JSONRPC.RequestType("textDocument/references", ReferenceParams, Vector{Location})
77
const textDocument_rename_request_type = JSONRPC.RequestType("textDocument/rename", RenameParams, WorkspaceEdit)
88
const textDocument_documentSymbol_request_type = JSONRPC.RequestType("textDocument/documentSymbol", DocumentSymbolParams, Vector{SymbolInformation})
9+
const textDocument_documentHighlight_request_type = JSONRPC.RequestType("textDocument/documentHighlight", DocumentHighlightParams, Vector{DocumentHighlight})
910
const textDocument_hover_request_type = JSONRPC.RequestType("textDocument/hover", TextDocumentPositionParams, Hover)
1011
const textDocument_didOpen_notification_type = JSONRPC.NotificationType("textDocument/didOpen", DidOpenTextDocumentParams)
1112
const textDocument_didClose_notification_type = JSONRPC.NotificationType("textDocument/didClose", DidCloseTextDocumentParams)

src/requests/actions.jl

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ function reexport_package(x::EXPR, server, conn)
160160
return
161161
end
162162
using_stmt = parentof(x)
163-
file, offset = get_file_loc(x)
163+
file, _ = get_file_loc(x)
164164
insertpos = get_next_line_offset(using_stmt)
165165
insertpos == -1 && return
166166

@@ -196,7 +196,7 @@ function reexport_module(x::EXPR, server, conn)
196196
exported_names = find_exported_names(mod_expr)
197197

198198
isempty(exported_names) && return
199-
file, offset = get_file_loc(x)
199+
file, _ = get_file_loc(x)
200200
insertpos = get_next_line_offset(using_stmt)
201201
insertpos == -1 && return
202202
names = filter!(s -> !isempty(s), collect(CSTParser.str_value.(exported_names)))
@@ -210,8 +210,6 @@ end
210210
function wrap_block(x, server, type, conn) end
211211
function wrap_block(x::EXPR, server, type, conn)
212212
file, offset = get_file_loc(x) # rese
213-
l0, _ = get_position_at(file, offset)
214-
l1, _ = get_position_at(file, offset + x.span)
215213
if type == :if
216214
tde = TextDocumentEdit(VersionedTextDocumentIdentifier(file._uri, file._version), TextEdit[
217215
TextEdit(Range(file, offset .+ (0:0)), "if CONDITION\n"),
@@ -228,7 +226,7 @@ function is_fixable_missing_ref(x::EXPR, cac::CodeActionContext)
228226
xname = StaticLint.valofid(x)
229227
tls = StaticLint.retrieve_toplevel_scope(x)
230228
if tls isa StaticLint.Scope && tls.modules !== nothing
231-
for (n, m) in tls.modules
229+
for m in values(tls.modules)
232230
if (m isa SymbolServer.ModuleStore && haskey(m, Symbol(xname))) || (m isa StaticLint.Scope && StaticLint.scopehasbinding(m, xname))
233231
return true
234232
end
@@ -241,7 +239,6 @@ end
241239
function applymissingreffix(x, server, conn)
242240
xname = StaticLint.valofid(x)
243241
file, offset = get_file_loc(x)
244-
l, c = get_position_at(file, offset)
245242
tls = StaticLint.retrieve_toplevel_scope(x)
246243
if tls.modules !== nothing
247244
for (n, m) in tls.modules

0 commit comments

Comments
 (0)