@@ -17,15 +17,15 @@ type ReqContext struct {
17
17
func NewReqContext (textDocument protocol.TextDocumentIdentifier ) * ReqContext {
18
18
return & ReqContext {
19
19
textDocument : textDocument ,
20
- textDocumentEntry : * langserver .documentCache .documents [textDocument .URI ],
20
+ textDocumentEntry : * ls .documentCache .documents [textDocument .URI ],
21
21
}
22
22
}
23
23
24
24
func NewReqContextAtPosition (position * protocol.TextDocumentPositionParams ) * ReqContext {
25
25
return & ReqContext {
26
26
textDocument : position .TextDocument ,
27
27
position : position .Position ,
28
- textDocumentEntry : * langserver .documentCache .documents [position .TextDocument .URI ],
28
+ textDocumentEntry : * ls .documentCache .documents [position .TextDocument .URI ],
29
29
}
30
30
}
31
31
@@ -77,7 +77,7 @@ func (rc *ReqContext) moduleDeclarations() []ast.Decl {
77
77
if rc .item .URI == fileUrl {
78
78
continue
79
79
}
80
- docEntry := langserver .documentCache .documents [fileUrl ]
80
+ docEntry := ls .documentCache .documents [fileUrl ]
81
81
if docEntry == nil || docEntry .sourceFile == nil {
82
82
continue
83
83
}
@@ -100,19 +100,19 @@ func (rc *ReqContext) importedDeclarations(context *glsp.Context) []importedDecl
100
100
101
101
globals := make ([]importedDecl , 0 )
102
102
103
- resolvedPrelude , err := langserver .resolver .ResolveModuleFromPackage (rc .textDocumentEntry .module .Package (), "prelude" )
103
+ resolvedPrelude , err := ls .resolver .ResolveModuleFromPackage (rc .textDocumentEntry .module .Package (), "prelude" )
104
104
if err != nil {
105
- langserver .server .Log .Error (err .Error ())
105
+ ls .server .Log .Error (err .Error ())
106
106
} else {
107
107
openModuleTextDocumentsIfNeeded (context , resolvedPrelude )
108
108
}
109
109
110
110
for _ , sameModuleFile := range resolvedPrelude .Files {
111
111
fileUri := "file://" + sameModuleFile
112
- if langserver .documentCache .documents [fileUri ] == nil {
112
+ if ls .documentCache .documents [fileUri ] == nil {
113
113
continue
114
114
}
115
- entry := langserver .documentCache .documents [fileUri ]
115
+ entry := ls .documentCache .documents [fileUri ]
116
116
if entry .sourceFile == nil {
117
117
continue
118
118
}
@@ -126,19 +126,19 @@ func (rc *ReqContext) importedDeclarations(context *glsp.Context) []importedDecl
126
126
continue
127
127
}
128
128
importDecl := decl .(ast.DeclImport )
129
- resolvedModule , err := langserver .resolver .ResolveModuleFromPackage (rc .textDocumentEntry .module .Package (), importDecl .ModuleName )
129
+ resolvedModule , err := ls .resolver .ResolveModuleFromPackage (rc .textDocumentEntry .module .Package (), importDecl .ModuleName )
130
130
if err != nil {
131
- langserver .server .Log .Error (err .Error ())
131
+ ls .server .Log .Error (err .Error ())
132
132
} else {
133
133
openModuleTextDocumentsIfNeeded (context , resolvedModule )
134
134
}
135
135
136
136
for _ , sameModuleFile := range resolvedModule .Files {
137
137
fileUri := "file://" + sameModuleFile
138
- if langserver .documentCache .documents [fileUri ] == nil {
138
+ if ls .documentCache .documents [fileUri ] == nil {
139
139
continue
140
140
}
141
- entry := langserver .documentCache .documents [fileUri ]
141
+ entry := ls .documentCache .documents [fileUri ]
142
142
if entry .sourceFile == nil {
143
143
continue
144
144
}
0 commit comments