Skip to content

Commit 9b7ce5d

Browse files
authored
Merge branch 'master' into disable-comp
2 parents bb793f7 + 3c5fc4d commit 9b7ce5d

33 files changed

+1074
-333
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', '1.6']
13+
julia-version: ['1.0', '1.1', '1.2', '1.3', '1.4', '1.5', '1.6', '1.7']
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', '1.6']
12+
julia-version: ['1.0', '1.1', '1.2', '1.3', '1.4', '1.5', '1.6', '1.7']
1313
julia-arch: [x64, x86]
1414
os: [ubuntu-latest, windows-latest, macOS-latest]
1515
exclude:

.github/workflows/jlpkgbutler-tagbot-workflow.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
name: TagBot
22
on:
3-
schedule:
4-
- cron: 0 * * * *
3+
issue_comment:
4+
types:
5+
- created
6+
workflow_dispatch:
57
jobs:
68
TagBot:
9+
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
710
runs-on: ubuntu-latest
811
steps:
912
- uses: JuliaRegistries/TagBot@v1

Project.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
name = "LanguageServer"
22
uuid = "2b0e0bc5-e4fd-59b4-8912-456d1b03d8d7"
3-
version = "3.2.1-DEV"
3+
version = "4.2.1-DEV"
44

55
[deps]
66
CSTParser = "00ebfdb7-1f24-5e51-bd34-a7502290713f"
7-
DocumentFormat = "ffa9a821-9c82-50df-894e-fbcef3ed31cd"
87
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
98
JSONRPC = "b9b8584e-8fd3-41f9-ad0c-7255d428e418"
9+
JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
1010
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
11+
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
1112
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
1213
StaticLint = "b3cc710f-9c33-5bdb-a03d-a94903873e97"
1314
SymbolServer = "cf896787-08d5-524d-9de7-132aaa0cb996"
@@ -16,23 +17,22 @@ URIParser = "30578b45-9adc-5946-b283-645ec420af67"
1617
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
1718

1819
[compat]
19-
CSTParser = "3.1"
20-
DocumentFormat = "3.2.2"
20+
CSTParser = "3.3"
2121
JSON = "0.20, 0.21"
2222
JSONRPC = "1.1"
23-
StaticLint = "7, 8.0"
24-
SymbolServer = "6, 7.0"
23+
JuliaFormatter = "0.20.0, 0.21, 0.22"
24+
StaticLint = "8.0"
25+
SymbolServer = "7.1"
2526
Tokenize = "0.5.10"
2627
URIParser = "0.4.1"
2728
julia = "1"
2829

2930
[extras]
3031
LibGit2 = "76f85450-5226-5b5a-8eaa-529ad045b433"
31-
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
3232
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
3333
Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
3434
Sockets = "6462fe0b-24de-5631-8697-dd941f90decc"
3535
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
3636

3737
[targets]
38-
test = ["Test", "Sockets", "Pkg", "LibGit2", "Serialization", "SHA"]
38+
test = ["Test", "Sockets", "LibGit2", "Serialization", "SHA"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Julia as follows:
3434

3535
```sh
3636
julia --project=/path/to/LanguageServer.jl/environment \
37-
-e "using LanguageServer, LanguageServer.SymbolServer; runserver()" \
37+
-e "using LanguageServer; runserver()" \
3838
<env_path>
3939
```
4040

src/LanguageServer.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module LanguageServer
22
import URIParser
3-
using JSON, REPL, CSTParser, DocumentFormat, SymbolServer, StaticLint
4-
using CSTParser: EXPR, Tokenize.Tokens, Tokenize.Tokens.kind, headof, parentof, valof
3+
using JSON, REPL, CSTParser, JuliaFormatter, SymbolServer, StaticLint
4+
using CSTParser: EXPR, Tokenize.Tokens, Tokenize.Tokens.kind, headof, parentof, valof, to_codeobject
55
using StaticLint: refof, scopeof, bindingof
66
using UUIDs
77
using Base.Docs, Markdown
@@ -16,6 +16,7 @@ include("protocol/protocol.jl")
1616
include("extensions/extensions.jl")
1717
include("document.jl")
1818
include("languageserverinstance.jl")
19+
include("multienv.jl")
1920
include("runserver.jl")
2021
include("staticlint.jl")
2122

src/document.jl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ function set_doc(x::EXPR, doc)
3232
x.meta.error = doc
3333
end
3434

35+
function get_path(doc)
36+
return doc._path
37+
end
3538

3639
function get_text(doc::Document)
3740
return doc._content
@@ -65,7 +68,7 @@ end
6568
"""
6669
get_offset(doc, line, char)
6770
68-
Returns the byte offset position corresponding to a line/character position.
71+
Returns the 0 based byte offset position corresponding to a line/character position.
6972
This takes 0 based line/char inputs. Corresponding functions are available for
7073
Position and Range arguments, the latter returning a UnitRange{Int}.
7174
"""
@@ -99,6 +102,7 @@ get_offset(doc, p::Position) = get_offset(doc, p.line, p.character)
99102
get_offset(doc, r::Range) = get_offset(doc, r.start):get_offset(doc, r.stop)
100103

101104
# 1-based. Basically the index at which (line, character) can be found in the document.
105+
get_offset2(doc::Document, p::Position, forgiving_mode=false) = get_offset2(doc, p.line, p.character, forgiving_mode)
102106
function get_offset2(doc::Document, line::Integer, character::Integer, forgiving_mode=false)
103107
line_offsets = get_line_offsets2!(doc)
104108
text = get_text(doc)
@@ -131,9 +135,12 @@ function get_offset2(doc::Document, line::Integer, character::Integer, forgiving
131135
pos = nextind(text, pos)
132136
end
133137

134-
return pos
138+
return pos
135139
end
136140

141+
# get_offset, but correct
142+
get_offset3(args...) = get_offset2(args...) - 1
143+
137144
# Note: to be removed
138145
function obscure_text(s)
139146
i = 1

src/extensions/messagedefs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
const julia_getModuleAt_request_type = JSONRPC.RequestType("julia/getModuleAt", VersionedTextDocumentPositionParams, String)
2-
const julia_getCurrentBlockRange_request_type = JSONRPC.RequestType("julia/getCurrentBlockRange", VersionedTextDocumentPositionParams, 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)

0 commit comments

Comments
 (0)